From b5ed112dcc9a703786899d458514a3c22a9ffb76 Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 6 Feb 2024 21:07:29 +0100 Subject: [PATCH 01/54] Extract `bump-changelog` action into separate workflow --- .github/workflows/bump-changelog.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/tests.yml | 37 -------------------- CONTRIBUTING.md | 3 +- 3 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/bump-changelog.yml diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml new file mode 100644 index 0000000000..dfda688f84 --- /dev/null +++ b/.github/workflows/bump-changelog.yml @@ -0,0 +1,52 @@ +name: Bump changelog before release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to be released' + required: true + type: string + +env: + default-python: "3.12" + minimum-supported-python: "3.8" + +jobs: + bump-changelog: + name: Bump changelog + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v4 + - name: Set up Python ${{ env.default-python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.default-python }} + cache: "pip" + - name: Get release version and construct PR branch + run: | + echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + echo "PR_BRANCH=bump-changelog-for-${{ inputs.version }}" >> $GITHUB_ENV + - name: Create pull request branch + run: git switch -c $PR_BRANCH + - name: Install nox + run: python -m pip install nox + - name: Update changelog + run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION + - name: Commit and push change + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git commit -am "Bump changelog for $RELEASE_VERSION" + git fetch origin + git push origin $PR_BRANCH + - name: Create pull request + run: | + git fetch origin + gh pr create --base main --fill + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0aac2f395..edfef56a4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -124,40 +124,3 @@ jobs: uses: softprops/action-gh-release@v2 with: files: pipx.pyz - - bump-changelog: - name: Bump changelog on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [pypi-publish, upload-zipapp] - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout ${{ github.ref }} - uses: actions/checkout@v4 - - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.default-python }} - cache: "pip" - - name: Extract release tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Create pull request branch - run: git switch -c "bump-changelog-for-${RELEASE_VERSION}" - - name: Install nox - run: python -m pip install nox - - name: Update changelog - run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION - - name: Commit and push change - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git commit -am "Bump changelog for $RELEASE_VERSION" - git push origin "bump-changelog-for-${RELEASE_VERSION}" - - name: Create pull request - run: | - git fetch origin - gh pr create --base main --fill - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d601403954..b94854bace 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -220,7 +220,8 @@ nox -s watch_docs ## Releasing New `pipx` Versions -To publish to PyPI simply create a "published" release on GitHub. This will trigger GitHub workflows that publishes: +To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to +be released. Then, simply create a "published" release on GitHub. This will trigger GitHub workflows that publish: - the pipx version to PyPI, - the documentation to readthedocs, From 17247a38e28f2d7a76663a934c2e6ac1dc3aec98 Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 9 Apr 2024 17:49:49 +0200 Subject: [PATCH 02/54] Create `create-release` job in `tests.yml` --- .github/workflows/bump-changelog.yml | 2 +- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index dfda688f84..0d7331eaed 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -47,6 +47,6 @@ jobs: - name: Create pull request run: | git fetch origin - gh pr create --base main --fill + gh pr create --base main --fill --label release-version env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edfef56a4f..cd2b073411 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,31 @@ jobs: path: pipx.pyz retention-days: 3 + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event_name == 'pull_request' + && github.event.pull_request.merged == true + && github.event.pull_request.labels.name == 'release-version' + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "$VERSION" + commit: ${{ github.event.pull_request.merge_commit_sha }} + pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 3fbaa57b8712d1917b066f21b1a60839ede1fd2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 11:59:58 +0200 Subject: [PATCH 03/54] Bump changelog for 1.0.0 (#2) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2422186f20..84eca5be77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Features +<<<<<<< HEAD - Add `--global` option to `pipx` commands. - This will run the action in a global scope and affect environment for all system users. ([#754](https://github.com/pypa/pipx/issues/754)) - Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. @@ -23,11 +24,23 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - They were leading to a lot of issues with Windows sandboxing and spaces in shebangs on MacOS. ([#1257](https://github.com/pypa/pipx/issues/1257)) - Add `--install` option to `pipx upgrade` command. - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) +======= +- Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. + + When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) +- Add commands to list and prune standalone interpreters ([#1248](https://github.com/pypa/pipx/issues/1248)) +- Add `--install` option to `pipx upgrade` command. + + This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) +>>>>>>> Bump changelog for 1.0.0 (#2) ### Bugfixes - Correctly resolve home directory in pipx directory environment variables. ([#94](https://github.com/pypa/pipx/issues/94)) +<<<<<<< HEAD - Pass through `pip` arguments when upgrading shared libraries. ([#964](https://github.com/pypa/pipx/issues/964)) +======= +>>>>>>> Bump changelog for 1.0.0 (#2) - Fix installation issues when files in the working directory interfere with venv creation process. ([#1091](https://github.com/pypa/pipx/issues/1091)) - Report correct filename in tracebacks with `pipx run ` ([#1191](https://github.com/pypa/pipx/issues/1191)) - Let self-managed pipx uninstall itself on windows again. ([#1203](https://github.com/pypa/pipx/issues/1203)) @@ -41,6 +54,7 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Update the example for running scripts with dependencies. ([#1227](https://github.com/pypa/pipx/issues/1227)) - Update the docs for package developers on the use of configuration using pyproject.toml ([#1229](https://github.com/pypa/pipx/issues/1229)) - Add installation instructions for Fedora ([#1239](https://github.com/pypa/pipx/issues/1239)) +<<<<<<< HEAD - Update the examples for installation from local dir ([#1277](https://github.com/pypa/pipx/issues/1277)) - Fix inconsistent wording in `pipx install` command description. ([#1307](https://github.com/pypa/pipx/issues/1307)) @@ -51,6 +65,8 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Misc - [#1296](https://github.com/pypa/pipx/issues/1296) +======= +>>>>>>> Bump changelog for 1.0.0 (#2) ## [1.4.3](https://github.com/pypa/pipx/tree/1.4.3) - 2024-01-16 From 24d042887c5021ece7b0c52f134f1280c67096e3 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:50:43 +0200 Subject: [PATCH 04/54] Specify pull request types that trigger CI --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd2b073411..d71a9dc0e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ on: branches: - "main" pull_request: + types: [opened, reopened, synchronize, closed] schedule: - cron: "0 8 * * *" concurrency: From bcb9e15c44e0f871c414166539ac6f67c5fe8810 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:57:48 +0200 Subject: [PATCH 05/54] Remove requirement for job --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d71a9dc0e5..6b257b24cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,8 +95,7 @@ jobs: permissions: contents: write if: >- - github.event_name == 'pull_request' - && github.event.pull_request.merged == true + github.event.pull_request.merged == true && github.event.pull_request.labels.name == 'release-version' steps: - uses: actions/checkout@v4 From 0b7329f10d1a3911c3aaf3b0f2a2ba63d7253b42 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 13:12:44 +0200 Subject: [PATCH 06/54] Try to fix label detection --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b257b24cb..ce7b9af2fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,7 +96,7 @@ jobs: contents: write if: >- github.event.pull_request.merged == true - && github.event.pull_request.labels.name == 'release-version' + && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 789fd08e7b9910b8fe450cfb4c529703ab2aa8c8 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:00:49 +0200 Subject: [PATCH 07/54] Try out `pull_request_target` event --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce7b9af2fd..b0d66edf60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,9 @@ on: branches: - "main" pull_request: - types: [opened, reopened, synchronize, closed] + pull_request_target: + types: + - closed schedule: - cron: "0 8 * * *" concurrency: From 4784691599a9f5d288ea484d81a4489e32a08849 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:14:12 +0200 Subject: [PATCH 08/54] Fix environment variable access syntax --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0d66edf60..55a86e1c07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -110,7 +110,7 @@ jobs: uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "$VERSION" + tag: "${{ env.VERSION }}" commit: ${{ github.event.pull_request.merge_commit_sha }} pypi-publish: From b8a6d3dc3588bd69358ab649cb4e1e2449a2e7f6 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:57:00 +0200 Subject: [PATCH 09/54] Try splitting out in separate workflow --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 27 --------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..03da2eea8b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + pull_request_target: + types: + - closed + +jobs: + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'release-version') + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "${{ env.VERSION }}" + commit: ${{ github.event.pull_request.merge_commit_sha }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55a86e1c07..edfef56a4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,9 +6,6 @@ on: branches: - "main" pull_request: - pull_request_target: - types: - - closed schedule: - cron: "0 8 * * *" concurrency: @@ -89,30 +86,6 @@ jobs: path: pipx.pyz retention-days: 3 - create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release - runs-on: ubuntu-latest - permissions: - contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') - steps: - - uses: actions/checkout@v4 - - name: Extract version to be released - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" - - name: Create release - uses: ncipollo/release-action@v1 - with: - generateReleaseNotes: true - tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} - pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 7162ae298a2c4803013ff45367f34c5017372b2a Mon Sep 17 00:00:00 2001 From: chrysle Date: Mon, 15 Apr 2024 08:39:43 +0200 Subject: [PATCH 10/54] Use concurrency --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03da2eea8b..5c5695f8b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: pull_request_target: types: - closed +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + jobs: create-release: From 461851809d5337b44700fe09b7de23bdef69021f Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 9 Apr 2024 17:49:49 +0200 Subject: [PATCH 11/54] Create `create-release` job in `tests.yml` --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edfef56a4f..cd2b073411 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,31 @@ jobs: path: pipx.pyz retention-days: 3 + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event_name == 'pull_request' + && github.event.pull_request.merged == true + && github.event.pull_request.labels.name == 'release-version' + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "$VERSION" + commit: ${{ github.event.pull_request.merge_commit_sha }} + pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 88b567995c2e21e687964a88d736ac3284e18b7d Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:50:43 +0200 Subject: [PATCH 12/54] Specify pull request types that trigger CI --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd2b073411..d71a9dc0e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ on: branches: - "main" pull_request: + types: [opened, reopened, synchronize, closed] schedule: - cron: "0 8 * * *" concurrency: From 5b8f71d90000348b75bbdb19bec988b6e16f5a20 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:57:48 +0200 Subject: [PATCH 13/54] Remove requirement for job --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d71a9dc0e5..6b257b24cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,8 +95,7 @@ jobs: permissions: contents: write if: >- - github.event_name == 'pull_request' - && github.event.pull_request.merged == true + github.event.pull_request.merged == true && github.event.pull_request.labels.name == 'release-version' steps: - uses: actions/checkout@v4 From 72c7d6c90d0476be6cbc2f8c2a22206fa4deebb7 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 13:12:44 +0200 Subject: [PATCH 14/54] Try to fix label detection --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b257b24cb..ce7b9af2fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,7 +96,7 @@ jobs: contents: write if: >- github.event.pull_request.merged == true - && github.event.pull_request.labels.name == 'release-version' + && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 8af9b56d92802c6eae29c1ba2fa28dd4ba7f88c7 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:00:49 +0200 Subject: [PATCH 15/54] Try out `pull_request_target` event --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce7b9af2fd..b0d66edf60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,9 @@ on: branches: - "main" pull_request: - types: [opened, reopened, synchronize, closed] + pull_request_target: + types: + - closed schedule: - cron: "0 8 * * *" concurrency: From 33c725585964ec504cfb7af76117016d2d731507 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:14:12 +0200 Subject: [PATCH 16/54] Fix environment variable access syntax --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0d66edf60..55a86e1c07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -110,7 +110,7 @@ jobs: uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "$VERSION" + tag: "${{ env.VERSION }}" commit: ${{ github.event.pull_request.merge_commit_sha }} pypi-publish: From b116c2b6ad01462d83a31a318e797095373d482a Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:36:32 +0200 Subject: [PATCH 17/54] Try moving related jobs into release workflow --- .github/workflows/release.yml | 47 ++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c5695f8b4..6f6baad7b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,16 +10,51 @@ concurrency: jobs: + pypi-publish: + name: Publish pipx to PyPI + if: >- + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'release-version') + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/pipx + permissions: + id-token: write + steps: + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v4 + - name: Set up Python ${{ env.default-python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.default-python }} + cache: "pip" + - name: Install nox + run: pip install nox + - name: Build sdist and wheel + run: nox --error-on-missing-interpreters --non-interactive --session build + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@v1.8.14 + + upload-zipapp: + name: Upload zipapp to GitHub Release + needs: pypi-publish + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: pipx.pyz + - name: Upload to release + uses: softprops/action-gh-release@v1 + with: + files: pipx.pyz + create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release + name: Create a release on GitHub's UI + needs: [pypi-publish, upload-zipapp] runs-on: ubuntu-latest permissions: contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 5ec28b6c7884aacc295bc6ad686e722c9352e7e9 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:47:58 +0200 Subject: [PATCH 18/54] Specify Python version in release workflow --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f6baad7b7..eba7634335 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,8 @@ concurrency: group: tests-${{ github.ref }} cancel-in-progress: true +env: + default-python: "3.12" jobs: pypi-publish: From bbc1becbace2e7720402cc2cd0695aecc0c44675 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:55:24 +0200 Subject: [PATCH 19/54] Amend for testing --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eba7634335..dc3a9ba2c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - needs: pypi-publish + # needs: pypi-publish runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 @@ -53,7 +53,7 @@ jobs: create-release: name: Create a release on GitHub's UI - needs: [pypi-publish, upload-zipapp] + needs: upload-zipapp # [pypi-publish, upload-zipapp] runs-on: ubuntu-latest permissions: contents: write From 1c97b0ce5885cc6ab63c7041b08e8312584fb74b Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:11:26 +0200 Subject: [PATCH 20/54] Retrieve artifact from previous workflow run --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc3a9ba2c2..ff56b1de52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,9 +43,12 @@ jobs: # needs: pypi-publish runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: dawidd6/action-download-artifact@v3 with: name: pipx.pyz + workflow: tests.yml + workflow_conclusion: "" + pr: ${{ github.event.pull_request.number }} - name: Upload to release uses: softprops/action-gh-release@v1 with: From f590cb08fa32d5034233db3169a769d243e1d675 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:20:43 +0200 Subject: [PATCH 21/54] Create release before uploading asset (makes sense) --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff56b1de52..2908e2d0e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,25 +38,9 @@ jobs: - name: Publish to PyPi uses: pypa/gh-action-pypi-publish@v1.8.14 - upload-zipapp: - name: Upload zipapp to GitHub Release - # needs: pypi-publish - runs-on: ubuntu-latest - steps: - - uses: dawidd6/action-download-artifact@v3 - with: - name: pipx.pyz - workflow: tests.yml - workflow_conclusion: "" - pr: ${{ github.event.pull_request.number }} - - name: Upload to release - uses: softprops/action-gh-release@v1 - with: - files: pipx.pyz - create-release: name: Create a release on GitHub's UI - needs: upload-zipapp # [pypi-publish, upload-zipapp] + # needs: pypi-publish runs-on: ubuntu-latest permissions: contents: write @@ -72,4 +56,20 @@ jobs: with: generateReleaseNotes: true tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} \ No newline at end of file + commit: ${{ github.event.pull_request.merge_commit_sha }} + + upload-zipapp: + name: Upload zipapp to GitHub Release + # needs: pypi-publish + runs-on: ubuntu-latest + steps: + - uses: dawidd6/action-download-artifact@v3 + with: + name: pipx.pyz + workflow: tests.yml + workflow_conclusion: "" + pr: ${{ github.event.pull_request.number }} + - name: Upload to release + uses: softprops/action-gh-release@v1 + with: + files: pipx.pyz From abe022841e29dd6d1f3a011f55b914f356b75cf0 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:36:40 +0200 Subject: [PATCH 22/54] Specify tag name --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2908e2d0e9..c8bec8300a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,3 +73,4 @@ jobs: uses: softprops/action-gh-release@v1 with: files: pipx.pyz + tag_name: "${{ env.VERSION }}" From bb56f995ac86437bcd63a07bb3d1c2d34832205f Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:43:38 +0200 Subject: [PATCH 23/54] Don't run in parallel *yawn* --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8bec8300a..5cfcbf7842 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,6 +61,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release # needs: pypi-publish + needs: create-release runs-on: ubuntu-latest steps: - uses: dawidd6/action-download-artifact@v3 From 63dfd8abc62399b082827764ba407bab3a45da6f Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 18:01:36 +0200 Subject: [PATCH 24/54] Get that blasted tag --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cfcbf7842..41bbb5108a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,20 +42,23 @@ jobs: name: Create a release on GitHub's UI # needs: pypi-publish runs-on: ubuntu-latest + outputs: + release-tag: ${{ steps.get-version.outputs.version }} permissions: contents: write steps: - uses: actions/checkout@v4 - name: Extract version to be released + id: get-version env: TITLE: ${{ github.event.pull_request.title }} run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + echo "version=${TITLE##bump changelog for }" >> "$GITHUB_OUTPUT" - name: Create release uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "${{ env.VERSION }}" + tag: "${{ steps.get-version.outputs.version }}" commit: ${{ github.event.pull_request.merge_commit_sha }} upload-zipapp: @@ -74,4 +77,4 @@ jobs: uses: softprops/action-gh-release@v1 with: files: pipx.pyz - tag_name: "${{ env.VERSION }}" + tag_name: "${{ needs.create-release.outputs.release-tag }}" From e5c9c94cc49ce452c142a3c2a6cdf0c21f2229c6 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 18:07:49 +0200 Subject: [PATCH 25/54] Permissions --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41bbb5108a..9e26c39813 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,6 +66,8 @@ jobs: # needs: pypi-publish needs: create-release runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: dawidd6/action-download-artifact@v3 with: From 09f0ac0e05d197564504968c0ffec6f17df01966 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Wed, 15 May 2024 16:54:29 +0200 Subject: [PATCH 26/54] Cleanup, docs --- .github/workflows/bump-changelog.yml | 2 +- .github/workflows/release.yml | 7 ++- .github/workflows/tests.yml | 66 ---------------------------- CHANGELOG.md | 16 ------- CONTRIBUTING.md | 5 ++- 5 files changed, 7 insertions(+), 89 deletions(-) diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index 0d7331eaed..bdd6aa6eed 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -41,7 +41,7 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git commit -am "Bump changelog for $RELEASE_VERSION" + git commit -am "$RELEASE_VERSION: Bump changelog" git fetch origin git push origin $PR_BRANCH - name: Create pull request diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e26c39813..6e9e003238 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: create-release: name: Create a release on GitHub's UI - # needs: pypi-publish + needs: pypi-publish runs-on: ubuntu-latest outputs: release-tag: ${{ steps.get-version.outputs.version }} @@ -53,7 +53,7 @@ jobs: env: TITLE: ${{ github.event.pull_request.title }} run: | - echo "version=${TITLE##bump changelog for }" >> "$GITHUB_OUTPUT" + echo "version=${TITLE/: [[:alnum:]]*} }" >> "$GITHUB_OUTPUT" - name: Create release uses: ncipollo/release-action@v1 with: @@ -63,7 +63,6 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - # needs: pypi-publish needs: create-release runs-on: ubuntu-latest permissions: @@ -73,7 +72,7 @@ jobs: with: name: pipx.pyz workflow: tests.yml - workflow_conclusion: "" + workflow_conclusion: success pr: ${{ github.event.pull_request.number }} - name: Upload to release uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55a86e1c07..71450e74c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,9 +6,6 @@ on: branches: - "main" pull_request: - pull_request_target: - types: - - closed schedule: - cron: "0 8 * * *" concurrency: @@ -88,66 +85,3 @@ jobs: name: pipx.pyz path: pipx.pyz retention-days: 3 - - create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release - runs-on: ubuntu-latest - permissions: - contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') - steps: - - uses: actions/checkout@v4 - - name: Extract version to be released - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" - - name: Create release - uses: ncipollo/release-action@v1 - with: - generateReleaseNotes: true - tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} - - pypi-publish: - name: Publish pipx to PyPI on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [tests, man, zipapp] - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/pipx - permissions: - id-token: write - steps: - - name: Checkout ${{ github.ref }} - uses: actions/checkout@v4 - - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.default-python }} - cache: "pip" - - name: Install nox - run: pip install nox - - name: Build sdist and wheel - run: nox --error-on-missing-interpreters --non-interactive --session build - - name: Publish to PyPi - uses: pypa/gh-action-pypi-publish@v1.8.14 - - upload-zipapp: - name: Upload zipapp to GitHub Release on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [tests, man, zipapp] - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - name: pipx.pyz - - name: Upload to release - uses: softprops/action-gh-release@v2 - with: - files: pipx.pyz diff --git a/CHANGELOG.md b/CHANGELOG.md index 84eca5be77..2422186f20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Features -<<<<<<< HEAD - Add `--global` option to `pipx` commands. - This will run the action in a global scope and affect environment for all system users. ([#754](https://github.com/pypa/pipx/issues/754)) - Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. @@ -24,23 +23,11 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - They were leading to a lot of issues with Windows sandboxing and spaces in shebangs on MacOS. ([#1257](https://github.com/pypa/pipx/issues/1257)) - Add `--install` option to `pipx upgrade` command. - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) -======= -- Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. - - When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) -- Add commands to list and prune standalone interpreters ([#1248](https://github.com/pypa/pipx/issues/1248)) -- Add `--install` option to `pipx upgrade` command. - - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) ->>>>>>> Bump changelog for 1.0.0 (#2) ### Bugfixes - Correctly resolve home directory in pipx directory environment variables. ([#94](https://github.com/pypa/pipx/issues/94)) -<<<<<<< HEAD - Pass through `pip` arguments when upgrading shared libraries. ([#964](https://github.com/pypa/pipx/issues/964)) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) - Fix installation issues when files in the working directory interfere with venv creation process. ([#1091](https://github.com/pypa/pipx/issues/1091)) - Report correct filename in tracebacks with `pipx run ` ([#1191](https://github.com/pypa/pipx/issues/1191)) - Let self-managed pipx uninstall itself on windows again. ([#1203](https://github.com/pypa/pipx/issues/1203)) @@ -54,7 +41,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Update the example for running scripts with dependencies. ([#1227](https://github.com/pypa/pipx/issues/1227)) - Update the docs for package developers on the use of configuration using pyproject.toml ([#1229](https://github.com/pypa/pipx/issues/1229)) - Add installation instructions for Fedora ([#1239](https://github.com/pypa/pipx/issues/1239)) -<<<<<<< HEAD - Update the examples for installation from local dir ([#1277](https://github.com/pypa/pipx/issues/1277)) - Fix inconsistent wording in `pipx install` command description. ([#1307](https://github.com/pypa/pipx/issues/1307)) @@ -65,8 +51,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Misc - [#1296](https://github.com/pypa/pipx/issues/1296) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) ## [1.4.3](https://github.com/pypa/pipx/tree/1.4.3) - 2024-01-16 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b94854bace..7200e20dc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -221,10 +221,11 @@ nox -s watch_docs ## Releasing New `pipx` Versions To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to -be released. Then, simply create a "published" release on GitHub. This will trigger GitHub workflows that publish: +be released. This will create a pull request updating the changelog for the upcoming version, with the `release-version` label. Attaching this label to any pull request of which the title follows the format `: Description` and merging it will trigger GitHub workflows that publish: - the pipx version to PyPI, -- the documentation to readthedocs, +- the documentation to ReadTheDocs, +- a GitHub release - the `zipapp` to the GitHub release created. No need for any other pre or post publish steps. From 22c7ef00dacfad58f10550afe43ad13969de72d1 Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 6 Feb 2024 21:07:29 +0100 Subject: [PATCH 27/54] Extract `bump-changelog` action into separate workflow --- .github/workflows/bump-changelog.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/tests.yml | 37 -------------------- CONTRIBUTING.md | 3 +- 3 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/bump-changelog.yml diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml new file mode 100644 index 0000000000..dfda688f84 --- /dev/null +++ b/.github/workflows/bump-changelog.yml @@ -0,0 +1,52 @@ +name: Bump changelog before release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to be released' + required: true + type: string + +env: + default-python: "3.12" + minimum-supported-python: "3.8" + +jobs: + bump-changelog: + name: Bump changelog + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v4 + - name: Set up Python ${{ env.default-python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.default-python }} + cache: "pip" + - name: Get release version and construct PR branch + run: | + echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + echo "PR_BRANCH=bump-changelog-for-${{ inputs.version }}" >> $GITHUB_ENV + - name: Create pull request branch + run: git switch -c $PR_BRANCH + - name: Install nox + run: python -m pip install nox + - name: Update changelog + run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION + - name: Commit and push change + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git commit -am "Bump changelog for $RELEASE_VERSION" + git fetch origin + git push origin $PR_BRANCH + - name: Create pull request + run: | + git fetch origin + gh pr create --base main --fill + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0aac2f395..edfef56a4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -124,40 +124,3 @@ jobs: uses: softprops/action-gh-release@v2 with: files: pipx.pyz - - bump-changelog: - name: Bump changelog on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [pypi-publish, upload-zipapp] - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout ${{ github.ref }} - uses: actions/checkout@v4 - - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.default-python }} - cache: "pip" - - name: Extract release tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Create pull request branch - run: git switch -c "bump-changelog-for-${RELEASE_VERSION}" - - name: Install nox - run: python -m pip install nox - - name: Update changelog - run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION - - name: Commit and push change - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git commit -am "Bump changelog for $RELEASE_VERSION" - git push origin "bump-changelog-for-${RELEASE_VERSION}" - - name: Create pull request - run: | - git fetch origin - gh pr create --base main --fill - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d601403954..b94854bace 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -220,7 +220,8 @@ nox -s watch_docs ## Releasing New `pipx` Versions -To publish to PyPI simply create a "published" release on GitHub. This will trigger GitHub workflows that publishes: +To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to +be released. Then, simply create a "published" release on GitHub. This will trigger GitHub workflows that publish: - the pipx version to PyPI, - the documentation to readthedocs, From cb3bc700c94b033a2360572ba595a87b53f4d1e0 Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 9 Apr 2024 17:49:49 +0200 Subject: [PATCH 28/54] Create `create-release` job in `tests.yml` --- .github/workflows/bump-changelog.yml | 2 +- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index dfda688f84..0d7331eaed 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -47,6 +47,6 @@ jobs: - name: Create pull request run: | git fetch origin - gh pr create --base main --fill + gh pr create --base main --fill --label release-version env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edfef56a4f..cd2b073411 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,31 @@ jobs: path: pipx.pyz retention-days: 3 + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event_name == 'pull_request' + && github.event.pull_request.merged == true + && github.event.pull_request.labels.name == 'release-version' + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "$VERSION" + commit: ${{ github.event.pull_request.merge_commit_sha }} + pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From ecc2a13d8e8305a5bd33d88794c0be4c2d90989d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 11:59:58 +0200 Subject: [PATCH 29/54] Bump changelog for 1.0.0 (#2) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2422186f20..84eca5be77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Features +<<<<<<< HEAD - Add `--global` option to `pipx` commands. - This will run the action in a global scope and affect environment for all system users. ([#754](https://github.com/pypa/pipx/issues/754)) - Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. @@ -23,11 +24,23 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - They were leading to a lot of issues with Windows sandboxing and spaces in shebangs on MacOS. ([#1257](https://github.com/pypa/pipx/issues/1257)) - Add `--install` option to `pipx upgrade` command. - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) +======= +- Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. + + When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) +- Add commands to list and prune standalone interpreters ([#1248](https://github.com/pypa/pipx/issues/1248)) +- Add `--install` option to `pipx upgrade` command. + + This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) +>>>>>>> Bump changelog for 1.0.0 (#2) ### Bugfixes - Correctly resolve home directory in pipx directory environment variables. ([#94](https://github.com/pypa/pipx/issues/94)) +<<<<<<< HEAD - Pass through `pip` arguments when upgrading shared libraries. ([#964](https://github.com/pypa/pipx/issues/964)) +======= +>>>>>>> Bump changelog for 1.0.0 (#2) - Fix installation issues when files in the working directory interfere with venv creation process. ([#1091](https://github.com/pypa/pipx/issues/1091)) - Report correct filename in tracebacks with `pipx run ` ([#1191](https://github.com/pypa/pipx/issues/1191)) - Let self-managed pipx uninstall itself on windows again. ([#1203](https://github.com/pypa/pipx/issues/1203)) @@ -41,6 +54,7 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Update the example for running scripts with dependencies. ([#1227](https://github.com/pypa/pipx/issues/1227)) - Update the docs for package developers on the use of configuration using pyproject.toml ([#1229](https://github.com/pypa/pipx/issues/1229)) - Add installation instructions for Fedora ([#1239](https://github.com/pypa/pipx/issues/1239)) +<<<<<<< HEAD - Update the examples for installation from local dir ([#1277](https://github.com/pypa/pipx/issues/1277)) - Fix inconsistent wording in `pipx install` command description. ([#1307](https://github.com/pypa/pipx/issues/1307)) @@ -51,6 +65,8 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Misc - [#1296](https://github.com/pypa/pipx/issues/1296) +======= +>>>>>>> Bump changelog for 1.0.0 (#2) ## [1.4.3](https://github.com/pypa/pipx/tree/1.4.3) - 2024-01-16 From 0acecbb9454de7eca88e68cf2e683f41cfb8eb4e Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:50:43 +0200 Subject: [PATCH 30/54] Specify pull request types that trigger CI --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd2b073411..d71a9dc0e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ on: branches: - "main" pull_request: + types: [opened, reopened, synchronize, closed] schedule: - cron: "0 8 * * *" concurrency: From aa3b1e1d1755f924ed4020b8ddea5fe5b5a64a91 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:57:48 +0200 Subject: [PATCH 31/54] Remove requirement for job --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d71a9dc0e5..6b257b24cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,8 +95,7 @@ jobs: permissions: contents: write if: >- - github.event_name == 'pull_request' - && github.event.pull_request.merged == true + github.event.pull_request.merged == true && github.event.pull_request.labels.name == 'release-version' steps: - uses: actions/checkout@v4 From ef1c9d25163bd3d20004c376857c124438c27599 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 13:12:44 +0200 Subject: [PATCH 32/54] Try to fix label detection --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b257b24cb..ce7b9af2fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,7 +96,7 @@ jobs: contents: write if: >- github.event.pull_request.merged == true - && github.event.pull_request.labels.name == 'release-version' + && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 6d2f27e90f37f262f84914d12817623f2dbdb00b Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:00:49 +0200 Subject: [PATCH 33/54] Try out `pull_request_target` event --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce7b9af2fd..b0d66edf60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,9 @@ on: branches: - "main" pull_request: - types: [opened, reopened, synchronize, closed] + pull_request_target: + types: + - closed schedule: - cron: "0 8 * * *" concurrency: From fc40ed48d507fad8981d7f4a5815d64b4e5f1dd6 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:14:12 +0200 Subject: [PATCH 34/54] Fix environment variable access syntax --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0d66edf60..55a86e1c07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -110,7 +110,7 @@ jobs: uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "$VERSION" + tag: "${{ env.VERSION }}" commit: ${{ github.event.pull_request.merge_commit_sha }} pypi-publish: From eb9bee1a2eb4f1dec5dfc4e30acd6cba0059dcd0 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:57:00 +0200 Subject: [PATCH 35/54] Try splitting out in separate workflow --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 27 --------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..03da2eea8b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + pull_request_target: + types: + - closed + +jobs: + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'release-version') + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "${{ env.VERSION }}" + commit: ${{ github.event.pull_request.merge_commit_sha }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55a86e1c07..edfef56a4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,9 +6,6 @@ on: branches: - "main" pull_request: - pull_request_target: - types: - - closed schedule: - cron: "0 8 * * *" concurrency: @@ -89,30 +86,6 @@ jobs: path: pipx.pyz retention-days: 3 - create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release - runs-on: ubuntu-latest - permissions: - contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') - steps: - - uses: actions/checkout@v4 - - name: Extract version to be released - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" - - name: Create release - uses: ncipollo/release-action@v1 - with: - generateReleaseNotes: true - tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} - pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 35fb55dc00f41275429c4ec2af0f22ccdf6c04fa Mon Sep 17 00:00:00 2001 From: chrysle Date: Mon, 15 Apr 2024 08:39:43 +0200 Subject: [PATCH 36/54] Use concurrency --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03da2eea8b..5c5695f8b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: pull_request_target: types: - closed +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + jobs: create-release: From dc124f5789e1be98d63cb1f71d529e2bfda49b9c Mon Sep 17 00:00:00 2001 From: chrysle Date: Tue, 9 Apr 2024 17:49:49 +0200 Subject: [PATCH 37/54] Create `create-release` job in `tests.yml` --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edfef56a4f..cd2b073411 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,31 @@ jobs: path: pipx.pyz retention-days: 3 + create-release: + name: >- + Create a release on GitHub's UI + which triggers the actual release + runs-on: ubuntu-latest + permissions: + contents: write + if: >- + github.event_name == 'pull_request' + && github.event.pull_request.merged == true + && github.event.pull_request.labels.name == 'release-version' + steps: + - uses: actions/checkout@v4 + - name: Extract version to be released + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + - name: Create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + tag: "$VERSION" + commit: ${{ github.event.pull_request.merge_commit_sha }} + pypi-publish: name: Publish pipx to PyPI on release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 74e938384c3213308daa89c4860abef214bdfccd Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:50:43 +0200 Subject: [PATCH 38/54] Specify pull request types that trigger CI --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd2b073411..d71a9dc0e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ on: branches: - "main" pull_request: + types: [opened, reopened, synchronize, closed] schedule: - cron: "0 8 * * *" concurrency: From 92a26b23310039c348d5629e35afb8f0230530c8 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 12:57:48 +0200 Subject: [PATCH 39/54] Remove requirement for job --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d71a9dc0e5..6b257b24cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,8 +95,7 @@ jobs: permissions: contents: write if: >- - github.event_name == 'pull_request' - && github.event.pull_request.merged == true + github.event.pull_request.merged == true && github.event.pull_request.labels.name == 'release-version' steps: - uses: actions/checkout@v4 From 77958829cbc5cbb5a772ae0aed962b40d227894e Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 13 Apr 2024 13:12:44 +0200 Subject: [PATCH 40/54] Try to fix label detection --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b257b24cb..ce7b9af2fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,7 +96,7 @@ jobs: contents: write if: >- github.event.pull_request.merged == true - && github.event.pull_request.labels.name == 'release-version' + && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 5e3e23ec43e025bf9a41646075b141737f645564 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:00:49 +0200 Subject: [PATCH 41/54] Try out `pull_request_target` event --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce7b9af2fd..b0d66edf60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,9 @@ on: branches: - "main" pull_request: - types: [opened, reopened, synchronize, closed] + pull_request_target: + types: + - closed schedule: - cron: "0 8 * * *" concurrency: From 2118c3284cb51416f0770a2beb4ff966d9c5c36c Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 14 Apr 2024 13:14:12 +0200 Subject: [PATCH 42/54] Fix environment variable access syntax --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0d66edf60..55a86e1c07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -110,7 +110,7 @@ jobs: uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "$VERSION" + tag: "${{ env.VERSION }}" commit: ${{ github.event.pull_request.merge_commit_sha }} pypi-publish: From fdf80558718dcd589ab1d81686f7d11fa98472ea Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:36:32 +0200 Subject: [PATCH 43/54] Try moving related jobs into release workflow --- .github/workflows/release.yml | 47 ++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c5695f8b4..6f6baad7b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,16 +10,51 @@ concurrency: jobs: + pypi-publish: + name: Publish pipx to PyPI + if: >- + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'release-version') + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/pipx + permissions: + id-token: write + steps: + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v4 + - name: Set up Python ${{ env.default-python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.default-python }} + cache: "pip" + - name: Install nox + run: pip install nox + - name: Build sdist and wheel + run: nox --error-on-missing-interpreters --non-interactive --session build + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@v1.8.14 + + upload-zipapp: + name: Upload zipapp to GitHub Release + needs: pypi-publish + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: pipx.pyz + - name: Upload to release + uses: softprops/action-gh-release@v1 + with: + files: pipx.pyz + create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release + name: Create a release on GitHub's UI + needs: [pypi-publish, upload-zipapp] runs-on: ubuntu-latest permissions: contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') steps: - uses: actions/checkout@v4 - name: Extract version to be released From 8401019e059d0b870923cb851ad7d4f4f2214e50 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:47:58 +0200 Subject: [PATCH 44/54] Specify Python version in release workflow --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f6baad7b7..eba7634335 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,8 @@ concurrency: group: tests-${{ github.ref }} cancel-in-progress: true +env: + default-python: "3.12" jobs: pypi-publish: From 5d006fb6bd5b93eff28ae3cbc2508eb37cc10bb4 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 16:55:24 +0200 Subject: [PATCH 45/54] Amend for testing --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eba7634335..dc3a9ba2c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - needs: pypi-publish + # needs: pypi-publish runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 @@ -53,7 +53,7 @@ jobs: create-release: name: Create a release on GitHub's UI - needs: [pypi-publish, upload-zipapp] + needs: upload-zipapp # [pypi-publish, upload-zipapp] runs-on: ubuntu-latest permissions: contents: write From 5b5bf24d8ff5b5f0a5912ef91f0791c41da5cb0a Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:11:26 +0200 Subject: [PATCH 46/54] Retrieve artifact from previous workflow run --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc3a9ba2c2..ff56b1de52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,9 +43,12 @@ jobs: # needs: pypi-publish runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: dawidd6/action-download-artifact@v3 with: name: pipx.pyz + workflow: tests.yml + workflow_conclusion: "" + pr: ${{ github.event.pull_request.number }} - name: Upload to release uses: softprops/action-gh-release@v1 with: From 55725139a1d1059d570f071267c7b0aea3be8c7e Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:20:43 +0200 Subject: [PATCH 47/54] Create release before uploading asset (makes sense) --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff56b1de52..2908e2d0e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,25 +38,9 @@ jobs: - name: Publish to PyPi uses: pypa/gh-action-pypi-publish@v1.8.14 - upload-zipapp: - name: Upload zipapp to GitHub Release - # needs: pypi-publish - runs-on: ubuntu-latest - steps: - - uses: dawidd6/action-download-artifact@v3 - with: - name: pipx.pyz - workflow: tests.yml - workflow_conclusion: "" - pr: ${{ github.event.pull_request.number }} - - name: Upload to release - uses: softprops/action-gh-release@v1 - with: - files: pipx.pyz - create-release: name: Create a release on GitHub's UI - needs: upload-zipapp # [pypi-publish, upload-zipapp] + # needs: pypi-publish runs-on: ubuntu-latest permissions: contents: write @@ -72,4 +56,20 @@ jobs: with: generateReleaseNotes: true tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} \ No newline at end of file + commit: ${{ github.event.pull_request.merge_commit_sha }} + + upload-zipapp: + name: Upload zipapp to GitHub Release + # needs: pypi-publish + runs-on: ubuntu-latest + steps: + - uses: dawidd6/action-download-artifact@v3 + with: + name: pipx.pyz + workflow: tests.yml + workflow_conclusion: "" + pr: ${{ github.event.pull_request.number }} + - name: Upload to release + uses: softprops/action-gh-release@v1 + with: + files: pipx.pyz From 14c9526c3e6ea5e8e9b0c329f0eb695ffb7f391e Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:36:40 +0200 Subject: [PATCH 48/54] Specify tag name --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2908e2d0e9..c8bec8300a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,3 +73,4 @@ jobs: uses: softprops/action-gh-release@v1 with: files: pipx.pyz + tag_name: "${{ env.VERSION }}" From fe1dba9a12a52d6c2ec7be0179654eee17364df8 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 17:43:38 +0200 Subject: [PATCH 49/54] Don't run in parallel *yawn* --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8bec8300a..5cfcbf7842 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,6 +61,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release # needs: pypi-publish + needs: create-release runs-on: ubuntu-latest steps: - uses: dawidd6/action-download-artifact@v3 From 02baf8bc2206efce5c9881b595dcaf6a800f5d0c Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 18:01:36 +0200 Subject: [PATCH 50/54] Get that blasted tag --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cfcbf7842..41bbb5108a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,20 +42,23 @@ jobs: name: Create a release on GitHub's UI # needs: pypi-publish runs-on: ubuntu-latest + outputs: + release-tag: ${{ steps.get-version.outputs.version }} permissions: contents: write steps: - uses: actions/checkout@v4 - name: Extract version to be released + id: get-version env: TITLE: ${{ github.event.pull_request.title }} run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" + echo "version=${TITLE##bump changelog for }" >> "$GITHUB_OUTPUT" - name: Create release uses: ncipollo/release-action@v1 with: generateReleaseNotes: true - tag: "${{ env.VERSION }}" + tag: "${{ steps.get-version.outputs.version }}" commit: ${{ github.event.pull_request.merge_commit_sha }} upload-zipapp: @@ -74,4 +77,4 @@ jobs: uses: softprops/action-gh-release@v1 with: files: pipx.pyz - tag_name: "${{ env.VERSION }}" + tag_name: "${{ needs.create-release.outputs.release-tag }}" From a8806691249a163eb9dd822eb7621a99eac60135 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Tue, 14 May 2024 18:07:49 +0200 Subject: [PATCH 51/54] Permissions --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41bbb5108a..9e26c39813 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,6 +66,8 @@ jobs: # needs: pypi-publish needs: create-release runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: dawidd6/action-download-artifact@v3 with: From a48b1fc45d913781bdbea4aea06222370de6ad14 Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Wed, 15 May 2024 16:54:29 +0200 Subject: [PATCH 52/54] Cleanup, docs --- .github/workflows/bump-changelog.yml | 2 +- .github/workflows/release.yml | 7 ++- .github/workflows/tests.yml | 66 ---------------------------- CHANGELOG.md | 16 ------- CONTRIBUTING.md | 5 ++- 5 files changed, 7 insertions(+), 89 deletions(-) diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index 0d7331eaed..bdd6aa6eed 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -41,7 +41,7 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git commit -am "Bump changelog for $RELEASE_VERSION" + git commit -am "$RELEASE_VERSION: Bump changelog" git fetch origin git push origin $PR_BRANCH - name: Create pull request diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e26c39813..6e9e003238 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: create-release: name: Create a release on GitHub's UI - # needs: pypi-publish + needs: pypi-publish runs-on: ubuntu-latest outputs: release-tag: ${{ steps.get-version.outputs.version }} @@ -53,7 +53,7 @@ jobs: env: TITLE: ${{ github.event.pull_request.title }} run: | - echo "version=${TITLE##bump changelog for }" >> "$GITHUB_OUTPUT" + echo "version=${TITLE/: [[:alnum:]]*} }" >> "$GITHUB_OUTPUT" - name: Create release uses: ncipollo/release-action@v1 with: @@ -63,7 +63,6 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - # needs: pypi-publish needs: create-release runs-on: ubuntu-latest permissions: @@ -73,7 +72,7 @@ jobs: with: name: pipx.pyz workflow: tests.yml - workflow_conclusion: "" + workflow_conclusion: success pr: ${{ github.event.pull_request.number }} - name: Upload to release uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55a86e1c07..71450e74c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,9 +6,6 @@ on: branches: - "main" pull_request: - pull_request_target: - types: - - closed schedule: - cron: "0 8 * * *" concurrency: @@ -88,66 +85,3 @@ jobs: name: pipx.pyz path: pipx.pyz retention-days: 3 - - create-release: - name: >- - Create a release on GitHub's UI - which triggers the actual release - runs-on: ubuntu-latest - permissions: - contents: write - if: >- - github.event.pull_request.merged == true - && contains(github.event.pull_request.labels.*.name, 'release-version') - steps: - - uses: actions/checkout@v4 - - name: Extract version to be released - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - echo "VERSION=${TITLE##bump changelog for }" >> "$GITHUB_ENV" - - name: Create release - uses: ncipollo/release-action@v1 - with: - generateReleaseNotes: true - tag: "${{ env.VERSION }}" - commit: ${{ github.event.pull_request.merge_commit_sha }} - - pypi-publish: - name: Publish pipx to PyPI on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [tests, man, zipapp] - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/pipx - permissions: - id-token: write - steps: - - name: Checkout ${{ github.ref }} - uses: actions/checkout@v4 - - name: Set up Python ${{ env.default-python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ env.default-python }} - cache: "pip" - - name: Install nox - run: pip install nox - - name: Build sdist and wheel - run: nox --error-on-missing-interpreters --non-interactive --session build - - name: Publish to PyPi - uses: pypa/gh-action-pypi-publish@v1.8.14 - - upload-zipapp: - name: Upload zipapp to GitHub Release on release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [tests, man, zipapp] - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - name: pipx.pyz - - name: Upload to release - uses: softprops/action-gh-release@v2 - with: - files: pipx.pyz diff --git a/CHANGELOG.md b/CHANGELOG.md index 84eca5be77..2422186f20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Features -<<<<<<< HEAD - Add `--global` option to `pipx` commands. - This will run the action in a global scope and affect environment for all system users. ([#754](https://github.com/pypa/pipx/issues/754)) - Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. @@ -24,23 +23,11 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - They were leading to a lot of issues with Windows sandboxing and spaces in shebangs on MacOS. ([#1257](https://github.com/pypa/pipx/issues/1257)) - Add `--install` option to `pipx upgrade` command. - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) -======= -- Add a `--fetch-missing-python` flag to all commands that accept a `--python` flag. - - When combined, this will automatically download a standalone copy of the requested python version if it's not already available on the user's system. ([#1242](https://github.com/pypa/pipx/issues/1242)) -- Add commands to list and prune standalone interpreters ([#1248](https://github.com/pypa/pipx/issues/1248)) -- Add `--install` option to `pipx upgrade` command. - - This will install the package given as argument if it is not already installed. ([#1262](https://github.com/pypa/pipx/issues/1262)) ->>>>>>> Bump changelog for 1.0.0 (#2) ### Bugfixes - Correctly resolve home directory in pipx directory environment variables. ([#94](https://github.com/pypa/pipx/issues/94)) -<<<<<<< HEAD - Pass through `pip` arguments when upgrading shared libraries. ([#964](https://github.com/pypa/pipx/issues/964)) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) - Fix installation issues when files in the working directory interfere with venv creation process. ([#1091](https://github.com/pypa/pipx/issues/1091)) - Report correct filename in tracebacks with `pipx run ` ([#1191](https://github.com/pypa/pipx/issues/1191)) - Let self-managed pipx uninstall itself on windows again. ([#1203](https://github.com/pypa/pipx/issues/1203)) @@ -54,7 +41,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t - Update the example for running scripts with dependencies. ([#1227](https://github.com/pypa/pipx/issues/1227)) - Update the docs for package developers on the use of configuration using pyproject.toml ([#1229](https://github.com/pypa/pipx/issues/1229)) - Add installation instructions for Fedora ([#1239](https://github.com/pypa/pipx/issues/1239)) -<<<<<<< HEAD - Update the examples for installation from local dir ([#1277](https://github.com/pypa/pipx/issues/1277)) - Fix inconsistent wording in `pipx install` command description. ([#1307](https://github.com/pypa/pipx/issues/1307)) @@ -65,8 +51,6 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t ### Misc - [#1296](https://github.com/pypa/pipx/issues/1296) -======= ->>>>>>> Bump changelog for 1.0.0 (#2) ## [1.4.3](https://github.com/pypa/pipx/tree/1.4.3) - 2024-01-16 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b94854bace..7200e20dc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -221,10 +221,11 @@ nox -s watch_docs ## Releasing New `pipx` Versions To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to -be released. Then, simply create a "published" release on GitHub. This will trigger GitHub workflows that publish: +be released. This will create a pull request updating the changelog for the upcoming version, with the `release-version` label. Attaching this label to any pull request of which the title follows the format `: Description` and merging it will trigger GitHub workflows that publish: - the pipx version to PyPI, -- the documentation to readthedocs, +- the documentation to ReadTheDocs, +- a GitHub release - the `zipapp` to the GitHub release created. No need for any other pre or post publish steps. From aee2f5281c1913aad18b8331fe0aff7c073f70ce Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Thu, 16 May 2024 13:00:19 +0200 Subject: [PATCH 53/54] Better sentence structure Co-authored-by: Robert <49005401+Gitznik@users.noreply.github.com> --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7200e20dc2..add879ed9a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -220,8 +220,11 @@ nox -s watch_docs ## Releasing New `pipx` Versions -To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to -be released. This will create a pull request updating the changelog for the upcoming version, with the `release-version` label. Attaching this label to any pull request of which the title follows the format `: Description` and merging it will trigger GitHub workflows that publish: +To release a new version, manually run the `bump-changelog` action under the *"Actions"* tab, passing it the version to be released. This will create a pull request updating the changelog for the upcoming version, with the `release-version` label. Merging this PR will automatically trigger the release workflows. + +Attaching this label to any pull request of which the title follows the format `: Description` and merging it will trigger the release workflows as well. + +The release workflow consists of publishing: - the pipx version to PyPI, - the documentation to ReadTheDocs, From 99bc753c947604574ab6c77f0307643da5a2ab2f Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Fri, 17 May 2024 17:40:22 +0200 Subject: [PATCH 54/54] Use concurrency in `bump-changelog.yml` And fix concurrency group definition in `release.yml`. --- .github/workflows/bump-changelog.yml | 3 +++ .github/workflows/release.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-changelog.yml b/.github/workflows/bump-changelog.yml index bdd6aa6eed..2c895037fc 100644 --- a/.github/workflows/bump-changelog.yml +++ b/.github/workflows/bump-changelog.yml @@ -7,6 +7,9 @@ on: description: 'Version to be released' required: true type: string +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true env: default-python: "3.12" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e9e003238..f9c3ab0172 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: types: - closed concurrency: - group: tests-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: