Skip to content

Commit

Permalink
Do the same transformation to egg_info dirs that pkg_resources does
Browse files Browse the repository at this point in the history
To determine whether we should re-install an egg, we look for an .egg-info
directory based on the output of `setup.py --name`, but .egg-info directories
have their dashes transformed into underscores by pkg_resources.to_filename.

When we look for an .egg-info directory, we should apply the same
transformation.
  • Loading branch information
hashbrowncipher committed Oct 10, 2018
1 parent 65b80c9 commit 1bf846d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tox/venv.py
Expand Up @@ -8,6 +8,7 @@
from itertools import chain

import py
from pkg_resources import to_filename

import tox

Expand Down Expand Up @@ -295,7 +296,7 @@ def _needs_reinstall(self, setupdir, action):
sys_path = json.loads(out)
except ValueError:
sys_path = []
egg_info_fname = ".".join((name, "egg-info"))
egg_info_fname = ".".join((to_filename(name), "egg-info"))
for d in reversed(sys_path):
egg_info = py.path.local(d).join(egg_info_fname)
if egg_info.check():
Expand Down

0 comments on commit 1bf846d

Please sign in to comment.