Skip to content

Commit

Permalink
fix(pip_setup): Allow setup.py to import from its own package (#8417)
Browse files Browse the repository at this point in the history
  • Loading branch information
hisener committed Jan 25, 2021
1 parent 94e1d14 commit 2e2b330
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def setup():
@mock.patch.object(setuptools, 'setup')
@mock.patch.object(distutils.core, 'setup')
def invoke(mock1, mock2):
# Inserting the parent directory of the target setup.py in Python import path:
sys.path.append(os.getcwd())
# This is setup.py which calls setuptools.setup
load_source('_target_setup_', basename(sys.argv[-1]))
# called arguments are in `mock_setup.call_args`
Expand Down

0 comments on commit 2e2b330

Please sign in to comment.