-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
setup.py containing __requires__ fails when run without rwt #12
Comments
forgot to mention, I'm using python3.6 and setuptools==34.0.0 released a couple of hours ago, but the error also occurs with previous versions of setuptools/pkg_resources as well as with python2.7. |
Hmm. I guess what I meant when I said the script was backward compatible is that if you were relying on I'm not sure what you're expecting to happen beyond that. If you're using I think you're right that if it's not your intention to require the script to be run by I had originally intended for rwt to be a solution to setup_requires, but it appears that rwt contradicts intentions established in PEP 518. |
Does that clarify? |
Yes, thanks for the clarification. |
I think the contradiction comes with the prescribed means of declaration. There's some overlap, though, and there's a good chance the core of rwt can be repurposed to implement PEP 518 after the requirements are parsed. |
* Require toml extra for setuptools_scm setuptools_scm does not know to invoke itself if it can't read pyproject.toml. This broke sdist installs for projects deriving from skeleton: $ python -m pip install zipp --no-binary zipp Collecting zipp [...] Successfully installed zipp-0.0.0 Note the version number defaulting to '0.0.0'. Building locally only works because pep517, the build tool, depends on toml which it exposes to the build environment. * Require setuptools_scm 3.4.1 at a minimum A bare [tool.setuptools_scm] does not work in 3.4.0. * fixup! Require toml extra for setuptools_scm * fixup! Require setuptools_scm 3.4.1 at a minimum
hi @jaraco,
Here's a setup.py which defines
__requires__
for use withrwt
tool. It's taken straight from your README.rst for the sake of example.Now, if I try to run this without also invoking
python -m rwt -- setup.py ...
, like the usual:I get this error from pkg_resources:
The error happens when a requirement listed in
__requires__
(likesetuptools_scm
here) is not already installed in the current environment.It seems like
pkg_resources
(imported by setuptools) also attempts to use the__requires__
variable, inWorkinSet._build_master
method:https://github.com/pypa/setuptools/blob/089cdeb489a0fa94d11b7307b54210ef9aa40511/pkg_resources/__init__.py#L640-L658
This behavior is documented in the pkg_resources docs:
http://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-objects
In your REAME.rst, you say that this technique:
However, it appears to me that one cannot have such a backward-compatible setup.py which also takes advantage of
rwt
via the__requires__
variable, because once one uses that, it fails as one tries to run it in the old-fashioned way.Am I missing something?
Thank you for your help.
In the meantime I think I'll just use
python3 -m rwt -r requirements/setup.txt -- setup.py ...
instead of__requires__
.The text was updated successfully, but these errors were encountered: