From 68820b715ed6b2c981aa11d29c0102e879280d79 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Tue, 25 Apr 2023 10:45:36 -0600 Subject: [PATCH] Use setup.py for all installs (#632) Instead of requirements.txt --- .github/workflows/check-working-examples.yaml | 1 - .github/workflows/deploy-pages.yaml | 3 +-- docs/dev_guide.md | 4 ++-- docs/requirements.txt | 5 ----- requirements.txt | 17 ----------------- setup.py | 5 ++++- 6 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 docs/requirements.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/check-working-examples.yaml b/.github/workflows/check-working-examples.yaml index 974d80b24..c8d4b201a 100644 --- a/.github/workflows/check-working-examples.yaml +++ b/.github/workflows/check-working-examples.yaml @@ -21,7 +21,6 @@ jobs: - name: Install project run: | python -m pip install --upgrade pip - pip install -r requirements.txt pip install -e . pip install nbconvert # For converting Jupyter notebook to python script in the next step - name: Run examples diff --git a/.github/workflows/deploy-pages.yaml b/.github/workflows/deploy-pages.yaml index e9c063d64..f8fecb339 100644 --- a/.github/workflows/deploy-pages.yaml +++ b/.github/workflows/deploy-pages.yaml @@ -22,8 +22,7 @@ jobs: - name: Install dependencies run: | - pip install -r docs/requirements.txt - pip install -e . + pip install -e ".[docs]" # Build the book - name: Build the book diff --git a/docs/dev_guide.md b/docs/dev_guide.md index a326c889f..10aa58216 100644 --- a/docs/dev_guide.md +++ b/docs/dev_guide.md @@ -210,13 +210,13 @@ is located at `floris/.github/workflows/continuous-integration-workflow.yaml`. The online documentation is built with Jupyter Book which uses Sphinx as a framework. It is automatically built and hosted by GitHub, but it can also be compiled locally. Additional dependencies are required -for the documentation, and they are listed in ``docs/requirements.txt``. +for the documentation, and they are listed in the `EXTRAS` of `setup.py`. The commands to build the docs are given below. After successfully compiling, a file should be located at ``docs/_build/html/index.html``. This file can be opened in any browser. ```bash -pip install -r docs/requirements.txt +pip install -e .["docs"] jupyter-book build docs/ # Lots of output to the terminal here... diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index f4b3b4d4b..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -jupyter-book>0.13 -sphinx-book-theme>0.3 -sphinx-autodoc-typehints -sphinxcontrib-autoyaml --r ../requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9457ae315..000000000 --- a/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Requirements list for floris - -# simulation -attrs -pyyaml -numexpr -numpy -scipy - -# tools -matplotlib -pandas -scipy -shapely - -# utilities -coloredlogs diff --git a/setup.py b/setup.py index c2692d7d5..7d5ed9b12 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,10 @@ ] # What packages are optional? -# To use: pip install -e ".[develop]" or pip install "floris[develop]" +# To use: +# pip install -e ".[docs,develop]" install both sets of extras in editable install +# pip install -e ".[develop]" installs only developer packages in editable install +# pip install "floris[develop]" installs developer packages in non-editable install EXTRAS = { "docs": { "jupyter-book",