How do I force `setup.py test` to install dependencies into my `virtualenv`?

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, … Read more

How do I use data in package_data from source code?

The standard pkgutil module’s get_data() function will calculate the path to your data, relative to your package, and retrieve the data for you via whatever module loader Python used to import the hermes package: import pkgutil data = pkgutil.get_data(‘hermes’, ‘templates/python.tpl’) Of course in certain cases you could just read your data using a path calculated … Read more

PIP: Installing only the dependencies

If your dependencies are defined in the setup.py file, you can first dump them to an external file using: python setup.py egg_info This will list all your dependencies in YOUR_PROJECT.egg-info/requires.txt file. Then you can install them using pip: pip install -r *.egg-info/requires.txt to delete what you just created: rm -rf *.egg-info/ to save some time … Read more

Does pip handle extras_requires from setuptools/distribute based sources?

We use setup.py and pip to manage development dependencies for our packages, though you need a newer version of pip (we’re using 1.4.1 currently). #!/usr/bin/env python from setuptools import setup from myproject import __version__ required = [ ‘gevent’, ‘flask’, … ] extras = { ‘develop’: [ ‘Fabric’, ‘nose’, ] } setup( name=”my-project”, version=__version__, description=”My awsome … Read more

Specify where to install ‘tests_require’ dependencies of a distribute/setuptools package

You cannot specify where the test requirements are installed. The whole point of the tests_require parameter is to specify dependencies that are not required for the installation of the package but only for running the tests (as you can imagine many consumers might want to install the package but not run the tests). If you … Read more

How do setuptools, distribute, and pip relate to one another?

[2014-10 TL;DR: distribute is dead, use pip, the new setuptools, and, for binary distributions, wheels. More below.] [Original answer] Distribute is was a fork of the older setuptools so nearly all comments that follow apply equally to Distribute and setuptools. Setuptools was an attempt to fill in a number of holes in the even older … Read more

How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix

We also develop software projects that depend on numpy, scipy and other PyPI packages. Hands down, the best tool currently available out there for managing remote installations is zc.buildout. It is very easy to use. You download a bootstrapping script from their website and distribute that with your package. You write a “local deployment” file, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)