From 2c11c0a24337e3c5a1a82ff27d974723c62575da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 10 Sep 2017 18:35:25 +0300 Subject: [PATCH 1/2] Allow installation of the project without a setup.py With PEP 517, projects may no longer even have one in the future. --- readthedocs/doc_builder/python_environments.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index f5c55f5f44f..2985acf2c23 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -47,8 +47,8 @@ def delete_existing_build_dir(self): shutil.rmtree(build_dir) def install_package(self): - setup_path = os.path.join(self.checkout_path, 'setup.py') - if os.path.isfile(setup_path) and self.config.install_project: + if self.config.install_project: + setup_path = os.path.join(self.checkout_path, 'setup.py') if self.config.pip_install or getattr(settings, 'USE_PIP_INSTALL', False): extra_req_param = '' if self.config.extra_requirements: @@ -65,7 +65,7 @@ def install_package(self): cwd=self.checkout_path, bin_path=self.venv_bin() ) - else: + elif os.path.isfile(setup_path): self.build_env.run( 'python', 'setup.py', From 03f71653117445495ae311835627f024000c9399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Tue, 7 Nov 2017 19:46:33 +0200 Subject: [PATCH 2/2] Always try "python setup.py install" as a fallback --- readthedocs/doc_builder/python_environments.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 2985acf2c23..10c2d036385 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -48,7 +48,6 @@ def delete_existing_build_dir(self): def install_package(self): if self.config.install_project: - setup_path = os.path.join(self.checkout_path, 'setup.py') if self.config.pip_install or getattr(settings, 'USE_PIP_INSTALL', False): extra_req_param = '' if self.config.extra_requirements: @@ -65,7 +64,7 @@ def install_package(self): cwd=self.checkout_path, bin_path=self.venv_bin() ) - elif os.path.isfile(setup_path): + else: self.build_env.run( 'python', 'setup.py',