My Setup
My package lies inside an src directory. This decision was inspired by Ionel's blog post.
The parts of my config relevant to this issue are:
In setup.py
setup(
packages=find_packages('src'),
package_dir={'': 'src'},
tox.ini:
[testenv]
usedevelop=True
Problem
I noticed that develop-inst-nodeps was being run on every call to tox, even though the docs mention:
There is an optimization coded in to not bother re-running the command if $projectname.egg-info is newer than setup.py or setup.cfg.
This is because it only looks for the egg-info in the same directory as setup.py. However, it seems to me setup.py develop outputs egg-info to the package_dir, in my case src. Here is the relevant part of the tox code (in venv.py):
setup_py = setupdir.join('setup.py')
egg_info = setupdir.join('.'.join((name, 'egg-info')))
Suggestions
Of course, it could be I'm just missing something and that this is not the recommended approach. Assuming this is indeed a bug, here are my suggestions.
The best way would be to find out what package_dir is and look for egg-info in that directory. After a bit of digging it doesn't seem it can simply be extracted from the python setup.py command (like --name for instance). Then, one could either parse the setup.py file or the output of python setup.py develop, both of which I think are quite messy.
The other, much much simpler way, is to allow a package_dir key in tox.ini. This results in duplicated information...but how often is that setting likely to be changed?
I'd be up for submitting a PR for the latter approach.
My Setup
My package lies inside an
srcdirectory. This decision was inspired by Ionel's blog post.The parts of my config relevant to this issue are:
In
setup.pytox.ini:Problem
I noticed that
develop-inst-nodepswas being run on every call to tox, even though the docs mention:This is because it only looks for the
egg-infoin the same directory assetup.py. However, it seems to mesetup.py developoutputsegg-infoto thepackage_dir, in my casesrc. Here is the relevant part of the tox code (invenv.py):Suggestions
Of course, it could be I'm just missing something and that this is not the recommended approach. Assuming this is indeed a bug, here are my suggestions.
The best way would be to find out what
package_diris and look foregg-infoin that directory. After a bit of digging it doesn't seem it can simply be extracted from thepython setup.pycommand (like--namefor instance). Then, one could either parse thesetup.pyfile or the output ofpython setup.py develop, both of which I think are quite messy.The other, much much simpler way, is to allow a
package_dirkey intox.ini. This results in duplicated information...but how often is that setting likely to be changed?I'd be up for submitting a PR for the latter approach.