From c071bfba4621c9a97164f8c0bf9de49a24912b8e Mon Sep 17 00:00:00 2001 From: George Bisbas Date: Thu, 30 Mar 2023 14:15:37 +0100 Subject: [PATCH] reqs: Move pyrevolve to optionals and introduce testing-only reqs --- .github/workflows/pytest-core-mpi.yml | 2 +- docker/Dockerfile.devito | 2 +- docs/source/download.rst | 9 +++++---- requirements-optional.txt | 1 + requirements-testing.txt | 4 ++++ requirements.txt | 6 +----- setup.py | 6 +++++- 7 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 requirements-testing.txt diff --git a/.github/workflows/pytest-core-mpi.yml b/.github/workflows/pytest-core-mpi.yml index 1307baa85e..4774fe517d 100644 --- a/.github/workflows/pytest-core-mpi.yml +++ b/.github/workflows/pytest-core-mpi.yml @@ -36,7 +36,7 @@ jobs: run: | sudo apt-get update && sudo apt install mpich -y pip3 install --upgrade pip - pip3 install -e .[extras,mpi] + pip3 install -e .[extras,mpi,tests] - name: Test with pytest run: | diff --git a/docker/Dockerfile.devito b/docker/Dockerfile.devito index 0be27a1383..81d907400c 100644 --- a/docker/Dockerfile.devito +++ b/docker/Dockerfile.devito @@ -18,7 +18,7 @@ RUN python3 -m venv /venv && \ /venv/bin/pip install --no-cache-dir --upgrade pip && \ /venv/bin/pip install --no-cache-dir jupyter && \ /venv/bin/pip install --no-cache-dir wheel && \ - /venv/bin/pip install --no-cache-dir -e /app/devito[extras,mpi] && \ + /venv/bin/pip install --no-cache-dir -e /app/devito[extras,mpi,tests] && \ rm -rf ~/.cache/pip # Safety cleanup diff --git a/docs/source/download.rst b/docs/source/download.rst index 71549de86d..2ee073f69b 100644 --- a/docs/source/download.rst +++ b/docs/source/download.rst @@ -45,7 +45,7 @@ To install the `latest Devito release`_ along with any additional dependencies, pip install devito # ...or to install additional dependencies: - # pip install devito[extras,mpi,nvidia] + # pip install devito[extras,mpi,nvidia,tests] .. _latest Devito release: https://pypi.org/project/devito/#history @@ -55,11 +55,12 @@ To install the latest Devito development version, without the tutorials, follow: pip install git+https://github.com/devitocodes/devito.git # ...or to install additional dependencies: - # pip install git+https://github.com/devitocodes/devito.git#egg=project[extras,mpi,nvidia] + # pip install git+https://github.com/devitocodes/devito.git#egg=project[extras,mpi,nvidia,tests] Additional dependencies: - extras : optional dependencies for Jupyter notebooks, plotting, benchmarking +- tests : optional dependencies required for testing infrastructure - mpi : optional dependencies for MPI (mpi4py) - nvidia : optional dependencies for targetting GPU deployment @@ -98,7 +99,7 @@ and finally, install Devito along with any extra dependencies: pip install devito # ... or to install additional dependencies - # pip install devito[extras,mpi,nvidia] + # pip install devito[extras,mpi,nvidia,tests] For developers @@ -117,7 +118,7 @@ and then install the requirements in your virtual environment (venv or conda): # Install requirements pip install -e . # ...or to install additional dependencies - # pip install -e .[extras,mpi,nvidia] + # pip install -e .[extras,mpi,nvidia,tests] Facing issues? diff --git a/requirements-optional.txt b/requirements-optional.txt index babdd14a51..d13e1ca946 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -1,2 +1,3 @@ matplotlib pandas +pyrevolve \ No newline at end of file diff --git a/requirements-testing.txt b/requirements-testing.txt new file mode 100644 index 0000000000..8fce562f37 --- /dev/null +++ b/requirements-testing.txt @@ -0,0 +1,4 @@ +pytest>=7.2,<8.0 +pytest-runner +pytest-cov +codecov \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 56b39e0b33..2a359c0568 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,8 +12,4 @@ codepy>=2019.1 click<9.0 multidict anytree>=2.4.3,<=2.8 -pyrevolve>=2.1.3 -distributed<2023.5 -pytest>=7.2,<8.0 -pytest-runner -pytest-cov +distributed<2023.4 diff --git a/setup.py b/setup.py index 799bec8407..3d78741600 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,9 @@ with open('requirements-optional.txt') as f: optionals = f.read().splitlines() +with open('requirements-testing.txt') as f: + testing = f.read().splitlines() + with open('requirements-mpi.txt') as f: mpis = f.read().splitlines() @@ -24,7 +27,8 @@ reqs += [ir] extras_require = {} -for mreqs, mode in zip([optionals, mpis, nvidias], ['extras', 'mpi', 'nvidia']): +for mreqs, mode in (zip([optionals, mpis, nvidias, testing], + ['extras', 'mpi', 'nvidia', 'tests'])): opt_reqs = [] for ir in mreqs: # For conditionals like pytest=2.1; python == 3.6