From ec06ce3056f83a6aa14ae002a0d334602ea47e3f Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 16 Feb 2024 23:13:04 +0100 Subject: [PATCH] slim down the CI. --- .github/workflows/cd-build.yml | 9 ++--- .github/workflows/ci-build.yml | 72 ++++------------------------------ pyproject.toml | 3 +- 3 files changed, 13 insertions(+), 71 deletions(-) diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml index fca9feb1..ded7159d 100644 --- a/.github/workflows/cd-build.yml +++ b/.github/workflows/cd-build.yml @@ -27,19 +27,17 @@ jobs: shell: bash -l {0} run: | python -m pip install --upgrade pip - python -m pip install -r develop.txt python -m pip install twine - python -m pip install . + python -m pip install .[doc,test] - name: Run Tests shell: bash -l {0} run: | - python setup.py test + pytest - name: Check distribution shell: bash -l {0} run: | - python setup.py sdist twine check dist/* - name: Upload coverage to Codecov @@ -69,8 +67,7 @@ jobs: run: | conda install -c conda-forge pandoc python -m pip install --upgrade pip - python -m pip install -r docs/requirements.txt - python -m pip install . + python -m pip install .[doc] - name: Build API documentation shell: bash -l {0} diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 88129d45..9d4226cb 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -16,42 +16,27 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Conda with Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - auto-update-conda: true python-version: ${{ matrix.python-version }} - auto-activate-base: false - - - name: Check Conda - shell: bash -l {0} - run: | - conda info - conda list - python --version + cache: pip - name: Install Dependencies shell: bash -l {0} run: | python --version python -m pip install --upgrade pip - python -m pip install -r develop.txt - python -m pip install -r docs/requirements.txt - python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib + python -m pip install .[test] + python -m pip install astropy scikit-image scikit-learn matplotlib python -m pip install tensorflow>=2.4.1 torch - python -m pip install twine - python -m pip install . - name: Run Tests shell: bash -l {0} run: | - export PATH=/usr/share/miniconda/bin:$PATH pytest -n 2 - name: Save Test Results @@ -59,18 +44,12 @@ jobs: uses: actions/upload-artifact@v2 with: name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }} - path: pytest.xml - - - name: Check Distribution - shell: bash -l {0} - run: | - python setup.py sdist - twine check dist/* + path: .coverage.xml - name: Check API Documentation build shell: bash -l {0} run: | - conda install -c conda-forge pandoc + pip install .[doc] sphinx-apidoc -t docs/_templates -feTMo docs/source modopt sphinx-build -b doctest -E docs/source docs/_build @@ -81,38 +60,3 @@ jobs: file: coverage.xml flags: unittests - test-basic: - name: Basic Test Suite - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9"] - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Conda with Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - auto-activate-base: false - - - name: Install Dependencies - shell: bash -l {0} - run: | - python --version - python -m pip install --upgrade pip - python -m pip install -r develop.txt - python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib - python -m pip install . - - - name: Run Tests - shell: bash -l {0} - run: | - export PATH=/usr/share/miniconda/bin:$PATH - pytest -n 2 diff --git a/pyproject.toml b/pyproject.toml index dd08cbd0..9c8f4bee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,8 @@ doc=["myst-parser==0.16.1", "sphinx-gallery==0.11.1", "sphinxawesome-theme==3.2.1", "sphinxcontrib-bibtex"] -dev=["black", "pytest<8.0.0", "pytest-cases", "pytest-cov", "pytest-sugar", "ruff"] +dev=["black", "ruff"] +test=["pytest<8.0.0", "pytest-cases", "pytest-cov", "pytest-sugar"] [build-system] requires=["setuptools", "setuptools-scm[toml]", "wheel"]