Similar to https://stackoverflow.com/questions/12518499/pip-ignores-dependency-links-in-setup-py
I'm modifying faker in anticipation to an open PR I have open with validators, and I want to be able to test the new dependency i will have.
setup(
name='Faker',
...
install_requires=[
"python-dateutil>=2.4",
"six>=1.10",
"text-unidecode==1.2",
],
tests_require=[
"validators@https://github.com/kingbuzzman/validators/archive/0.13.0.tar.gz#egg=validators-0.13.0", # TODO: this will change # noqa
"ukpostcodeparser>=1.1.1",
...
],
...
)
python setup.py test
refuses to install the 0.13.0 version.
If I move the trouble line up to install_requires=[..]
(which SHOULD not be there)
setup(
name='Faker',
...
install_requires=[
"python-dateutil>=2.4",
"six>=1.10",
"text-unidecode==1.2",
"validators@https://github.com/kingbuzzman/validators/archive/0.13.0.tar.gz#egg=validators-0.13.0", # TODO: this will change # noqa
],
tests_require=[
"ukpostcodeparser>=1.1.1",
...
],
...
)
- using
pip install -e .
everything works great -- the correct version gets installed. - using
python setup.py develop
same issue.
My guess is setuptools/distutils doing something weird -- pip
seems to address the issue. My question: how do I fix this?
Problematic code and references can be found here:
- https://github.com/kingbuzzman/faker/commit/20f69082714fae2a60d356f4c63a061ce99a975e#diff-2eeaed663bd0d25b7e608891384b7298R72
- https://github.com/kingbuzzman/faker
- https://gist.github.com/kingbuzzman/e3f39ba217e2c14a9065fb14a502b63d
- https://github.com/pypa/setuptools/issues/1758
Easiest way to see the issue at hand:
docker run -it --rm python:3.7 bash -c "git clone https://github.com/kingbuzzman/faker.git; cd faker; pip install -e .; python setup.py test"
UPDATE: Since this has been fixed, the issue wont be replicated anymore -- all tests will pass
Unfortunately, neither
setup_requires
nortests_require
support URL-based lookup or environment markers from PEP 508 yet. You need to usedependency_links
, for example