Skip to content

Commit 495636e

Browse files
committed
poetry -> uv
1 parent 70629a0 commit 495636e

14 files changed

Lines changed: 640 additions & 84 deletions

File tree

.envrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -eo pipefail
44
shopt -s inherit_errexit
55

6-
watch_file venv/bin/activate
6+
watch_file .venv/bin/activate
77

8-
if [[ -f "venv/bin/activate" ]]; then
9-
source venv/bin/activate
8+
if [[ -f ".venv/bin/activate" ]]; then
9+
source .venv/bin/activate
1010
fi

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ jobs:
1616
]
1717
include:
1818
- python-version: '3.9'
19-
post-venv: 'venv/bin/pip install "urllib3<2" "requests<=2.30" "types-requests<=2.30"'
19+
post-venv: '.venv/bin/pip install "urllib3<2" "requests<=2.30" "types-requests<=2.30"'
2020
name: Python ${{ matrix.python-version }} ${{ matrix.post-venv }}
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
architecture: x64
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
2729
- run: make venv
2830
- if: ${{ matrix.post-venv }}
2931
run: ${{ matrix.post-venv }}
3032
- run: make test
31-
- run: make lint
33+
- run: make check
34+
- run: make format-check

Makefile

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
1-
venv: pyproject.toml poetry.lock venv-tools
2-
rm -rf venv
3-
python3 -m venv venv
4-
VIRTUAL_ENV=venv venv-tools/bin/poetry install
1+
DEFAULT_GOAL := ci
52

6-
venv-tools: requirements.tools.txt
7-
rm -rf venv-tools
8-
python3 -m venv venv-tools
9-
venv-tools/bin/pip install -r requirements.tools.txt
3+
.PHONY: ci
4+
ci: check format-check test
5+
6+
.PHONY: venv
7+
venv: .venv
8+
9+
.venv: uv.lock
10+
uv sync
1011

1112
.PHONY: clean
1213
clean:
13-
rm -rf venv
14-
rm -rf venv-tools
14+
rm -rf .venv
1515
rm -rf dist
1616

1717
.PHONY: test
1818
test: venv
19-
venv/bin/pytest -vv
20-
21-
.PHONY: build
22-
build: venv-tools
23-
rm -rf dist
24-
venv-tools/bin/poetry build
19+
uv run pytest
2520

2621
.PHONY: format
2722
format: venv-tools
28-
venv-tools/bin/ruff check --fix --unsafe-fixes
29-
venv-tools/bin/ruff format
23+
uv run ruff check --fix --unsafe-fixes
24+
uv run ruff format
3025

3126
.PHONY: format-check
3227
format-check: venv-tools
33-
venv-tools/bin/ruff check
34-
venv-tools/bin/ruff format --check
35-
36-
.PHONY: lint
37-
lint: mypy format-check
28+
uv run ruff check
29+
uv run ruff format --check
3830

39-
.PHONY: mypy
40-
mypy: venv
41-
venv/bin/mypy flareio tests
31+
.PHONY: check
32+
check: venv
33+
uv run mypy src/flareio tests

poetry.toml

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

pyproject.toml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
[tool.poetry]
1+
[project]
22
name = "flareio"
33
version = "1.2.0"
44
description = "Python SDK for the flare.io API."
5-
authors = ["Alexandre Viau <alexandre.viau@flare.io>"]
5+
authors = [
6+
{ name = "Alexandre Viau", email="alexandre.viau@flare.io>" }
7+
]
68
readme = "README.md"
79
repository = "https://github.com/Flared/python-flareio"
810
license = "MIT"
11+
requires-python = ">=3.9"
912
keywords = [
1013
"flare",
1114
"sdk",
@@ -24,19 +27,22 @@ packages = [
2427
{ include = "flareio" },
2528
]
2629

27-
[tool.poetry.dependencies]
30+
[dependencies]
2831
python = ">=3.8"
2932
requests = ">=2"
3033

3134
[build-system]
32-
requires = ["poetry-core"]
33-
build-backend = "poetry.core.masonry.api"
35+
requires = ["uv_build>=0.9.28,<0.10.0"]
36+
build-backend = "uv_build"
3437

35-
[tool.poetry.group.dev.dependencies]
36-
pytest = "8.3.2"
37-
mypy = "^1.11.1"
38-
requests-mock = "^1.12.1"
39-
types-requests = "^2.32.0.20240712"
38+
[dependency-groups]
39+
dev = [
40+
"pytest>=8.3.2",
41+
"mypy>=1.11.1",
42+
"ruff>=0.15.0",
43+
"requests-mock>=1.12.1",
44+
"types-requests>=2.32.0.20240712",
45+
]
4046

4147
[tool.ruff.lint]
4248
extend-select = [

requirements.tools.txt

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

0 commit comments

Comments
 (0)