From fadf893b14e007869edbad87bff9403823a29f45 Mon Sep 17 00:00:00 2001 From: vzotova Date: Mon, 4 Jan 2021 11:49:38 +0300 Subject: [PATCH 1/2] Added solidity installation step to sphinx and rtd build --- docs/source/conf.py | 9 +++++++-- newsfragments/2492.bugfix.rst | 1 + scripts/installation/install_solc.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 newsfragments/2492.bugfix.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index b9b11be91..aba757b27 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -265,8 +265,13 @@ def run_apidoc(_): def run_solidity_apidoc(_): source_dir = Path(__file__).parent.resolve() - script = source_dir.parent.parent / 'scripts' / 'solidity_doc' / 'generate_doc.py' - subprocess.call(['python', str(script)]) + scripts_dir = source_dir.parent.parent / 'scripts' + + install_script = scripts_dir / 'installation' / 'install_solc.py' + subprocess.call(['python', str(install_script)]) + + doc_script = scripts_dir / 'solidity_doc' / 'generate_doc.py' + subprocess.call(['python', str(doc_script)]) def setup(app): diff --git a/newsfragments/2492.bugfix.rst b/newsfragments/2492.bugfix.rst new file mode 100644 index 000000000..0258b64b2 --- /dev/null +++ b/newsfragments/2492.bugfix.rst @@ -0,0 +1 @@ +Fix rtd build after #2477 and #2489 diff --git a/scripts/installation/install_solc.py b/scripts/installation/install_solc.py index f836e7d1e..2ad848bc0 100755 --- a/scripts/installation/install_solc.py +++ b/scripts/installation/install_solc.py @@ -31,7 +31,7 @@ from pathlib import Path def get_solc_config_path() -> Path: - nucypher = Path('nucypher').absolute() + nucypher = Path(__file__).parent.parent.parent.resolve() / 'nucypher' config_path = nucypher / 'blockchain' / 'eth' / 'sol' / '__conf__.py' return config_path From 665909322cfc1a2a2c626c096630187614af052f Mon Sep 17 00:00:00 2001 From: Victoria Date: Mon, 4 Jan 2021 12:07:20 +0300 Subject: [PATCH 2/2] Apply suggestions from code review #2492 Co-authored-by: K Prasch --- scripts/installation/install_solc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/installation/install_solc.py b/scripts/installation/install_solc.py index 2ad848bc0..7d5b1b5d0 100755 --- a/scripts/installation/install_solc.py +++ b/scripts/installation/install_solc.py @@ -31,6 +31,7 @@ from pathlib import Path def get_solc_config_path() -> Path: + # Note: This script is sensitive to the working directory. nucypher = Path(__file__).parent.parent.parent.resolve() / 'nucypher' config_path = nucypher / 'blockchain' / 'eth' / 'sol' / '__conf__.py' return config_path