File tree Expand file tree Collapse file tree 6 files changed +58
-54
lines changed Expand file tree Collapse file tree 6 files changed +58
-54
lines changed Original file line number Diff line number Diff line change 66
77jobs :
88 pypi_release :
9- name : Build with Poetry and Publish to PyPI
9+ name : Build and Publish to PyPI
1010 runs-on : ubuntu-latest
1111 environment :
1212 name : pypi
1616 steps :
1717 - uses : actions/checkout@v4
1818 - uses : actions/setup-python@v5
19- - name : Install and configure Poetry
20- run : pip install poetry
21- - name : Publish package
22- run : poetry build
19+ - name : Install the latest version of uv
20+ uses : astral-sh/setup-uv@v5
21+ with :
22+ version : latest
23+ enable-cache : true
24+ - name : Build package
25+ run : uv build
2326 - name : Publish package distributions to PyPI
2427 uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 11name : Test
22
33on :
4- - push
5- - pull_request
4+ pull_request :
5+ push :
6+ branches :
7+ - main
68
79jobs :
8- pre_job :
9- runs-on : ubuntu-latest
10- outputs :
11- should_skip : ${{ steps.skip_check.outputs.should_skip }}
12- steps :
13- - id : skip_check
14- uses : fkirc/skip-duplicate-actions@master
15- with :
16- do_not_skip : ' ["pull_request"]'
17- cancel_others : ' true'
18- concurrent_skipping : same_content
1910 ruff :
20- needs : pre_job
2111 runs-on : ubuntu-latest
2212 steps :
2313 - uses : actions/checkout@v4
@@ -44,15 +34,14 @@ jobs:
4434 uses : actions/setup-python@v5
4535 with :
4636 python-version : ${{ matrix.python-version }}
47- - name : Install and configure Poetry
48- run : |
49- pip install poetry
50- poetry config virtualenvs.in-project true
51- - name : Install dependencies
52- run : poetry install
37+ - name : Install the latest version of uv
38+ uses : astral-sh/setup-uv@v5
39+ with :
40+ version : latest
41+ enable-cache : true
5342 - name : Run pytest
5443 run : |
55- poetry run pytest -vvv -ra --cov=cryptojwt --cov-report=xml
44+ uv run pytest -vvv -ra --cov=cryptojwt --cov-report=xml
5645 - name : Upload coverage to Codecov
5746 uses : codecov/codecov-action@v4
5847 with :
Original file line number Diff line number Diff line change @@ -137,5 +137,4 @@ tests/pyoidc
137137tests /pyoidc.pub
138138tests /xtest_usage.py
139139
140- # Poetry
141- poetry.lock
140+ * .lock
Original file line number Diff line number Diff line change 11all :
22
33test :
4- poetry run pytest --ruff --ruff-format --cov
4+ uv run pytest --ruff --ruff-format --cov
55
66reformat :
7- poetry run ruff check --select I --fix src tests
8- poetry run ruff format src tests
7+ uv run ruff check --select I --fix src tests
8+ uv run ruff format src tests
Original file line number Diff line number Diff line change 11# PEP 518: https://www.python.org/dev/peps/pep-0518/
22
3- [tool . poetry ]
3+ [project ]
44name = " cryptojwt"
5- version = " 1.9.4 "
5+ dynamic = [ " version " ]
66description = " Python implementation of JWT, JWE, JWS and JWK"
7- authors = [" Roland Hedberg <roland@catalogix.se>" ]
7+ authors = [
8+ {name =" Roland Hedberg" , email = " roland@catalogix.se" }
9+ ]
810license = " Apache-2.0"
911repository = " https://github.com/IdentityPython/JWTConnect-Python-CryptoJWT"
1012readme = " README.md"
1113packages = [
1214 { include = " cryptojwt" , from = " src" }
1315]
16+ requires-python = " >=3.9,<4.0"
17+ dependencies = [
18+ " cryptography>=3.4.6" ,
19+ " requests>=2.25.1"
20+ ]
1421
15- [tool . poetry .scripts ]
22+ [project .scripts ]
1623jwkgen = " cryptojwt.tools.keygen:main"
1724jwkconv = " cryptojwt.tools.keyconv:main"
1825jwtpeek = " cryptojwt.tools.jwtpeek:main"
1926
20- [tool .poetry .dependencies ]
21- python = " ^3.9"
22- cryptography = " >=3.4.6"
23- requests = " ^2.25.1"
27+ [build-system ]
28+ requires = [" hatchling" , " uv-dynamic-versioning" ]
29+ build-backend = " hatchling.build"
30+
31+ [tool .hatch .version ]
32+ source = " uv-dynamic-versioning"
2433
25- [tool .poetry .group .dev .dependencies ]
26- alabaster = " ^0.7.12"
27- pytest = " ^8.2.1"
28- pytest-cov = " ^4.0.0"
29- responses = " ^0.13.0"
30- sphinx = " ^3.5.2"
31- sphinx-autobuild = " ^2021.3.14"
32- coverage = " ^7"
33- ruff = " >=0.9.9"
34- pytest-ruff = " ^0.3.2"
34+ [tool .hatch .metadata ]
35+ allow-direct-references = true
3536
36- [build-system ]
37- requires = [" poetry-core>=1.0.0" ]
38- build-backend = " poetry.core.masonry.api"
37+ [dependency-groups ]
38+ dev = [
39+ " alabaster>=0.7.12" ,
40+ " pytest>=8.2.1" ,
41+ " pytest-cov>=4.0.0" ,
42+ " responses>=0.13.0" ,
43+ " sphinx>=3.5.2" ,
44+ " sphinx-autobuild>=2021.3.14" ,
45+ " coverage>=7" ,
46+ " ruff>=0.9.9" ,
47+ " pytest-ruff>=0.3.2"
48+ ]
3949
4050[tool .coverage .run ]
4151branch = true
Original file line number Diff line number Diff line change 11"""JSON Web Token"""
22
33import logging
4- from importlib .metadata import version
4+ from importlib .metadata import version , PackageNotFoundError
55
66from cryptojwt .jwe .jwe import JWE
77from cryptojwt .jwk import JWK
1313from .exception import BadSyntax
1414from .utils import as_unicode , b64d , b64encode_item , split_token
1515
16- __version__ = version ("cryptojwt" )
16+ try :
17+ __version__ = version ("cryptojwt" )
18+ except PackageNotFoundError :
19+ __version__ = "0.0.0"
1720
1821__all__ = [
1922 "JWE" ,
You can’t perform that action at this time.
0 commit comments