From 8f1f612105042a0e1cd1eb27d4df7de9c53e3094 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Nov 2024 11:56:26 -0700 Subject: [PATCH 1/2] Update CI --- .circleci/config.yml | 16 ------ .github/dependabot.yml | 6 +++ .github/workflows/ci.yml | 76 ++++++++++++++++++++++------- .github/workflows/pythonpublish.yml | 26 ---------- 4 files changed, 64 insertions(+), 60 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/pythonpublish.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 45a8ffec..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: 2 -jobs: - twine-check: - docker: - - image: cimg/python:3.12 - steps: - - checkout - - run: python -m pip install -U --user build - - run: python -m build . --sdist - - run: python -m pip install -U --user twine - - run: python -m twine check dist/* -workflows: - version: 2 - twine-check: - jobs: - - twine-check diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8ac6b8c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 578d4a8f..f889720f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: - "!*pre*" - "!*post*" pull_request: + # Allow manual runs through the web UI workflow_dispatch: schedule: # ┌───────── minute (0 - 59) @@ -36,16 +37,15 @@ jobs: - pandoc - graphviz envs: | - - linux: py312-sphinx8 + - linux: py313-sphinx8 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - tests: + test: needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: submodules: false - coverage: codecov libraries: | brew: - pandoc @@ -57,16 +57,27 @@ jobs: - pandoc - graphviz envs: | - - macos: py311-sphinx7 - - windows: py310-sphinx7 - - linux: py310-sphinx6 + - macos: py312-sphinx8 + - windows: py311-sphinx8 + - linux: py310-sphinx8 - linux: py312-pydata-sphinx-theme - - linux: py312-devdeps - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - linux: py313-devdeps + + extra_tests: + needs: [test] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + submodules: false + libraries: | + apt: + - pandoc + - graphviz + envs: | + - linux: py312-pydata-sphinx-theme + - linux: py313-devdeps - extras: - needs: [tests] + docs: + needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: submodules: false @@ -76,12 +87,23 @@ jobs: - pandoc - graphviz envs: | - - linux: py312-docs - - linux: pydata-sphinx-theme-dev - - linux: py312-linkcheck + - linux: py313-docs + - linux: py313-linkcheck + + sdist_verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: python -m pip install -U --user build + - run: python -m build . --sdist + - run: python -m pip install -U --user twine + - run: python -m twine check dist/* conda: - needs: [tests] + needs: [test] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -90,10 +112,10 @@ jobs: lfs: true - uses: conda-incubator/setup-miniconda@v3 with: - activate-environment: ablog-test - environment-file: ablog-conda-test-env.yml + activate-environment: sunpy-test + environment-file: sunpy-dev-env.yml python-version: "3.12" - - name: Install ablog + - name: Install sunpy shell: bash -el {0} run: | pip install --no-deps --no-build-isolation . @@ -101,5 +123,23 @@ jobs: shell: bash -el {0} run: | conda list + cd /tmp pytest -vvv -r a --pyargs ablog make tests + + publish: + # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* + # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi + if: | + github.event_name != 'pull_request' || + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Run publish') + ) + needs: [test, docs, sdist_verify] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main + with: + python-version: "3.13" + submodules: false + secrets: + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml deleted file mode 100644 index 1458db42..00000000 --- a/.github/workflows/pythonpublish.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Upload Python Package - -on: - release: - types: [published] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - python -m pep517.build --binary --source --out-dir wheelhouse . - python -m twine upload --skip-existing wheelhouse/* From b452a5c5f3a19ccb882938d661b66c83f97ced30 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Nov 2024 11:59:28 -0700 Subject: [PATCH 2/2] ignore src/ablog/_version.py --- .github/workflows/ci.yml | 10 +++++----- .gitignore | 1 + README.rst | 2 +- src/ablog/tests/test_parallel.py | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f889720f..5d6d588c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - run: python -m pip install -U --user build - run: python -m build . --sdist - run: python -m pip install -U --user twine @@ -112,10 +112,10 @@ jobs: lfs: true - uses: conda-incubator/setup-miniconda@v3 with: - activate-environment: sunpy-test - environment-file: sunpy-dev-env.yml - python-version: "3.12" - - name: Install sunpy + activate-environment: ablog-test + environment-file: ablog-conda-test-env.yml + python-version: "3.13" + - name: Install ablog shell: bash -el {0} run: | pip install --no-deps --no-build-isolation . diff --git a/.gitignore b/.gitignore index ff1e26e3..b68d972c 100644 --- a/.gitignore +++ b/.gitignore @@ -195,3 +195,4 @@ test/ pydata-sphinx-theme/ _build demo/ +src/ablog/_version.py diff --git a/README.rst b/README.rst index 04e3f83c..ba29ffa9 100644 --- a/README.rst +++ b/README.rst @@ -23,4 +23,4 @@ Warning **This version is maintained with the aim to keep it working for SunPy Project website and thus new features or bugfixes are highly unlikely unless they directly impact the SunPy Project** -**We strongly encourage users and interested in parties in submitting patches to ``ablog``** +**We strongly encourage users and interested in parties in submitting patches to ablog** diff --git a/src/ablog/tests/test_parallel.py b/src/ablog/tests/test_parallel.py index 1822fa91..ddb9f6e8 100644 --- a/src/ablog/tests/test_parallel.py +++ b/src/ablog/tests/test_parallel.py @@ -1,7 +1,10 @@ from pathlib import Path from subprocess import run +import sys +import pytest +@pytest.mark.xfail("win" in sys.platform, reason="Passes on Windows") def test_not_safe_for_parallel_read(rootdir: Path, tmp_path: Path): """ Ablog is NOT safe for parallel read.