I am using setuptools for the first time and am trying to pack my code so that others can easily develop it. I run everything in a virtual environment.
Short question . How to change the directory referenced by an egg when I run python setup.py develop ?
The long question . The module I'm developing is called cops_and_robots . When I run python setup.py install , everything works fine and I can import my cops_and_robots module. However, when I run python setup.py develop , import cops_and_robots because cops_and_robots.egg-link points to the wrong directory:
(cops_and_robots)Antares:cops_and_robots nick$ cat ~/virtual_environments/cops_and_robots/lib/python2.7/site-packages/cops-and-robots.egg-link /Users/nick/Downloads/cops_and_robots/ .
Here is the directory structure:
|____Downloads | |____cops_and_robots # the whole package directory | | |____... | | |____requirements.txt | | |____setup.py | | |____src | | | |____cops_and_robots # the python package directory | | | |______init.py__ | | |____...
And my setup.py :
from setuptools import setup, find_packages import ez_setup ez_setup.use_setuptools() setup(
The manual fix is ββto simply add src/cops_and_robots to the cops_and_robots.egg-link file, but I'm looking for a more elegant way to do this.
source share