Skip to content

Commit f1bbf81

Browse files
authored
migrate from poetry to uv (#215)
1 parent b296fea commit f1bbf81

File tree

10 files changed

+2164
-2010
lines changed

10 files changed

+2164
-2010
lines changed

.github/workflows/dev.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# The type of runner that the job will run on
2121
strategy:
2222
matrix:
23-
python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
23+
python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
2424
os: [ubuntu-latest]
2525
runs-on: ${{ matrix.os }}
2626

@@ -36,16 +36,16 @@ jobs:
3636
- name: Install dependencies
3737
run: |
3838
python -m pip install --upgrade pip
39-
pip install poetry tox tox-gh-actions
39+
pip install uv tox tox-gh-actions
4040
4141
- name: test with tox
4242
run:
4343
tox
4444

4545
- name: Build documentation
4646
run: |
47-
poetry install
48-
poetry run mkdocs build
47+
uv sync --group doc
48+
uv run mkdocs build
4949
5050
- name: list files
5151
run: ls -l .
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install dependencies
6464
run: |
6565
python -m pip install --upgrade pip
66-
pip install poetry tox tox-gh-actions
66+
pip install uv tox tox-gh-actions
6767
6868
- name: test with tox
6969
run:
@@ -81,9 +81,9 @@ jobs:
8181

8282
- name: Build wheels and source tarball
8383
run: |
84-
poetry version $(poetry version --short)-dev.$GITHUB_RUN_NUMBER
85-
poetry version --short
86-
poetry build
84+
uv version $(uv version --short)-dev.$GITHUB_RUN_NUMBER
85+
uv version --short
86+
uv build
8787
8888
- name: publish to Test PyPI
8989
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
python-versions: ['3.12']
25+
python-versions: ['3.13']
2626

2727
# Steps represent a sequence of tasks that will be executed as part of the job
2828
steps:
@@ -49,12 +49,12 @@ jobs:
4949
- name: Install dependencies
5050
run: |
5151
python -m pip install --upgrade pip
52-
pip install tox-gh-actions poetry
52+
pip install tox-gh-actions uv
5353
5454
- name: Build documentation
5555
run: |
56-
poetry install
57-
poetry run mkdocs build
56+
uv install
57+
uv run mkdocs build
5858
5959
- name: Publish documentation
6060
uses: peaceiris/actions-gh-pages@v4
@@ -64,7 +64,7 @@ jobs:
6464

6565
- name: Build wheels and source tarball
6666
run: >-
67-
poetry build
67+
uv build
6868
6969
- name: Show temporary files
7070
run: >-

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ repos:
1313
- id: python-use-type-annotations
1414
- id: text-unicode-replacement-char
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.12.12
16+
rev: v0.14.5
1717
hooks:
1818
- id: ruff-format
1919
- id: ruff-check
2020
args: [ --fix ]
2121
- id: ruff-format
2222
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v1.17.1
23+
rev: v1.18.2
2424
hooks:
2525
- id: mypy
2626
args:

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Ready to contribute? Here's how to set up `requests_oauth2client` for local deve
5353
2. Clone your fork locally
5454

5555
```
56-
$ git clone git@github.com:your_name_here/requests_oauth2client.git
56+
$ git clone https://github.com/<your_github_username_here>/requests_oauth2client.git
5757
```
5858

59-
3. Ensure [poetry](https://python-poetry.org/docs/) is installed.
59+
3. Ensure [uv](https://docs.astral.sh/uv/) is installed.
6060
4. Install dependencies and start your virtualenv:
6161

6262
```
63-
$ poetry install -E test -E doc -E dev
63+
$ uv sync --all-extras
6464
```
6565

6666
5. Create a branch for local development:
@@ -115,7 +115,7 @@ Make sure all your changes are committed (including an entry in HISTORY.md).
115115
Then run:
116116

117117
```
118-
$ poetry patch # possible: major / minor / patch
118+
$ uv version --bump path # possible: major / minor / patch
119119
$ git push
120120
$ git push --tags
121121
```

poetry.lock

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

pyproject.toml

Lines changed: 63 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,78 @@
1-
[tool]
2-
[tool.poetry]
1+
[project]
32
name = "requests_oauth2client"
4-
version = "1.7.1"
5-
homepage = "https://github.com/guillp/requests_oauth2client"
3+
version = "1.8.0"
64
description = "An OAuth2.x client based on `requests`."
7-
authors = ["Guillaume Pujol <guillp.dev@pm.me>"]
5+
authors = [{ name = "Guillaume Pujol", email = "guillp.dev@pm.me" }]
6+
requires-python = ">=3.9"
87
readme = "README.md"
98
license = "Apache-2.0"
109
classifiers = [
11-
'Development Status :: 4 - Beta',
12-
'Intended Audience :: Developers',
13-
'Topic :: Security',
14-
'License :: OSI Approved :: Apache Software License',
15-
'Programming Language :: Python :: 3',
16-
'Programming Language :: Python :: 3.9',
17-
'Programming Language :: Python :: 3.10',
18-
'Programming Language :: Python :: 3.11',
19-
'Programming Language :: Python :: 3.12',
20-
'Programming Language :: Python :: 3.13',
10+
"Development Status :: 4 - Beta",
11+
"Intended Audience :: Developers",
12+
"Topic :: Security",
13+
"License :: OSI Approved :: Apache Software License",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.9",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
2121
]
22-
packages = [
23-
{ include = "requests_oauth2client" },
24-
{ include = "tests", format = "sdist" },
22+
dependencies = [
23+
"requests>=2.32.5",
24+
"binapy>=0.8",
25+
"furl>=2.1.4",
26+
"jwskate>=0.12.2",
27+
"attrs>=25.3.0",
2528
]
2629

27-
[tool.poetry.dependencies]
28-
python = ">=3.9"
29-
30-
requests = ">=2.19.0"
31-
binapy = ">=0.8"
32-
furl = ">=2.1.2"
33-
jwskate = ">=0.11.1"
34-
attrs = ">=23.2.0"
35-
36-
37-
[tool.poetry.group.dev.dependencies]
38-
coverage = ">=7.8.0"
39-
flask = ">=3.0.3"
40-
livereload = ">=2.6.3"
41-
mypy = ">=1.8"
42-
mkdocs = ">=1.3.1"
43-
mkdocs-autorefs = ">=0.3.0"
44-
mkdocs-include-markdown-plugin = ">=6"
45-
mkdocs-material = ">=9.6.11"
46-
mkdocs-material-extensions = ">=1.0.1"
47-
mkdocstrings = { version = ">=0.29.1", extras = ["python"] }
48-
pre-commit = ">=3.5.0"
49-
pytest = ">=7.0.1"
50-
pytest-cov = ">=5.0.0"
51-
pytest-freezer = ">=0.4.8"
52-
pytest-mock = "^3.14.0"
53-
pytest-mypy = ">=1.0.0"
54-
requests-mock = ">=1.9.3"
55-
toml = ">=0.10.2"
56-
tox = ">=4"
57-
types-requests = ">=2.25.10"
58-
types-cryptography = ">=3.3.15"
59-
virtualenv = ">=20.30.0"
60-
pytest-examples = ">=0.0.17"
61-
62-
63-
[tool.poetry.extras]
64-
test = ["pytest", "pytest-cov"]
30+
[project.urls]
31+
Homepage = "https://github.com/guillp/requests_oauth2client"
32+
33+
[dependency-groups]
34+
dev = [
35+
"flask>=3.0.3",
36+
"livereload>=2.6.3",
37+
"mypy>=1.8",
38+
"pre-commit>=3.5.0",
39+
"toml>=0.10.2",
40+
"types-requests>=2.25.10",
41+
"types-cryptography>=3.3.15",
42+
"virtualenv>=20.30.0",
43+
]
6544
doc = [
66-
"mdformat",
67-
"mkdocs",
68-
"mkdocs-autorefs",
69-
"mkdocs-include-markdown-plugin",
70-
"mkdocs-material",
71-
"mkdocs-material-extensions",
72-
"mkdocstrings"
45+
"mkdocs>=1.3.1",
46+
"mkdocs-autorefs>=0.3.0",
47+
"mkdocs-include-markdown-plugin>=6",
48+
"mkdocs-material>=9.6.11",
49+
"mkdocs-material-extensions>=1.0.1",
50+
"mkdocstrings[python]>=0.29.1",
51+
]
52+
test = [
53+
"coverage>=7.8.0",
54+
"pytest>=7.0.1",
55+
"pytest-cov>=5.0.0",
56+
"pytest-examples>=0.0.17",
57+
"pytest-freezer>=0.4.8",
58+
"pytest-mock>=3.14.0,<4",
59+
"pytest-mypy>=1.0.0",
60+
"requests-mock>=1.9.3",
61+
"tox>=4",
62+
]
63+
64+
[tool.hatch.build.targets.sdist]
65+
include = [
66+
"requests_oauth2client",
67+
"tests",
7368
]
7469

70+
[tool.hatch.build.targets.wheel]
71+
include = ["requests_oauth2client"]
72+
7573
[build-system]
76-
requires = ["poetry-core>=1.0.0"]
77-
build-backend = "poetry.core.masonry.api"
74+
requires = ["hatchling"]
75+
build-backend = "hatchling.build"
7876

7977
[tool.coverage.run]
8078
source = ["requests_oauth2client"]
@@ -103,7 +101,6 @@ blank = true
103101
target-version = "py39"
104102
line-length = 120
105103

106-
107104
[tool.ruff.format]
108105
docstring-code-format = true
109106
line-ending = "lf"
@@ -142,7 +139,6 @@ warn_unused_configs = true
142139
warn_unused_ignores = true
143140
warn_redundant_casts = true
144141

145-
146142
[tool.pytest.ini_options]
147143
requests_mock_case_sensitive = true
148144
markers = [

requests_oauth2client/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class OAuth2Error(Exception):
1616
1717
Args:
1818
response: the HTTP response containing the error
19-
client : the OAuth2Client used to send the request
19+
client: the OAuth2Client used to send the request
2020
description: description of the error
2121
2222
"""

tests/test_deprecated_names.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""An attempt to use old class names should generate DeprecationWarning."""
2+
23
import secrets
34

45
import pytest

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ whitelist_externals =
1515
isort
1616
black
1717
flake8
18-
poetry
18+
uv
1919
mkdocs
2020
twine
2121
extras =
@@ -25,21 +25,21 @@ extras =
2525
commands =
2626
mdformat --wrap 120 README.md
2727
isort requests_oauth2client
28-
black requests_oauth2client tests
28+
ruff format requests_oauth2client tests
2929
flake8 requests_oauth2client tests
3030
mypy requests_oauth2client
31-
poetry build
31+
uv build
3232
mkdocs build
3333
twine check dist/*
3434

3535
[testenv]
3636
allowlist_externals =
37-
poetry
37+
uv
3838
commands_pre =
39-
poetry install --no-root --sync -E test
39+
uv sync --group test
4040
passenv = *
4141
setenv =
4242
PYTHONPATH = {toxinidir}
4343
PYTHONWARNINGS = ignore
4444
commands =
45-
poetry run pytest -s --cov=requests_oauth2client --cov-append --cov-report=xml --cov-report term-missing {posargs} tests
45+
uv run pytest -s --cov=requests_oauth2client --cov-append --cov-report=xml --cov-report term-missing {posargs} tests

0 commit comments

Comments
 (0)