Skip to content

Commit 6d7d422

Browse files
committed
Use trusted publishing and hatch
1 parent b6140d0 commit 6d7d422

File tree

4 files changed

+68
-59
lines changed

4 files changed

+68
-59
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
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@v5
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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ 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
22+
git clean -x --force watchtower
2623
TAG_MSG=$$(mktemp); \
2724
echo "# Changes for ${TAG} ($$(date +%Y-%m-%d))" > $$TAG_MSG; \
2825
git log --pretty=format:%s $$(git describe --abbrev=0)..HEAD >> $$TAG_MSG; \
@@ -34,13 +31,8 @@ release:
3431
git push --follow-tags
3532
$(MAKE) install
3633
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
3834
$(MAKE) release-docs
3935

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

pyproject.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
[project]
2+
name = "watchtower"
3+
description = "Python CloudWatch Logging"
4+
readme = "README.rst"
5+
requires-python = ">=3.8"
6+
license = { text = "Apache Software License" }
7+
authors = [{ name = "Andrey Kislyuk"}, {email = "[email protected]" }]
8+
maintainers = [{ 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+
30+
[project.optional-dependencies]
31+
test = ["pyyaml", "coverage", "build", "wheel", "ruff", "mypy"]
32+
33+
[project.urls]
34+
"Homepage"= "https://github.com/kislyuk/watchtower"
35+
"Documentation"= "https://kislyuk.github.io/watchtower"
36+
"Source Code"= "https://github.com/kislyuk/watchtower"
37+
"Issue Tracker"= "https://github.com/kislyuk/watchtower/issues"
38+
"Change Log"= "https://github.com/kislyuk/watchtower/blob/develop/Changes.rst"
39+
40+
[build-system]
41+
requires = ["hatchling", "hatch-vcs"]
42+
build-backend = "hatchling.build"
43+
44+
[tool.hatch.version]
45+
source = "vcs"
46+
147
[tool.black]
248
line-length = 120
349

setup.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)