-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish to PyPI using Trusted Publishers (#94)
Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build package | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Always build & lint package. | ||
build-package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: hynek/build-and-inspect-python-package@v1 | ||
|
||
# Publish to Test PyPI on every commit on main. | ||
release-test-pypi: | ||
name: Publish in-dev package to test.pypi.org | ||
if: | | ||
github.repository_owner == 'python' | ||
&& github.event_name == 'push' | ||
&& github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
# Publish to PyPI on GitHub Releases. | ||
release-pypi: | ||
name: Publish to PyPI | ||
# Only run for published releases. | ||
if: | | ||
github.repository_owner == 'python' | ||
&& github.event.action == 'published' | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
"""Backport CPython changes from main to maintenance branches.""" | ||
__version__ = "2.2.0" | ||
import importlib.metadata | ||
|
||
__version__ = importlib.metadata.version(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,48 @@ | ||
[build-system] | ||
requires = ["flit_core>=3.2,<4"] | ||
build-backend = "flit_core.buildapi" | ||
build-backend = "hatchling.build" | ||
requires = [ | ||
"hatch-vcs", | ||
"hatchling", | ||
] | ||
|
||
[project] | ||
name = "cherry_picker" | ||
authors = [{ name = "Mariatta Wijaya", email = "mariatta@python.org" }] | ||
name = "cherry-picker" | ||
readme = "readme.rst" | ||
maintainers = [{ name = "Python Core Developers", email = "core-workflow@python.org" }] | ||
authors = [{ name = "Mariatta Wijaya", email = "mariatta@python.org" }] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dynamic = [ | ||
"description", | ||
"version", | ||
] | ||
dependencies = [ | ||
"click>=6.0", | ||
"gidgethub", | ||
"requests", | ||
"tomli>=1.1.0;python_version<'3.11'", | ||
"click>=6", | ||
"gidgethub", | ||
"requests", | ||
'tomli>=1.1; python_version < "3.11"', | ||
] | ||
readme = "readme.rst" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3.8", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
requires-python = ">=3.8" | ||
dynamic = ["version", "description"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/python/cherry-picker" | ||
|
||
[project.scripts] | ||
cherry_picker = "cherry_picker.cherry_picker:cherry_pick_cli" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
[tool.hatch] | ||
version.source = "vcs" | ||
|
||
[tool.hatch.version.raw-options] | ||
local_scheme = "no-local-version" |