Skip to content

Commit

Permalink
Use trusted publishing and hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Dec 31, 2024
1 parent 528726e commit 008d266
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 59 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish release to PyPI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
pypi-publish:
name: Build and upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- run: pip install build
- run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
9 changes: 0 additions & 9 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ release:
@if ! type -P pandoc; then echo "Please install pandoc"; exit 1; fi
@if ! type -P sponge; then echo "Please install moreutils"; exit 1; fi
@if ! type -P gh; then echo "Please install gh"; exit 1; fi
@if ! type -P twine; then echo "Please install twine"; exit 1; fi
git pull
git clean -x --force $$(python setup.py --name)
sed -i -e "s/version=\([\'\"]\)[0-9]*\.[0-9]*\.[0-9]*/version=\1$${TAG:1}/" setup.py
git add setup.py
TAG_MSG=$$(mktemp); \
echo "# Changes for ${TAG} ($$(date +%Y-%m-%d))" > $$TAG_MSG; \
git log --pretty=format:%s $$(git describe --abbrev=0)..HEAD >> $$TAG_MSG; \
Expand All @@ -34,13 +30,8 @@ release:
git push --follow-tags
$(MAKE) install
gh release create ${TAG} dist/*.whl --notes="$$(git tag --list ${TAG} -n99 | perl -pe 's/^\S+\s*// if $$. == 1' | sed 's/^\s\s\s\s//')"
$(MAKE) release-pypi
$(MAKE) release-docs

release-pypi:
python -m build
twine upload dist/*.tar.gz dist/*.whl --verbose

release-docs:
$(MAKE) docs
-git branch -D gh-pages
Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
[project]
name = "signxml"
description = "Python XML Signature and XAdES library"
readme = "README.rst"
requires-python = ">=3.8"
license = { text = "Apache Software License" }
authors = [{ name = "Andrey Kislyuk"}, {email = "[email protected]" }]
authors = [{ name = "Andrey Kislyuk"}, {email = "[email protected]" }]
dynamic = ["version"]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Development Status :: 5 - Production/Stable",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"lxml >= 5.2.1, < 6", # Ubuntu 24.04 LTS
"cryptography >= 43", # Required to support client certificate validation
"certifi >= 2023.11.17", # Ubuntu 24.04 LTS
# "tsp-client >= 0.1.3",
]

[project.optional-dependencies]
test = [
"ruff",
"coverage",
"build",
"wheel",
"mypy",
"lxml-stubs",
]

[project.urls]
"Homepage"= "https://github.com/kislyuk/signxml"
"Documentation"= "https://xml-security.github.io/signxml/"
"Source Code"= "https://github.com/kislyuk/signxml"
"Issue Tracker"= "https://github.com/kislyuk/signxml/issues"
"Change Log"= "https://github.com/kislyuk/signxml/blob/main/Changes.rst"

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[tool.black]
line-length = 120

Expand Down
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

0 comments on commit 008d266

Please sign in to comment.