Skip to content

Commit 058fadd

Browse files
committed
Install from local path
1 parent 789dff3 commit 058fadd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

readthedocs/doc_builder/python_environments.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ def _run_install_step(self, install):
8181
def install_package(self, install):
8282
rel_path = os.path.relpath(install.path, self.checkout_path)
8383
if install.method == PIP:
84+
# Prefix ./ so pip installs from a local path rather than pypi
85+
local_path = (
86+
os.path.join('.', rel_path) if rel_path != '.' else rel_path
87+
)
8488
extra_req_param = ''
8589
if install.extra_requirements:
8690
extra_req_param = '[{}]'.format(
@@ -93,9 +97,8 @@ def install_package(self, install):
9397
'--ignore-installed',
9498
'--cache-dir',
9599
self.project.pip_cache_path,
96-
'-e',
97100
'{path}{extra_requirements}'.format(
98-
path=rel_path,
101+
path=local_path,
99102
extra_requirements=extra_req_param,
100103
),
101104
cwd=self.checkout_path,

readthedocs/rtd_tests/tests/test_config_integration.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ def test_python_install_pip(self, run, checkout_path, tmpdir):
611611
args, kwargs = run.call_args
612612

613613
assert 'install' in args
614-
assert '-e' in args
615614
assert '.' in args
616615
install = config.python.install
617616
assert len(install) == 1
@@ -658,7 +657,6 @@ def test_python_install_extra_requirements(self, run, checkout_path, tmpdir):
658657
args, kwargs = run.call_args
659658

660659
assert 'install' in args
661-
assert '-e' in args
662660
assert '.[docs]' in args
663661
install = config.python.install
664662
assert len(install) == 1
@@ -706,8 +704,7 @@ def test_python_install_several_options(self, run, checkout_path, tmpdir):
706704

707705
args, kwargs = run.call_args_list[0]
708706
assert 'install' in args
709-
assert '-e' in args
710-
assert 'one[docs]' in args
707+
assert './one[docs]' in args
711708
assert install[0].method == PIP
712709

713710
args, kwargs = run.call_args_list[1]

0 commit comments

Comments
 (0)