From 1bc3699582ffc3adc5cb3d9c787415f163e4cba1 Mon Sep 17 00:00:00 2001 From: Antti Soininen Date: Thu, 25 Apr 2024 13:04:37 +0300 Subject: [PATCH] Update dependencies to a post-Dagster world Spine Engine doesn't use Dagster anymore, so we need not restrict spinedb_api dependencies anymore. Developer and documentation dependencies can now be installed by a single dev-requirements.txt file. Re spine-tools/Spine-Toolbox#2522 --- .github/workflows/run_unit_tests.yml | 21 +++++++++++---------- README.md | 10 ++++------ dev-requirements.txt | 7 +++++++ docs/requirements.txt | 9 --------- docs/source/conf.py | 5 ++++- pyproject.toml | 5 ----- requirements.txt | 1 - 7 files changed, 26 insertions(+), 32 deletions(-) create mode 100644 dev-requirements.txt delete mode 100644 docs/requirements.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index db30fefb..6a5e8b5a 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -31,8 +31,8 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - requirements.txt pyproject.toml + dev-requirements.txt - name: Display Python version run: python -c "import sys; print(sys.version)" @@ -45,13 +45,12 @@ jobs: PYTHONUTF8: 1 run: | python -m pip install --upgrade pip - python -m pip install .[dev] + python -m pip install -e . + python -m pip install -r dev-requirements.txt - name: List packages run: python -m pip list - name: Run tests - env: - QT_QPA_PLATFORM: offscreen run: coverage run -m unittest discover --verbose - name: Upload coverage report to Codecov @@ -77,8 +76,9 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - requirements.txt pyproject.toml + requirements.txt + dev-requirements.txt - name: Install additional packages for Linux if: runner.os == 'Linux' run: | @@ -90,13 +90,11 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt + python -m pip install -r dev-requirements.txt + python -m pip install git+${{ github.server_url }}/${{ github.repository }}.git@${{ github.ref_name }} - name: List packages run: python -m pip list - - name: Install python3 kernelspecs - run: | - python -m pip install ipykernel - python -m ipykernel install --user - name: Run tests run: | if [ "$RUNNER_OS" != "Windows" ]; then @@ -122,8 +120,9 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - requirements.txt pyproject.toml + requirements.txt + dev-requirements.txt - name: Install additional packages for Linux if: runner.os == 'Linux' run: | @@ -135,6 +134,8 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt + python -m pip install -r dev-requirements.txt + python -m pip install git+${{ github.server_url }}/${{ github.repository }}.git@${{ github.ref_name }} - name: List packages run: python -m pip list diff --git a/README.md b/README.md index ecb7e6e0..cd68e934 100644 --- a/README.md +++ b/README.md @@ -36,21 +36,19 @@ To install the latest development version use the Git repository url: ## Building the documentation Source files for the documentation can be found in `docs/source` directory. In order to -build the HTML docs, you need to install the additional documentation building requirements +build the HTML docs, you need to install the developer dependencies by running: - $ pip install -r dev-requirements.txt + $ pip install -e .[dev] This installs Sphinx (among other things), which is required in building the documentation. When Sphinx is installed, you can build the HTML pages from the source files by running: - > docs\make.bat html + > bin\build_doc.bat or - $ pushd docs - $ make html - $ popd + $ bin/build_doc.py depending on your operating system. diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 00000000..e7ea80e2 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,7 @@ +coverage[toml] +pyperf +sphinx +sphinx-autoapi +sphinx_rtd_theme +recommonmark +black == 21.12b diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index e42a014d..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Requirements for compiling the documentation -markupsafe < 2.1 # Jinja2<3.0 tries to import soft_unicode, which has been removed in markupsafe 2.1 -jinja2 < 3.0 # Dagster 0.12.8 requires Jinja2<3.0 -docutils < 0.17 -sphinx < 5.2 -sphinx_rtd_theme -recommonmark -astroid < 3.0 # sphinx-autoapi installs the latest astroid. We are not compatible with astroid v3.0 -sphinx-autoapi < 2.1 # 2.1 removed support for sphinx < 5.2.0 diff --git a/docs/source/conf.py b/docs/source/conf.py index 80b15481..2fb6dc94 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -281,7 +281,10 @@ def setup(sphinx): # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/": None, "https://docs.sqlalchemy.org/en/13/": None} +intersphinx_mapping = { + "python": ("https://docs.python.org/", None), + "sqlalchemy": ("https://docs.sqlalchemy.org/en/13/", None) +} # -- Options for todo extension ---------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 4c642943..ff5446ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,8 @@ dependencies = [ # v1.4 does not pass tests "sqlalchemy >=1.3, <1.4", "alembic >=1.7", - "faker >=8.1.2", "datapackage >=1.15.2", "python-dateutil >=2.8.1", - # v1.22 requires Python 3.8 or later "numpy >=1.20.2", "scipy >=1.7.1", "openpyxl >=3.0.7, !=3.1.1", @@ -33,9 +31,6 @@ dependencies = [ [project.urls] Repository = "https://github.com/spine-tools/Spine-Database-API" -[project.optional-dependencies] -dev = ["coverage[toml]", "pyperf"] - [build-system] requires = ["setuptools>=64", "setuptools_scm[toml]>=6.2", "wheel", "build"] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d6e1198b..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e .