File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 - ' docs/**'
88 branches :
99 - main
10+ tags :
11+ - ' v*.*'
1012 pull_request :
1113 branches :
1214 - main
@@ -22,11 +24,11 @@ jobs:
2224 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2325 steps :
2426 - name : Checkout
25- uses : actions/checkout@v3
27+ uses : actions/checkout@v4
2628
2729 - name : Set up Python
2830 id : setup-python
29- uses : actions/setup-python@v4
31+ uses : actions/setup-python@v5
3032 with :
3133 python-version : ${{ matrix.python-version }}
3234
4547 - name : Report coverage
4648 run : |
4749 make coveralls
50+
51+ release :
52+ needs : test
53+ runs-on : ubuntu-latest
54+ environment :
55+ name : pypi
56+ url : https://pypi.org/p/rolo
57+ permissions :
58+ id-token : write
59+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
60+ steps :
61+ - name : Checkout
62+ uses : actions/checkout@v4
63+ with :
64+ fetch-depth : 0
65+
66+ - name : Set up Python
67+ uses : actions/setup-python@v5
68+ with :
69+ python-version : " 3.13"
70+
71+ - name : Build release
72+ run : make dist
73+
74+ - name : List artifacts
75+ run : ls -lah dist/
76+
77+ - name : Publish package distributions to PyPI
78+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change @@ -135,3 +135,6 @@ venv.bak/
135135
136136# sqlite database files created by examples
137137* .db
138+
139+ # Hatch VCS hook generates this file during build
140+ rolo /version.py
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ venv: $(VENV_ACTIVATE)
88
99$(VENV_ACTIVATE ) : pyproject.toml
1010 test -d .venv || $(VENV_BIN ) .venv
11- $(VENV_RUN ) ; pip install --upgrade pip setuptools wheel
11+ $(VENV_RUN ) ; pip install --upgrade pip
1212 $(VENV_RUN ) ; pip install -e .[dev]
1313 touch $(VENV_DIR ) /bin/activate
1414
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [" setuptools " , " wheel " ]
3- build-backend = " setuptools.build_meta "
2+ requires = [" hatchling " , " hatch-vcs " ]
3+ build-backend = " hatchling.build "
44
55[project ]
66name = " rolo"
77authors = [
88 { name = " LocalStack Contributors" , email = " info@localstack.cloud" }
99]
10- version = " 0.8.0"
1110description = " A Python framework for building HTTP-based server applications"
1211dependencies = [
1312 " requests>=2.20" ,
@@ -26,7 +25,7 @@ classifiers = [
2625 " Programming Language :: Python :: 3.13" ,
2726 " Topic :: Software Development :: Libraries"
2827]
29- dynamic = [" readme" ]
28+ dynamic = [" readme" , " version " ]
3029
3130
3231[project .optional-dependencies ]
@@ -48,18 +47,11 @@ docs = [
4847 " myst_parser" ,
4948]
5049
51- [tool .setuptools ]
52- include-package-data = false
50+ [tool .hatch . version ]
51+ source = " vcs "
5352
54- [tool .setuptools .dynamic ]
55- readme = {file = [" README.md" ], content-type = " text/markdown" }
56-
57- [tool .setuptools .packages .find ]
58- include = [" rolo*" ]
59- exclude = [" tests*" ]
60-
61- [tool .setuptools .package-data ]
62- "*" = [" *.md" ]
53+ [tool .hatch .build .hooks .vcs ]
54+ version-file = " rolo/version.py"
6355
6456[tool .black ]
6557line_length = 100
Original file line number Diff line number Diff line change 22from .response import Response
33from .routing .resource import Resource , resource
44from .routing .router import Router , route
5+ from .version import __version__
56
67__all__ = [
78 "route" ,
1011 "Router" ,
1112 "Response" ,
1213 "Request" ,
14+ "__version__" ,
1315]
You can’t perform that action at this time.
0 commit comments