From 3062c09d8f8c238f495c7d5e215f86d8ddf516c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:42:10 -0300 Subject: [PATCH 1/9] Bump actions/checkout from 4.1.2 to 4.1.3 (#193) --- .github/workflows/docs.yml | 6 +++--- .github/workflows/pypi.yml | 4 ++-- .github/workflows/style.yml | 4 ++-- .github/workflows/test.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fb0fb611..e1fa8c7c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -38,7 +38,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: # Need to fetch more than the last commit so that setuptools-scm can # create the correct version string. If the number of commits since @@ -124,7 +124,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 # Fetch the built docs from the "build" job - name: Download HTML documentation artifact @@ -134,7 +134,7 @@ jobs: path: doc/_build/html - name: Checkout the gh-pages branch in a separate folder - uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f with: ref: gh-pages # Checkout to this folder instead of the current one diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9050d6cd..d5cac37a 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -32,7 +32,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since @@ -91,7 +91,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: # The GitHub token is preserved by default but this job doesn't need # to be able to push to GitHub. diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 2b395689..0238a3ad 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: persist-credentials: false @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: persist-credentials: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0e5d47a..fad6be77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,7 +61,7 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.1.3 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since From 78a0b9cc17c17d31a587592b1775680ef681ffdd Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Tue, 4 Jun 2024 06:54:27 -0700 Subject: [PATCH 2/9] Run tests with oldest dependencies on x86 macos (#200) Change configuration of tests in GitHub Actions: use the latest x86 macos runner with the `oldest` dependencies and Python 3.8. Use the latest macos runner (arm64) only against the `latest` requirements. This fixes CI failing because there are not Numpy binaries in PyPI for arm64 and compatible with Python 3.8. --- .github/workflows/test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fad6be77..2db6d0ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,19 +31,28 @@ jobs: # Run tests and upload to codecov test: name: ${{ matrix.os }} python=${{ matrix.python }} dependencies=${{ matrix.dependencies }} - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} strategy: # Otherwise, the workflow would stop if a single job fails. We want to # run all of them to catch failures in different combinations. fail-fast: false matrix: - os: [ubuntu, macos, windows] + os: [ubuntu-latest, macos-latest, windows-latest] python: ["3.8", "3.12"] include: - python: "3.8" dependencies: oldest - python: "3.12" dependencies: latest + # test on macos-13 (x86) using oldest dependencies and python 3.8 + - os: macos-13 + dependencies: oldest + python: "3.8" + exclude: + # don't test on macos-latest (arm64) with oldest dependencies + - os: macos-latest + python: "3.8" + env: REQUIREMENTS: env/requirements-build.txt env/requirements-test.txt # Used to tag codecov submissions From cc27173bb302e5e1bbfed32e48d542a29f41e42a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:40:57 -0300 Subject: [PATCH 3/9] Bump actions/checkout from 4.1.3 to 4.1.6 (#202) --- .github/workflows/docs.yml | 6 +++--- .github/workflows/pypi.yml | 4 ++-- .github/workflows/style.yml | 4 ++-- .github/workflows/test.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e1fa8c7c..b03b13dc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -38,7 +38,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: # Need to fetch more than the last commit so that setuptools-scm can # create the correct version string. If the number of commits since @@ -124,7 +124,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 # Fetch the built docs from the "build" job - name: Download HTML documentation artifact @@ -134,7 +134,7 @@ jobs: path: doc/_build/html - name: Checkout the gh-pages branch in a separate folder - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 with: ref: gh-pages # Checkout to this folder instead of the current one diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d5cac37a..3e79013d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -32,7 +32,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since @@ -91,7 +91,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: # The GitHub token is preserved by default but this job doesn't need # to be able to push to GitHub. diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 0238a3ad..8b14692c 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2db6d0ab..75056eee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since From fc4f7cbd2a1222756883732f8886907ad757b7b0 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Fri, 7 Jun 2024 09:57:50 -0700 Subject: [PATCH 4/9] Replace _version_generated.py for _version.py (#199) Rename the name of the autogenerated file for storing the version of Boule. Remove the tracked `boule/_version.py` file. Update mentions of `_version_generated.py` in multiple files (Makefile, .coveragerc, .gitignore, pyproject.toml). --- .coveragerc | 2 +- .gitignore | 2 +- Makefile | 2 +- boule/__init__.py | 3 +++ boule/_version.py | 16 ---------------- pyproject.toml | 2 +- 6 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 boule/_version.py diff --git a/.coveragerc b/.coveragerc index 2debec87..a2deea8f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,5 +2,5 @@ branch = True omit = */tests/* - */_version_generated.py + */_version.py **/__init__.py diff --git a/.gitignore b/.gitignore index 2988ef9f..7f1c8331 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ MANIFEST dask-worker-space build/ dist/ -boule/_version_generated.py +boule/_version.py doc/_build doc/api/generated doc/tutorials diff --git a/Makefile b/Makefile index 497e4d25..c9a1f57b 100644 --- a/Makefile +++ b/Makefile @@ -47,5 +47,5 @@ clean: find . -name "*.pyc" -exec rm -v {} \; find . -name "*.orig" -exec rm -v {} \; find . -name ".coverage.*" -exec rm -v {} \; - rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache .pytest_cache $(PROJECT)/_version_generated.py + rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache .pytest_cache $(PROJECT)/_version.py rm -rvf $(TESTDIR) dask-worker-space diff --git a/boule/__init__.py b/boule/__init__.py index 272465bc..addeca26 100644 --- a/boule/__init__.py +++ b/boule/__init__.py @@ -30,3 +30,6 @@ from ._sphere import Sphere from ._triaxialellipsoid import TriaxialEllipsoid from ._version import __version__ + +# Append a leading "v" to the generated version by setuptools_scm +__version__ = f"v{__version__}" diff --git a/boule/_version.py b/boule/_version.py deleted file mode 100644 index 0afd18ec..00000000 --- a/boule/_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2019 The Boule Developers. -# Distributed under the terms of the BSD 3-Clause License. -# SPDX-License-Identifier: BSD-3-Clause -# -# This code is part of the Fatiando a Terra project (https://www.fatiando.org) -# -""" -Get the automatically generated version information from setuptools_scm and -format it nicely. -""" - -# This file is generated automatically by setuptools_scm -from . import _version_generated - -# Add a "v" to the version number made by setuptools_scm -__version__ = f"v{_version_generated.version}" diff --git a/pyproject.toml b/pyproject.toml index 28d794ba..348c4bb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] version_scheme = "post-release" local_scheme = "no-local-version" -write_to = "boule/_version_generated.py" +write_to = "boule/_version.py" # Make sure isort and Black are compatible [tool.isort] From a91ad6e60205f8aeee2c8d83cf3f62e01bf1ecde Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 12 Jun 2024 05:06:00 -0700 Subject: [PATCH 5/9] Move push to codecov to its own job in Actions (#203) Remove the push to codecov step from the `test` job into a new job that depends on the test job. Upload the coverage reports as artifacts after testing, and reuse the artifacts in the new job. Upload all coverage reports in a single push to Codecov to minimize the number of hits. --- .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75056eee..03f3c4cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ defaults: jobs: ############################################################################# - # Run tests and upload to codecov + # Run tests test: name: ${{ matrix.os }} python=${{ matrix.python }} dependencies=${{ matrix.dependencies }} runs-on: ${{ matrix.os }} @@ -146,14 +146,40 @@ jobs: - name: Convert coverage report to XML for codecov run: coverage xml - - name: Upload coverage to Codecov + - name: Upload coverage report as an artifact + uses: actions/upload-artifact@v4 + with: + name: coverage_${{ matrix.os }}_${{ matrix.dependencies }} + path: ./coverage.xml + + + ############################################################################# + # Upload coverage report to codecov + codecov-upload: + runs-on: ubuntu-latest + needs: test + + steps: + + - name: Download coverage report artifacts + # Download coverage reports from every runner. + # Maximum coverage is achieved by combining reports from every runner. + # Each coverage file will live in its own folder with the same name as + # the artifact. + uses: actions/download-artifact@v4 + with: + pattern: coverage_* + + - name: List all downloaded artifacts + run: ls -l -R . + + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 with: - file: ./coverage.xml - env_vars: OS,PYTHON - # Don't mark the job as failed if the upload fails for some reason. - # It does sometimes but shouldn't be the reason for running - # everything again unless something else is broken. - fail_ci_if_error: false + # Upload all coverage report files + files: ./coverage_*/coverage.xml + # Fail the job so we know coverage isn't being updated. Otherwise it + # can silently drop and we won't know. + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 5f6efdc77b8586233e0ccbf7c91ece4f3d277e40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 08:39:35 -0300 Subject: [PATCH 6/9] Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#205) --- .github/workflows/pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 3e79013d..96b3b89d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -107,7 +107,7 @@ jobs: - name: Publish to Test PyPI # Only publish to TestPyPI when a PR is merged (pushed to main) if: success() && github.event_name == 'push' - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@v1.9.0 with: repository_url: https://test.pypi.org/legacy/ # Allow existing releases on test PyPI without errors. @@ -117,4 +117,4 @@ jobs: - name: Publish to PyPI # Only publish to PyPI when a release triggers the build if: success() && github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@v1.9.0 From eb5f45ed910cc78510b0405addd6521ff2b5e952 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 08:39:51 -0300 Subject: [PATCH 7/9] Bump actions/checkout from 4.1.6 to 4.1.7 (#204) --- .github/workflows/docs.yml | 6 +++--- .github/workflows/pypi.yml | 4 ++-- .github/workflows/style.yml | 4 ++-- .github/workflows/test.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b03b13dc..58a10d41 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -38,7 +38,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: # Need to fetch more than the last commit so that setuptools-scm can # create the correct version string. If the number of commits since @@ -124,7 +124,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 # Fetch the built docs from the "build" job - name: Download HTML documentation artifact @@ -134,7 +134,7 @@ jobs: path: doc/_build/html - name: Checkout the gh-pages branch in a separate folder - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: ref: gh-pages # Checkout to this folder instead of the current one diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 96b3b89d..12d643b0 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -32,7 +32,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since @@ -91,7 +91,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: # The GitHub token is preserved by default but this job doesn't need # to be able to push to GitHub. diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 8b14692c..6fa764e4 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: persist-credentials: false @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: persist-credentials: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03f3c4cd..ea7e9427 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v4.1.7 with: # Need to fetch more than the last commit so that setuptools_scm can # create the correct version string. If the number of commits since From 18f4fb3a14eb46d5390fa750d63bc58d44ed4d18 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Tue, 18 Jun 2024 06:57:18 -0700 Subject: [PATCH 8/9] Update how output variables are stored in Actions (#206) Replace the deprecated `set-output` in GitHub Actions for concatenating name and values into the `GITHUB_OUTPUT` env variable. Reference: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea7e9427..b9034c78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -115,7 +115,7 @@ jobs: - name: Get the pip cache folder id: pip-cache run: | - echo "::set-output name=dir::$(pip cache dir)" + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - name: Setup caching for pip packages uses: actions/cache@v4 From 7182b47bbc7db1f647f0d09bb8bed93a6644a427 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Tue, 27 Aug 2024 13:58:33 -0700 Subject: [PATCH 9/9] Replace `build` for `python-build` in environment.yml (#207) The `build` package in `conda-forge` is outdated, `python-build` should be used instead. Add step in `test.yml` GitHub Action to replace `build` for `python-build` in the collected dependencies that will be installed with conda. --- .github/workflows/docs.yml | 8 ++++++++ environment.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 58a10d41..783d1431 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -77,6 +77,14 @@ jobs: echo "Collected dependencies:" cat requirements-full.txt + - name: Rename conda-forge packages + run: | + echo "Rename conda-forge packages in requirements-full.txt" + # Replace "build" for "python-build" + sed -s --in-place 's/^build$/python-build/' requirements-full.txt + echo "Renamed dependencies:" + cat requirements-full.txt + - name: Install requirements run: conda install --quiet --file requirements-full.txt python==$PYTHON diff --git a/environment.yml b/environment.yml index f557426c..72105385 100644 --- a/environment.yml +++ b/environment.yml @@ -11,7 +11,7 @@ dependencies: - attrs - scipy # Build - - build + - python-build - twine # Test - pytest