Skip to content
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

Installing: Invalid environment marker: python_version<"3.4" #358

Closed
moylop260 opened this issue Aug 22, 2016 · 15 comments
Closed

Installing: Invalid environment marker: python_version<"3.4" #358

moylop260 opened this issue Aug 22, 2016 · 15 comments

Comments

@moylop260
Copy link
Contributor

moylop260 commented Aug 22, 2016

Steps to reproduce

  1. pip install --upgrade git+https://github.com/PyCQA/astroid@41a0c

Current behaviour

Error

Collecting git+https://github.com/PyCQA/astroid@41a0c
  Cloning https://github.com/PyCQA/astroid (to 41a0c) to /var/folders/zc/1m37yppx4z5596yfyzg385140000gn/T/pip-Z0zkzq-build
  Could not find a tag or branch '41a0c', assuming commit.
    Complete output from command python setup.py egg_info:
    error in astroid setup command: Invalid environment marker: python_version<"3.4"

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /var/folders/zc/1m37yppx4z5596yfyzg385140000gn/T/pip-Z0zkzq-build/

Expected behavior

No error

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

Sha: 41a0c77

python --version
Python 2.7.10

python -m pip --version
pip 8.1.2 from /Users/moylop260/Library/Python/2.7/lib/python/site-packages (python 2.7)

python -c "import setuptools;print setuptools.version"
1.1.6

Same case for https://travis-ci.org/Vauxoo/pylint-odoo/jobs/154185968#L456

@PCManticore
Copy link
Contributor

Try to update setuptools and see if the problem goes away.

@moylop260
Copy link
Contributor Author

$ pip install --upgrade --user setuptools pip
Collecting setuptools
  Using cached setuptools-26.0.0-py2.py3-none-any.whl
Requirement already up-to-date: pip in /Users/moylop260/Library/Python/2.7/lib/python/site-packages
Installing collected packages: setuptools
Successfully installed setuptools-1.1.6

$ pip install --user --upgrade git+https://github.com/PyCQA/astroid@41a0c
Collecting git+https://github.com/PyCQA/astroid@41a0c
  Cloning https://github.com/PyCQA/astroid (to 41a0c) to /var/folders/zc/1m37yppx4z5596yfyzg385140000gn/T/pip-4l21cO-build
  Could not find a tag or branch '41a0c', assuming commit.
    Complete output from command python setup.py egg_info:
    error in astroid setup command: Invalid environment marker: python_version<"3.4"

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /var/folders/zc/1m37yppx4z5596yfyzg385140000gn/T/pip-4l21cO-build/

FYI our CI show the same error: https://travis-ci.org/Vauxoo/pylint-odoo/jobs/154185968#L456

@PCManticore
Copy link
Contributor

Why does it say Successfully installed setuptools-1.1.6? For what it's worth, this works perfectly for me using 25+.

@moylop260
Copy link
Contributor Author

You are right!

virtualenv /tmp/test
cd /tmp/test
source bin/activate
pip install --upgrade setuptools pip
python -c "import setuptools;print setuptools.__version__"
# 26.0.0
pip install --upgrade git+https://github.com/PyCQA/astroid@41a0c
Successfully installed astroid-1.5.0...

We have the same issue with our travis.
What is the best way to fix it?
Is a good idea to have incompatibility with other setuptools versions?

@jayvdb
Copy link
Contributor

jayvdb commented Aug 22, 2016

The problem is setuptools has incompatibility with itself for environment markers.
You can read more about it at pypa/packaging#72 (comment) to the end.
And setup_requires is not a solution that works reliably for older versions of setuptools either.

And setuptools downgrading to 1.1.6 on travis is not something I have seen before, and should be considered a bug somewhere else (not astroid). It might be another case of #4194 (which I have only glanced at, so I might be off base there).

@moylop260
Copy link
Contributor Author

moylop260 commented Aug 22, 2016

Thanks @jayvdb for the information.
My question is:
Should astroid lose full compatibility with old setuptools and show this error in some environments?

I mean, What is the advantage of use 41a0c77 vs disadvantages?

@jayvdb
Copy link
Contributor

jayvdb commented Aug 22, 2016

The advantage is universal wheels. And the disadvantages are it doesnt work on many versions of setup tools, unless my hack is added.

@PCManticore
Copy link
Contributor

Does this issue still has to be open? From my point of view, the environment markers are quite important when having to deal with multiple Python releases, each with a different set of dependencies, which is why 41a0c77 (and similar commits in pylint) was made in the first place. A release was fudged, because the wheel was built with 3.5, but the installation failed on older 3.X versions.

@jayvdb
Copy link
Contributor

jayvdb commented Aug 23, 2016

A release was fudged, because the wheel was built with 3.5...

The release is a universal wheel, so that should not matter.

@PCManticore
Copy link
Contributor

I might have forgot the details, but this happened because some of
dependencies were not installed when installing astroid / pylint on other
releases, due to the Python version checks in the installation script. The
environment markers fixed this, so something was amiss there.

On Aug 23, 2016 9:02 AM, "John Vandenberg" notifications@github.com wrote:

A release was fudged, because the wheel was built with 3.5...

The release is a universal wheel, so that should not matter.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#358 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAbWppXGI81uwK-w_9VByyvIxK-Zlbw6ks5qioz-gaJpZM4Jp-Pz
.

@jayvdb
Copy link
Contributor

jayvdb commented Aug 23, 2016

Ah ok. Yes environment markers are needed. But this bug is about older setuptools not understanding environment markers, even as recently as setuptools 21.

@PCManticore
Copy link
Contributor

I know that, the question is if we have to do something here, from astroid's perspective. Requiring a more up to date setuptools version seems weird, since it is not a dependency per se of the library.

@moylop260
Copy link
Contributor Author

I don't know if is a good idea for you but I added the old code with new one for full compatibility.
Let me know if is a bad idea: https://github.com/PyCQA/astroid/pull/360/files

@PCManticore
Copy link
Contributor

Do we still need this opened?

@moylop260
Copy link
Contributor Author

For record
Fixed for astroid #360 and fixed for pylint pylint-dev/pylint#1107

nworden added a commit to nworden/personfinder that referenced this issue Apr 4, 2019
Suggested here for someone else with a similar (or identical) problem:
pylint-dev/astroid#358 (comment)
nworden added a commit to google/personfinder that referenced this issue Apr 4, 2019
* Make pylint and yapf happy with test_xsrftool.py.

* Make pylint and yapf happy with test_searcher.py.

* Update lint tool.

* Add partial linting to Travis tests.

* leave TODOs alone

* add comment on separate yapf and pylint lists

* Run lint tool under Python 2.

* Add python-setuptools to Travis install step.

Seems to be required with the older version of Python 2.7.

* Revert "Add python-setuptools to Travis install step."

This reverts commit c6360b4.

It didn't help.

* Add lint script to tools/all_tests.

* Run style checks first for Travis.

* Try updating setuptools.

Suggested here for someone else with a similar (or identical) problem:
pylint-dev/astroid#358 (comment)

* Use pylint 1.9.2, because it supports Python 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants