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

pytest-benchmark fails with setup.py:tests_require #42

Closed
foxx opened this issue Jan 5, 2016 · 6 comments
Closed

pytest-benchmark fails with setup.py:tests_require #42

foxx opened this issue Jan 5, 2016 · 6 comments

Comments

@foxx
Copy link

foxx commented Jan 5, 2016

The following is inside setup.py;

    tests_require=[
        'pytest-benchmark>=3.0',
        'pytest-raisesregexp>=2.1',
        'pytest-cov>=2.2.0',
        'pytest>=2.8.5',
        'webtest>=2.0.20',
        'tox'
    ]

However, running python setup.py test results in the following;

Searching for pytest-benchmark>=3.0
Reading https://pypi.python.org/simple/pytest-benchmark/
Best match: pytest-benchmark 3.0.0
Downloading https://pypi.python.org/packages/source/p/pytest-benchmark/pytest-benchmark-3.0.0.zip#md5=f8ab8e438f039366e3765168ad831b4c
Processing pytest-benchmark-3.0.0.zip
Writing /tmp/easy_install-tcebs675/pytest-benchmark-3.0.0/setup.cfg
Running pytest-benchmark-3.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-tcebs675/pytest-benchmark-3.0.0/egg-dist-tmp-8ifylcko
error: Setup script exited with error in pytest-benchmark setup command: Invalid environment marker: python_version < "3.4"

If I install the package first with pip install pytest-benchmark, then the error goes away.

I'm guessing it has something to do with this line.

@ionelmc
Copy link
Owner

ionelmc commented Jan 5, 2016

I suspect this is caused by a too old setuptools. Can you upgrade it and try again?

@foxx
Copy link
Author

foxx commented Jan 5, 2016

Indeed the version is quite old, 3.3 to be exact.

However this is the default that comes with Ubuntu 14.04 LTS, the current stable release of Ubuntu, and arguably the most popular out of them all. An alternative is to do an in-line upgrade of dist setuptools, however this might break apt packages that rely on 3.3. Another alternative is to use pyenv, but this adds an additional pre-req for the user.

Given that pytest makes certain allowances to support older versions of Python, would it not make sense to also support older versions of setuptools, especially when there is a potentially large user base on that version? Unless of course the feature being relied upon is critical and not reproducible in 3.3.

If I can find a fix that will make this work with 3.3, would you consider a PR?

@ionelmc
Copy link
Owner

ionelmc commented Jan 5, 2016

The only possible fix I see is removal of the environment markers and having a runtime check in setup.py (install_requires=['statistics'] if python less than 3.4 else []) but that would create other subtle problems when using pip 7.0 (wheel poisoning basically).

I'm using 14.04 as well and it ain't a problem for me - I avoid any python package from their repos, they are old and have various bugs.

Installing a newer setuptools should be fine as long as you use pip to install/upgrade it (and not setup.py install or easy_install -U setuptools - those create problematic "egg installs").

The other alternative is to not depend on statistics and pathlib at all. We could use https://pypi.python.org/pypi/pathlib2 and some other statistics lib but I'm a bit wary of that ...

@foxx
Copy link
Author

foxx commented Jan 5, 2016

I avoid any python package from their repos, they are old and have various bugs.

This is very true, although it can also cause problems when performing apt-get upgrade (e.g. conflicts detected etc). Granted these are edge cases which are eliminated if you're using immutable deployment best practices.

I'm tempted to vote closing this issue out, but I don't know enough about the "wheel poisoning" problems to make a sound judgement. Is this something that is fixable, or would it simply not be worth the time/effort trying to fix?

@ionelmc
Copy link
Owner

ionelmc commented Jan 5, 2016

You could read about it in pypa/pip#3025 I suppose.

Though using non-universal wheels still don't fix the issue - we'd need a wheel for each python version. Lots of pain, unclear benefit.

I already stretched the platform support quite far - even 2.6 and 3.2 are supported - I don't think I can stretch it even for broken installers 😒

@foxx
Copy link
Author

foxx commented Jan 5, 2016

Yeah agreed, there has to be a line in the sand somewhere. I actually refuse to support 2.6 for that very reason! Closing out as wontfix, thanks for the quick replies :)

@foxx foxx closed this as completed Jan 5, 2016
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

2 participants