From 35b513d967ff275bcecad57ae587cfcf5c77ffc1 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Thu, 14 Nov 2024 02:54:07 -0500 Subject: [PATCH 01/11] add all currently supported conversions for completeness --- src/PyPop/citation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyPop/citation.py b/src/PyPop/citation.py index ff6a35605..7ee8bc58e 100644 --- a/src/PyPop/citation.py +++ b/src/PyPop/citation.py @@ -36,7 +36,7 @@ import os import shutil -citation_output_formats = ['apalike', 'bibtex', 'endnote', 'ris', 'codemeta', 'cff'] +citation_output_formats = ['apalike', 'bibtex', 'endnote', 'ris', 'codemeta', 'cff', 'schema.org', 'zenodo'] def convert_citation_formats(build_lib, citation_path): From 9e88364a8981b11cca4be88ebaed789d6d50f97f Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Thu, 14 Nov 2024 03:02:49 -0500 Subject: [PATCH 02/11] note that `--citation` option has only existed since v1.1.2 --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 19ead3e70..0782d760f 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,8 @@ If you write a paper that uses PyPop in your analysis, please cite Here's how to cite the correct version: - * If you have PyPop currently installed simply run: + * If you have PyPop version 1.1.2 or later, currently installed, you + can run: .. code-block:: shell @@ -49,8 +50,9 @@ If you write a paper that uses PyPop in your analysis, please cite `_ in the *User Guide* for more details). - * If you do not have PyPop installed, or otherwise want to obtain - the DOI and citation for specific versions, follow these steps: + * If you do not have PyPop installed, have a release of PyPop + earlier than 1.1.2, or otherwise want to obtain the DOI and + citation for specific versions, follow these steps: 1) First visit the DOI for the overall Zenodo record: `10.5281/zenodo.10080667 From 98ad2ff2723c4242d46b469019d239be0cfb3fd8 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Thu, 14 Nov 2024 15:31:34 -0500 Subject: [PATCH 03/11] Override the setuptools scm version because we modified project.toml --- .github/workflows/build_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 52f8a24d9..362843be8 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -207,6 +207,7 @@ jobs: env: # FIXME: only run the slow tests when doing regular pushes, or manual - not for PRs CIBW_TEST_COMMAND: "pytest -v {package}/tests ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '--runslow' || '' }}" + CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.ref_name }} with: only: ${{ matrix.only }} package-dir: . From 11f22436dde8c9caaf3d43e59710b3fe31c94576 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 00:26:21 -0500 Subject: [PATCH 04/11] Need to save version before modification of TOML file --- .github/workflows/build_wheels.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 362843be8..ca3905d17 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -179,6 +179,12 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all + - name: Query version with setuptools_scm + id: version + run: | + python -m pip install setuptools_scm + VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())") + echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Install toml and remove cffconvert from pyproject.toml run: | python -m pip install toml @@ -207,7 +213,7 @@ jobs: env: # FIXME: only run the slow tests when doing regular pushes, or manual - not for PRs CIBW_TEST_COMMAND: "pytest -v {package}/tests ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '--runslow' || '' }}" - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.ref_name }} + CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.VERSION }} with: only: ${{ matrix.only }} package-dir: . From a95757b1d9d916f1a29d9d97495404a8d0f33284 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 00:41:29 -0500 Subject: [PATCH 05/11] Don't override existing CIBW_ENVIRONMENT --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index ca3905d17..bdbff62e8 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -213,7 +213,7 @@ jobs: env: # FIXME: only run the slow tests when doing regular pushes, or manual - not for PRs CIBW_TEST_COMMAND: "pytest -v {package}/tests ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '--runslow' || '' }}" - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.VERSION }} + SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.VERSION }} with: only: ${{ matrix.only }} package-dir: . From 62460f40d860624db67369e3465c0e4ca1543506 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 01:07:32 -0500 Subject: [PATCH 06/11] Use bash in a step to avoid Windows issue --- .github/workflows/build_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index bdbff62e8..a057d3168 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -181,6 +181,7 @@ jobs: platforms: all - name: Query version with setuptools_scm id: version + shell: bash run: | python -m pip install setuptools_scm VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())") From 479b0aff33e22466209d341bbe5c644319cf8083 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 01:17:31 -0500 Subject: [PATCH 07/11] Debugging --- .github/workflows/build_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a057d3168..a08d99718 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -185,6 +185,7 @@ jobs: run: | python -m pip install setuptools_scm VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())") + echo "VERSION=${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Install toml and remove cffconvert from pyproject.toml run: | From 6c95924730d8a39465ea3903f0aa437d2c6f5f3d Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 01:56:28 -0500 Subject: [PATCH 08/11] Need version scheme --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a08d99718..6e294d49d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -184,7 +184,7 @@ jobs: shell: bash run: | python -m pip install setuptools_scm - VERSION=$(python -c "import setuptools_scm; print(setuptools_scm.get_version())") + VERSION=$(python -c "from src.PyPop import __version_scheme__; import setuptools_scm; print(setuptools_scm.get_version(version_scheme=__version_scheme))") echo "VERSION=${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Install toml and remove cffconvert from pyproject.toml From 2817359ac6afa75fecb727fa480bcaa06c882428 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 01:58:24 -0500 Subject: [PATCH 09/11] Typo --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 6e294d49d..50d4d3e7b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -184,7 +184,7 @@ jobs: shell: bash run: | python -m pip install setuptools_scm - VERSION=$(python -c "from src.PyPop import __version_scheme__; import setuptools_scm; print(setuptools_scm.get_version(version_scheme=__version_scheme))") + VERSION=$(python -c "from src.PyPop import __version_scheme__; import setuptools_scm; print(setuptools_scm.get_version(version_scheme=__version_scheme__))") echo "VERSION=${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Install toml and remove cffconvert from pyproject.toml From f8dd4e0d57f4a5482351e7797cf99655e0ee2797 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 02:09:55 -0500 Subject: [PATCH 10/11] Need to pass through some envvar to Linux container --- .github/workflows/build_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 50d4d3e7b..5588a102c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -216,6 +216,7 @@ jobs: # FIXME: only run the slow tests when doing regular pushes, or manual - not for PRs CIBW_TEST_COMMAND: "pytest -v {package}/tests ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && '--runslow' || '' }}" SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.VERSION }} + CIBW_ENVIRONMENT_PASS_LINUX: SETUPTOOLS_SCM_PRETEND_VERSION with: only: ${{ matrix.only }} package-dir: . From 005741c7397b12085b96a74cdede1ac44e272865 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sat, 16 Nov 2024 07:54:56 -0500 Subject: [PATCH 11/11] Install recent Python earlier in build process --- .github/workflows/build_wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 5588a102c..d0c5a142d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -179,6 +179,10 @@ jobs: uses: docker/setup-qemu-action@v3 with: platforms: all + - name: Install a recent stable Python to handle Python deps + uses: actions/setup-python@v4 + with: + python-version: 3.12 - name: Query version with setuptools_scm id: version shell: bash @@ -201,10 +205,6 @@ jobs: with open('pyproject.toml', 'w') as f: toml.dump(config, f) " - - name: Install a recent stable Python to handle cffconvert - uses: actions/setup-python@v4 - with: - python-version: 3.12 - name: Generate citation formats run: | python --version