From 34a767322a8ca94463800752857299bcb9a63251 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 13:52:04 -0300 Subject: [PATCH 1/7] Use build-and-inspect-python-package action This uses https://github.com/hynek/build-and-inspect-python-package to ensure our package is correct, both during testing and deploy, --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 524260961b4..06172185ab1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -189,3 +189,10 @@ jobs: fail_ci_if_error: true files: ./coverage.xml verbose: true + + check-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 From d65bff1dd2611da68c2a662e95f72c36635449ba Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 13:54:35 -0300 Subject: [PATCH 2/7] Update deploy.yml --- .github/workflows/deploy.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b865065296..b7b2a02e50a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,19 +28,8 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.7" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade build tox - - - name: Build package - run: | - python -m build + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From c58c57228885cc539bd85d347a300cc041c135d3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 13:56:03 -0300 Subject: [PATCH 3/7] Update test.yml --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06172185ab1..d28da1afad3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,11 @@ on: env: PYTEST_ADDOPTS: "--color=yes" +# Cancel running jobs for the same workflow and branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # Set permissions at the job level. permissions: {} From 7986175147153ef3c73a8c119d2a572ae8ffb148 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 14:09:09 -0300 Subject: [PATCH 4/7] Update pyproject.toml --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index fc9a119f6f0..d4ce1c3b385 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,3 +114,7 @@ template = "changelog/_template.rst" [tool.black] target-version = ['py37'] + +[tool.check-wheel-contents] +# W009: Wheel contains multiple toplevel library entries +ignore = "W009" From 636bd18ba8e1a83f8363643708bafce78c49bf56 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 14:09:55 -0300 Subject: [PATCH 5/7] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d4ce1c3b385..a4139a5c051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,6 +115,7 @@ template = "changelog/_template.rst" [tool.black] target-version = ['py37'] +# check-wheel-contents is executed by the build-and-inspect-python-package action. [tool.check-wheel-contents] # W009: Wheel contains multiple toplevel library entries ignore = "W009" From f4803356291695985f4213085a17e0a0b99c4887 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 9 Feb 2023 14:12:20 -0300 Subject: [PATCH 6/7] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d28da1afad3..cd1ffdbf9d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -194,10 +194,10 @@ jobs: fail_ci_if_error: true files: ./coverage.xml verbose: true - + check-package: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@v1.5 + uses: hynek/build-and-inspect-python-package@v1.5 From 3ff1738151b7990e8a9c0ed3b1f18fc94e3729c9 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 12 Feb 2023 20:25:52 -0300 Subject: [PATCH 7/7] Download package --- .github/workflows/deploy.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b7b2a02e50a..25280994687 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,11 +31,27 @@ jobs: - name: Build and Check Package uses: hynek/build-and-inspect-python-package@v1.5 + - name: Download Package + uses: actions/download-artifact@v3 + with: + name: Packages + path: dist + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi_token }} + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.7" + + - name: Install tox + run: | + python -m pip install --upgrade pip + pip install --upgrade tox + - name: Publish GitHub release notes env: GH_RELEASE_NOTES_TOKEN: ${{ github.token }}