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 6
6
7
7
jobs :
8
8
pypi_release :
9
- name : Build with Poetry and Publish to PyPI
9
+ name : Build and Publish to PyPI
10
10
runs-on : ubuntu-latest
11
11
environment :
12
12
name : pypi
16
16
steps :
17
17
- uses : actions/checkout@v4
18
18
- 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
23
26
- name : Publish package distributions to PyPI
24
27
uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 1
1
name : Test
2
2
3
3
on :
4
- - push
5
- - pull_request
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - main
6
8
7
9
jobs :
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
19
10
ruff :
20
- needs : pre_job
21
11
runs-on : ubuntu-latest
22
12
steps :
23
13
- uses : actions/checkout@v4
@@ -44,15 +34,14 @@ jobs:
44
34
uses : actions/setup-python@v5
45
35
with :
46
36
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
53
42
- name : Run pytest
54
43
run : |
55
- poetry run pytest -vvv -ra --cov=cryptojwt --cov-report=xml
44
+ uv run pytest -vvv -ra --cov=cryptojwt --cov-report=xml
56
45
- name : Upload coverage to Codecov
57
46
uses : codecov/codecov-action@v4
58
47
with :
Original file line number Diff line number Diff line change @@ -137,5 +137,4 @@ tests/pyoidc
137
137
tests /pyoidc.pub
138
138
tests /xtest_usage.py
139
139
140
- # Poetry
141
- poetry.lock
140
+ * .lock
Original file line number Diff line number Diff line change 1
1
all :
2
2
3
3
test :
4
- poetry run pytest --ruff --ruff-format --cov
4
+ uv run pytest --ruff --ruff-format --cov
5
5
6
6
reformat :
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 1
1
# PEP 518: https://www.python.org/dev/peps/pep-0518/
2
2
3
- [tool . poetry ]
3
+ [project ]
4
4
name = " cryptojwt"
5
- version = " 1.9.4 "
5
+ dynamic = [ " version " ]
6
6
description = " 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
+ ]
8
10
license = " Apache-2.0"
9
11
repository = " https://github.com/IdentityPython/JWTConnect-Python-CryptoJWT"
10
12
readme = " README.md"
11
13
packages = [
12
14
{ include = " cryptojwt" , from = " src" }
13
15
]
16
+ requires-python = " >=3.9,<4.0"
17
+ dependencies = [
18
+ " cryptography>=3.4.6" ,
19
+ " requests>=2.25.1"
20
+ ]
14
21
15
- [tool . poetry .scripts ]
22
+ [project .scripts ]
16
23
jwkgen = " cryptojwt.tools.keygen:main"
17
24
jwkconv = " cryptojwt.tools.keyconv:main"
18
25
jwtpeek = " cryptojwt.tools.jwtpeek:main"
19
26
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"
24
33
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
35
36
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
+ ]
39
49
40
50
[tool .coverage .run ]
41
51
branch = true
Original file line number Diff line number Diff line change 1
1
"""JSON Web Token"""
2
2
3
3
import logging
4
- from importlib .metadata import version
4
+ from importlib .metadata import version , PackageNotFoundError
5
5
6
6
from cryptojwt .jwe .jwe import JWE
7
7
from cryptojwt .jwk import JWK
13
13
from .exception import BadSyntax
14
14
from .utils import as_unicode , b64d , b64encode_item , split_token
15
15
16
- __version__ = version ("cryptojwt" )
16
+ try :
17
+ __version__ = version ("cryptojwt" )
18
+ except PackageNotFoundError :
19
+ __version__ = "0.0.0"
17
20
18
21
__all__ = [
19
22
"JWE" ,
You can’t perform that action at this time.
0 commit comments