From a5e3421e8ef59d56ed2be9b09e5f6a26d50598b0 Mon Sep 17 00:00:00 2001 From: pciturri Date: Mon, 28 Apr 2025 14:55:50 +0200 Subject: [PATCH 1/2] build: Removed pinned version of vcrpy. Updated and pinned versions of actions/checkout for all GH actions. Cleaned unnecessary matrix for sphinx. Uploaded installing of floatcsep in actions. Updated secrets access for coverage. Added check with twine for release pypi docs: Updated readthedocs.yaml to indicate sphinx config and properly build floatcsep. --- .github/workflows/build-sphinx.yml | 8 ++------ .github/workflows/build-test.yml | 13 +++++++------ .github/workflows/publish-pypi.yml | 11 ++++++++--- .github/workflows/release-tutorials.yml | 4 ++-- .readthedocs.yaml | 12 ++++++++---- requirements_dev.txt | 2 +- setup.cfg | 2 +- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index e62df68..c818fbf 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -15,18 +15,14 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 - uses: mamba-org/setup-micromamba@v1 with: generate-run-shell: true environment-file: environment.yml - create-args: >- - python=${{ matrix.python-version }} - - name: Install floatCSEP run: | - pip install -r requirements_dev.txt - pip install --no-deps -e . + pip install -e .[dev] python -c "import floatcsep; print('Version: ', floatcsep.__version__)" - name: Build documentation diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a67310e..396e8d1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -21,7 +21,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 - uses: mamba-org/setup-micromamba@v1 with: generate-run-shell: true @@ -32,15 +32,16 @@ jobs: - name: Install floatCSEP run: | - pip install pytest pytest-cov vcrpy==4.3.1 - pip install --no-deps -e . + pip install -e .[dev] python -c "import floatcsep; print('Version: ', floatcsep.__version__)" - name: Test with pytest run: | - pytest --durations=0 --cov=./ --cov-config=.coveragerc + pytest --durations=0 - name: Upload coverage if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' - run: | - bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false \ No newline at end of file diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 5fbb014..879a7b8 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -15,7 +15,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 - uses: mamba-org/setup-micromamba@v1 with: generate-run-shell: true @@ -25,14 +25,19 @@ jobs: - name: Install py-build and setuptools-scm run: | - micromamba run -n floatcsep python3 -m pip install --upgrade build setuptools-scm + micromamba run -n floatcsep pip install --upgrade build setuptools-scm - name: Build run: | micromamba run -n floatcsep python3 -m build --sdist --wheel --outdir dist/ + - name: Check distribution files + run: | + micromamba run -n floatcsep pip install twine + micromamba run -n floatcsep twine check dist/* + - name: Publish Package - uses: pypa/gh-action-pypi-publish@v1.9.0 + uses: pypa/gh-action-pypi-publish@v1.12.4 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release-tutorials.yml b/.github/workflows/release-tutorials.yml index de87c73..89a2492 100644 --- a/.github/workflows/release-tutorials.yml +++ b/.github/workflows/release-tutorials.yml @@ -10,14 +10,14 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.2 - name: Zip the tutorials folder run: | zip -r tutorials.zip tutorials/ - name: Upload the tutorials.zip to the release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2.2.2 with: files: tutorials.zip env: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6e9d3ca..89a936b 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,9 +1,9 @@ version: 2 build: - os: "ubuntu-20.04" + os: "ubuntu-22.04" tools: - python: "mambaforge-4.10" + python: "mambaforge-22.9" conda: environment: environment.yml @@ -12,5 +12,9 @@ python: install: - method: pip path: . - - method: pip - path: .[dev] # Install development dependencies via pip \ No newline at end of file + extra_requirements: + - dev + editable: true + +sphinx: + configuration: docs/conf.py \ No newline at end of file diff --git a/requirements_dev.txt b/requirements_dev.txt index 68a65c6..be5e92a 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -32,5 +32,5 @@ sphinx-toolbox sphinx_copybutton tables tox -vcrpy==4.3.1 +vcrpy xmltodict \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 7285b3a..83f16f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -80,7 +80,7 @@ dev = sphinx_copybutton tables tox - vcrpy==4.3.1 + vcrpy xmltodict [options.entry_points] From 92c81e930d7a4b1d4b4c4e497a64725afc050991 Mon Sep 17 00:00:00 2001 From: pciturri Date: Mon, 28 Apr 2025 15:16:29 +0200 Subject: [PATCH 2/2] CI: trigged --- .github/workflows/build-sphinx.yml | 1 + .github/workflows/build-test.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index c818fbf..76b3d72 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -20,6 +20,7 @@ jobs: with: generate-run-shell: true environment-file: environment.yml + - name: Install floatCSEP run: | pip install -e .[dev] diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 396e8d1..adf1100 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -29,7 +29,6 @@ jobs: create-args: >- python=${{ matrix.python-version }} - - name: Install floatCSEP run: | pip install -e .[dev]