-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
20.5.0+ breaks existing setup.py files - UndefinedEnvironmentName #523
Comments
Seems to be related to this commit d25e2a5 |
@s-t-e-v-e-n-k Can you look into this one? @lnielsen How severe is the failure? Should I pull 20.5+ from PyPI? |
Looks pretty serve. Just upgrading setuptools in a virtualenv breaks the code. |
Just debugging now to provide some more information. |
I've removed 20.6.4 and 20.5.0 until the issue can be resolved. |
Also seeing this. |
My colleague has been looking into this and he thinks that it has to do with the fact that our tests are using a variable/parameter name called |
I am seeing this in code that has variables and parameters named |
@lnielsen I can't reproduce this. How are you getting that traceback? What commands are you executing? What is the logging leading up to it? Is there anything that follows it? |
I can't replicate this either. I inferred from the link that the command being executed is I sense now that the failures are fairly isolated and only affecting tests, so I'm going to re-release the code in the latest version, but I am eager to see a fix for this issue, so do please provide more detail to describe how one can recreate the issue, preferably with a minimal use case. |
Our teams are encountering this when using the webtest API in a py.test fixture, so it affects all of their tests. I do not yet have a workaround that successfully builds against the webtest classes without triggering the setuptools bug, so those teams cannot even run commit tests to integrate new code. |
@bszonye Sorry. I don't mean to cause you trouble. Can you pin your environment to Setuptools 20.4 until the issue can be resolved? |
That’s what I recommended to the team for now, to pin setuptools<20.5 – tomorrow I will take a closer look to see if I can find a minimal test case. |
@jaraco Just confirmed with the team that version 20.6.6 does break their tests again, but they are able to work around by pinning to the 20.4 version. I suspect that something in packaging is misidentifying Our traceback ends at the same place but starts with py.test instead of setup.py test:
|
@bszonye I'd like to see which requirement is causing this issue, are you able to edit the virtual env's copy of local/lib/python2.7/site-packages/pkg_resources/init.py to log what 'req' is set to just before the call to req.marker.evaluate()? I'd personally use the q module. |
This is biting us too, on today's (brand-new) release of If I add a
followed by the same traceback as above. Tahoe depends, among most of those other things, on Nevow wants Grepping through our code, we do have functions and variables with Please let me know if there's anything I can do to help track this one down. |
I don't know this code very well, but I think the requirement that it's tripping on is this one from Twisted's dist-info/METADATA file:
and I think the I know the line-based METADATA format necessarily merges extras and markers into the same syntax. Is this causing confusion? I see calls to e.g. |
extra == 'tls' is a valid environment marker. But yes, you're totally right, the evaluate() call needs to respect extras, which I'll be looking at tomorrow. |
For clarity, extra=='tls' is not a valid marker for setup.py scripts. Its valid in the syntax for distribution metadata only. Callers of the Python API must supply a extra mapping when evaluating requirements specifications if they are processing distribution metadata entries (like the one above) . tl;dr: pkg_resources, when processing METADATA files can supply a value for extra. It may be wired up wrongly at the moment. extra can't be used from setup_requires or other such places though - its a gnarly thing in the distirbution metadata spec, not a user interface element. I'll look more closely at the actual calling code tomorrow - this is mainly meant to hint to folk that have already been looking at it. |
Oh, and - 23:19 < warner> we've got a requirement on "twisted[tls]", and twisted"s got an extra that says [tls] needs pyopenssl from IRC. HTH |
Also just tripped over this, to reproduce:
Reverting back to an older setuptools with |
Thanks @autopulated - I was able to reproduce the issue with those commands. This definitely is a widespread issue. Rather than pull the latest releases, I'm going to disable this new functionality until a solution can be implemented. |
I'm seeing this also when running a console entry point: I happened when executing an entry point, here's the setup.py definition:
and the stack trace:
|
v20.6.7 is released bypassing the issue. |
Thanks for the troubleshooting tips, @s-t-e-v-e-n-k – I’ll see which requirement is causing the problem for us. I now suspect that it’s something dynamically loaded in Pyramid, and the |
I am getting this same issue.
|
@gitrookie: What version of setuptools do you have? Looks like you have a wheel called pkg_resources-0.0.0, which I think is an unreleased and unsupported version of pkg_resources. |
This seems to be broken again in setuptools 28.0.0: I was generating message files with pybabel from jinja templates when I got this exception. Downgrading setuptools to 27.3.1 fixed the issue. |
Still experiencing this with 28.8.0 when calling PyBabel (27.3.1 works fine):
|
So here's the diff from 27.3.1 to 28.0.0. I don't see anything there that appears relevant to the issue at hand. The one change in pkg_resources is only dealing with encoding issues. Using the commands where I was able to replicate the issue earlier, I'm unable to replicate it now with Setuptools 28.0.0:
I also installed babel, but I don't have the state on my system to try to replicate the failure. If you're running into this issue, please include steps to replicate the issue in a clean environment. Also, include the details from |
Okay, more info. Clean virtualenv, installed pybabel and jinja2 with deps.
Possibly relevant:
And the result is:
|
I get this on a clean docker install based on ubuntu:xenial. Virtualenv created with '$ virtualenv --no-site-packages ' Within the virtualenv, I have this:
And I get this:
|
Here's a reproducible version of the bug.
and then try to build it:
You'll get the error message from my previous comment. |
And here's a workaround which I don't understand. Downgrading and then upgrading back to the same version and it works.
|
@rwillmer: What do you get if you invoke |
|
Same here:
After downgrading and upgrading In order to set up CKAN I was using this Ansible script: https://github.com/sirex/ckan-ivpk-import/blob/master/ckan.yml |
Was also trying to install CKAN, and indeed @rwillmer's fix worked. |
Simply reinstalling the same version of setuptools solves it too. e.g.
|
Still getting this on fresh virtualenv with 36.0.1:
|
Same with 36.5.0, reinstalling the same version fixes the issue:
|
Building the virtualenv as root caused us to run into [this][1] pip/setuptools issue. The suggested work around didn't help as the root owned virtualenv's pip didn't actually reinstall setuptools (for reasons I could not work out). Installing as the ubuntu user fixes this. [1]: pypa/setuptools#523
Building the virtualenv as root caused us to run into [this][1] pip/setuptools issue. The suggested work around didn't help as the root owned virtualenv's pip didn't actually reinstall setuptools (for reasons I could not work out). Installing as the ubuntu user fixes this. [1]: pypa/setuptools#523
I had to manually downgrade setuptools to 34.00 to get around the "UndefinedEnvironmentName: 'extra' does not exist in evaluation environment." issue at runtime. (Ubuntu 16.04, python 2..7.12 virtualenv) after running pip install -r ...
(34.00 is minimum required by my installed packages. The default, 39, triggers the error at runtime) |
Hit this today trying to build and install from a github repo with pip install git+git://github.com/repo. Downgraded setuptools-38.5.1 to setuptools-34.00 and this resolved it so I could successfully install. |
I am getting this also when installing gevent pip==18.1
However, if as @bmjjr stated, I downgrade to |
You'll have to give more information than that. I can't reproduce with a fresh virtualenv/venv with Python 2.7 / Python 3.7. I setuptools unvendored? |
Additionally, this occurs in the "check for conflicts phase" of pip's install, which means any one of the other distributions currently installed could be the problem, so it would be worth checking with pypa/pip#5842 to find out which one. |
The latest 20.6.4 PyPI is breaking our setup.py files with the following exception:
The text was updated successfully, but these errors were encountered: