Skip to content

Commit 008d266

Browse files
committed
Use trusted publishing and hatch
1 parent 528726e commit 008d266

File tree

4 files changed

+80
-59
lines changed

4 files changed

+80
-59
lines changed

.github/workflows/release.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
pypi-publish:
10+
name: Build and upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v4
18+
- run: pip install build
19+
- run: python -m build
20+
- name: Publish package distributions to PyPI
21+
uses: pypa/gh-action-pypi-publish@release/v1

common.mk

-9
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ release:
1818
@if ! type -P pandoc; then echo "Please install pandoc"; exit 1; fi
1919
@if ! type -P sponge; then echo "Please install moreutils"; exit 1; fi
2020
@if ! type -P gh; then echo "Please install gh"; exit 1; fi
21-
@if ! type -P twine; then echo "Please install twine"; exit 1; fi
2221
git pull
23-
git clean -x --force $$(python setup.py --name)
24-
sed -i -e "s/version=\([\'\"]\)[0-9]*\.[0-9]*\.[0-9]*/version=\1$${TAG:1}/" setup.py
25-
git add setup.py
2622
TAG_MSG=$$(mktemp); \
2723
echo "# Changes for ${TAG} ($$(date +%Y-%m-%d))" > $$TAG_MSG; \
2824
git log --pretty=format:%s $$(git describe --abbrev=0)..HEAD >> $$TAG_MSG; \
@@ -34,13 +30,8 @@ release:
3430
git push --follow-tags
3531
$(MAKE) install
3632
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//')"
37-
$(MAKE) release-pypi
3833
$(MAKE) release-docs
3934

40-
release-pypi:
41-
python -m build
42-
twine upload dist/*.tar.gz dist/*.whl --verbose
43-
4435
release-docs:
4536
$(MAKE) docs
4637
-git branch -D gh-pages

pyproject.toml

+59
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
[project]
2+
name = "signxml"
3+
description = "Python XML Signature and XAdES library"
4+
readme = "README.rst"
5+
requires-python = ">=3.8"
6+
license = { text = "Apache Software License" }
7+
authors = [{ name = "Andrey Kislyuk"}, {email = "[email protected]" }]
8+
authors = [{ name = "Andrey Kislyuk"}, {email = "[email protected]" }]
9+
dynamic = ["version"]
10+
classifiers = [
11+
"Intended Audience :: Developers",
12+
"License :: OSI Approved :: Apache Software License",
13+
"Operating System :: MacOS :: MacOS X",
14+
"Operating System :: POSIX",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: Implementation :: CPython",
24+
"Programming Language :: Python :: Implementation :: PyPy",
25+
"Development Status :: 5 - Production/Stable",
26+
"Topic :: Software Development",
27+
"Topic :: Software Development :: Libraries :: Python Modules",
28+
]
29+
dependencies = [
30+
"lxml >= 5.2.1, < 6", # Ubuntu 24.04 LTS
31+
"cryptography >= 43", # Required to support client certificate validation
32+
"certifi >= 2023.11.17", # Ubuntu 24.04 LTS
33+
# "tsp-client >= 0.1.3",
34+
]
35+
36+
[project.optional-dependencies]
37+
test = [
38+
"ruff",
39+
"coverage",
40+
"build",
41+
"wheel",
42+
"mypy",
43+
"lxml-stubs",
44+
]
45+
46+
[project.urls]
47+
"Homepage"= "https://github.com/kislyuk/signxml"
48+
"Documentation"= "https://xml-security.github.io/signxml/"
49+
"Source Code"= "https://github.com/kislyuk/signxml"
50+
"Issue Tracker"= "https://github.com/kislyuk/signxml/issues"
51+
"Change Log"= "https://github.com/kislyuk/signxml/blob/main/Changes.rst"
52+
53+
[build-system]
54+
requires = ["hatchling", "hatch-vcs"]
55+
build-backend = "hatchling.build"
56+
57+
[tool.hatch.version]
58+
source = "vcs"
59+
160
[tool.black]
261
line-length = 120
362

setup.py

-50
This file was deleted.

0 commit comments

Comments
 (0)