-
Notifications
You must be signed in to change notification settings - Fork 168
Make PeachPy pip installable #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Great, I saw you just released Opcodes 0.3.10. I will test and update this, unless you interject. |
5beb972
to
20f1353
Compare
Build fails on Windows with Python 2.7: https://ci.appveyor.com/project/MaratDukhan/peachpy/build/0.2.0.223/job/rkde560a3tx4i9ui |
Yes, afaik it fails everywhere at the moment. I'm still working on it. I currently have to work around a slight problem that I'm going to proceed with duplicating the version number and getting rid of the peachpy import from the setup.py for now for sake of seeing if I can make everything else work. |
This now builds for me locally, let's see what travis and appveyor make of it. |
042b8a9
to
c78f709
Compare
OK! I think I'm there. So now, the generated files don't get put in the source directory during installation, they are only directly installed, it seems, through the magic of pip. Therefore, the tests run with With that, I think pip install no works as I would hope for it to. I have not done any documentation updates or anything like this yet. |
Appveyor now passed. |
@@ -88,7 +88,7 @@ def run(self): | |||
"Topic :: Software Development :: Compilers", | |||
"Topic :: Software Development :: Libraries" | |||
], | |||
setup_requires=["Opcodes==0.3.9"], | |||
setup_requires=["Opcodes==0.3.9", "six"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed? setup.py
doesn't import six
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! I put it in when before I understood that the peachpy import needed to be removed. Unfortunately, determining the version comes before setup_requires can be evaluated and install six, so it's not helpful. Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take that back. You can see from the test failures that it turns out this is needed in order to run the codegen itself at setup time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the commit removing six from setup_requires.
66c7ecd
to
c78f709
Compare
# what is installed, not what is in the checked out source directory. | ||
# (Extra files are generated during installation which don't exist in the | ||
# source tree.) | ||
- nosetests --no-path-adjustment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to put no-path-adjustment=1
in setup.cfg
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -77,6 +87,10 @@ def run(self): | |||
"Topic :: Software Development :: Compilers", | |||
"Topic :: Software Development :: Libraries" | |||
], | |||
setup_requires=["Opcodes==0.3.10", "six"], | |||
install_requires=["Opcodes==0.3.10", "six", "enum34"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opcodes
is redundant here. It is needed to generate instruction in PeachPy, but after PeachPy is installed, opcodes
is no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I have selected "Allow edits from maintainers" for this pull request, and I have to sign out very shortly. If you have any other small fixes in the next few minutes, I will make them rapidly. But if I don't respond within 5 minutes you can assume I have signed out for the night. Thanks for looking at this quickly. I would also appreciate a quick look at #60 if you can spare a moment. All the best! 👍 |
LGTM. Please squash commits into one and rename to "Setup: make PIP installable", and I will merge |
This patch makes setuptools a dependency. This is needed to make `setup.py` automatically make the `Opcodes` module available at setup time. Opcodes is made into a setup-time dependency, and if the module is installed with `python setup.py build` or `python setup.py develop` or `pip install PeachPy` or `pip install --editable PeachPy`, then the `python setup.py generate` command is run automatically. This patch depends on Maratyszcza/Opcodes#5 because of the way setuptools handles setup-time dependencies. They are not installed proper, but made available as an .egg file. Opcodes, before Maratyszcza/Opcodes#5, tries to read the XML descriptions by opening a file relative to `__file__`, which is not a thing which can be read with `open()`. Instead, it has to use `pkg_resources` to do so. With these two PRs merged, it should be possible to `pip install git+https://github.com/Maratyszcza/PeachPy`. We could also then discuss making it easy to package up and upload to PyPi. Try removing pip install -r requirements and generate step from installation Add six and enum34 to install_requires Add six to setup_requires Upgrade to Opcodes==0.3.10 Remove peachpy import from setup.py (and duplicate the version number by writing it literally) Fix setup.py for python2.7 Run tests with --no-path-adjustment Put nosetests configuration in setup.cfg Remove Opcodes from install_requires
172dfeb
to
2c62da9
Compare
Done. Please do any further required edits. |
Note: tests failed because the PR was merged before tests had run. |
This patch makes setuptools a dependency. This is needed to make
setup.py
automatically make theOpcodes
module available at setuptime.
Opcodes is made into a setup-time dependency, and if the module is
installed with
python setup.py build
orpython setup.py develop
or
pip install PeachPy
orpip install --editable PeachPy
, thenthe
python setup.py generate
command is run automatically.This patch depends on Maratyszcza/Opcodes#5
because of the way setuptools handles setup-time dependencies. They are
not installed proper, but made available as an .egg file. Opcodes,
before Maratyszcza/Opcodes#5, tries to read the XML descriptions by
opening a file relative to
__file__
, which is not a thing which canbe read with
open()
. Instead, it has to usepkg_resources
to doso.
With these two PRs merged, it should be possible to
pip install git+https://github.com/Maratyszcza/PeachPy
. We could also then discussmaking it easy to package up and upload to PyPi.