In a crusade to make my application pip
-installable, I'm fighting big fights with setuptools
and distribute
. I assume my dependencies are correct, i.e. installing with pip install myapp
should probably fill the virtual environment correctly. However, I'd like to streamline development while I'm at it, so my goal is to start with an empty virtualenv
and make setup.py test
(and later setup.py develop
, but that's a whole different fight) fill it with all defined dependencies.
And now to my problem: no matter how hard I try, all I get are dependencies installed as .egg
s in my project directory which is sub-optimal at the very least. I tried creating a new setuptools
command which would use pip
(which seems to work, even though awkwardly) but that can't seriously be the solution (subclassing and overriding that is).
So how do I make setup.py test
fill the virtualevn
instead of my working directory?
The pip install <package> command always looks for the latest version of the package and installs it. It also searches for dependencies listed in the package metadata and installs them to ensure that the package has all the requirements that it needs.
To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
@joeforker, pip uses setup.py behind the scenes.
Pip relies on package authors to stipulate the dependencies for their code in order to successfully download and install the package plus all required dependencies from the Python Package Index (PyPI). But if packages are installed one at a time, it may lead to dependency conflicts.
By design, you can't make the tests_requires
or the setup_requires
entries go into the virtual environment. The idea is to separate what is required for performing tests/setup and what is required to actually use the package being installed. For example, I may require that the "coverage" module be needed for running tests on my package, but it isn't used by any of my code in the package. Therefore, if I didn't have "coverage" in my environment when I go and run tests, I wouldn't want "coverage" to get installed into the environment if my package didn't need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With