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 is causing dependency_links to be ignored #2756

Closed
dagostinelli opened this issue Sep 6, 2017 · 2 comments
Closed

pytest is causing dependency_links to be ignored #2756

dagostinelli opened this issue Sep 6, 2017 · 2 comments

Comments

@dagostinelli
Copy link

dagostinelli commented Sep 6, 2017

When I run python setup.py test, I expect my unit tests to run and dependencies to get installed. Instead, PyPi is getting searched and dependency_links is getting ignored.

Also, I've noticed (a ton of) other issues all over the internet mentioning how dependency_links is getting ignored. I didn't run across anything yet where pytest was suspected.

setup.py

from setuptools import setup, find_packages

setup(
	name='MyApp',
	version='1.0',
	maintainer='Me',
	maintainer_email='me@somewhere.com',
	url='http://www.somewhere.com',
	packages = find_packages(),
	install_requires=['myotherproject==1.0'],
	setup_requires=['pytest-runner', 'pytest'],
	tests_require=['pytest', 'pytest-asyncio', 'myotherproject==1.0'],
	test_suite='tests',
	dependency_links=['git+ssh://myname@myserver:/git/path/to/stuff/myotherproject@master#egg=myotherproject-1.0'],
	include_package_data=True,
)

When I use the above with python setup.py test, myotherproject gets installed into .eggs.

If I then add a setup.cfg file like so to activate pytest:

setup.cfg

[aliases]
test=pytest

Then python setup.py test ignores dependency_links and attempts to search pypi for the myotherproject (and naturally it can't find it and errors out)

Then I just comment out the lines in setup.cfg and re-run python setup.py test and it works again.

setup.cfg

#[aliases]
#test=pytest
@RonnyPfannschmidt
Copy link
Member

pytest is completely unrelated to setup.py test

please file the issue in projects like pytest-runner or setuptools

@dagostinelli
Copy link
Author

Hardly "completely unrelated"...

The whole point of setup.cfg with a test=pytest directive in it is so that pytest can take over unit testing from the built in test framework and maintain compatibility. And pytest-runner is in the same GitHub team as pytest.

I'll move it though -- thank you for the note.

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