Skip to content

Commit 09042bb

Browse files
committed
uv: switch from poetry
1 parent 5156cee commit 09042bb

File tree

4 files changed

+57
-65
lines changed

4 files changed

+57
-65
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
python-version: "3.10"
1616
- run: pip install wheel
17-
- run: pip install "tox>=4" "poetry>=1.2"
17+
- run: pip install "tox>=4" "uv>=0.5"
1818
- run: tox -e lint
1919
mypy:
2020
runs-on: ubuntu-latest
@@ -24,5 +24,5 @@ jobs:
2424
with:
2525
python-version: "3.10"
2626
- run: pip install wheel
27-
- run: pip install "tox>=4" "poetry>=1.2"
27+
- run: pip install "tox>=4" "uv>=0.5"
2828
- run: tox -e mypy

CONTRIBUTING.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
## Setup
44

55
To get started developing `boostedblob`:
6-
- Install [poetry](https://python-poetry.org/)
7-
- https://github.com/python-poetry/poetry#installation
8-
- Alternatively, `pipx install poetry` works well
9-
- If you've already installed poetry, make sure you're using poetry 1.2 or newer
10-
- Run `poetry install`, to create a virtualenv with all the dependencies you need
11-
- Run `poetry shell` to get a shell with the virtualenv activated
6+
- Install [uv](https://docs.astral.sh/uv/)
7+
- Run `uv sync`
128

139
## Running tests
1410

pyproject.toml

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
[project]
2+
name = "boostedblob"
3+
version = "0.15.6"
4+
description = "Command line tool and async library to perform basic file operations on local paths, Google Cloud Storage paths and Azure Blob Storage paths."
5+
authors = [{ name = "Shantanu Jain", email = "[email protected]" }]
6+
requires-python = ">=3.8"
7+
readme = "README.md"
8+
license = "MIT"
9+
dependencies = [
10+
"aiohttp>=3.7.2",
11+
"lxml>=4.9.1",
12+
"pycryptodomex>=3.9",
13+
"uvloop>=0.16.0 ; sys_platform != 'win32'",
14+
]
15+
16+
[project.scripts]
17+
bbb = "boostedblob.__main__:main"
18+
19+
[dependency-groups]
20+
test = [
21+
"pytest>=7.2.0",
22+
"pytest-asyncio>=0.20.1",
23+
"pytest-cov>=4.0.0",
24+
"blobfile>=2.0.0",
25+
"urllib3",
26+
"filelock",
27+
]
28+
lint = [
29+
"ipdb",
30+
"black>=24.2.0,<25",
31+
"isort>=5.11.1,<6",
32+
"ruff>=0.2.2,<0.3",
33+
]
34+
type = ["mypy==1.8.0"]
35+
36+
[build-system]
37+
requires = ["flit_core>=3.4"]
38+
build-backend = "flit_core.buildapi"
39+
140
[tool.black]
241
line-length = 100
342
skip-magic-trailing-comma = true
@@ -38,48 +77,3 @@ follow_imports = "skip"
3877
[tool.ruff.lint]
3978
select = ["E", "F", "W", "B", "C4", "PIE", "PLE"]
4079
ignore = ["E2", "E501", "E741", "C408", "PIE790"]
41-
42-
[tool.poetry]
43-
name = "boostedblob"
44-
version = "0.15.6"
45-
description = """
46-
Command line tool and async library to perform basic file operations on local \
47-
paths, Google Cloud Storage paths and Azure Blob Storage paths.\
48-
"""
49-
authors = ["Shantanu Jain <[email protected]>"]
50-
license = "MIT"
51-
readme = "README.md"
52-
include = ["boostedblob/py.typed"]
53-
54-
[tool.poetry.dependencies]
55-
python = ">=3.8"
56-
aiohttp = ">=3.7.2"
57-
lxml = ">=4.9.1"
58-
pycryptodomex = ">=3.9"
59-
# uvloop is not strictly necessary
60-
uvloop = { version = ">=0.16.0", markers = "sys_platform != 'win32'" }
61-
62-
[tool.poetry.group.test.dependencies]
63-
pytest = ">=7.2.0"
64-
pytest-asyncio = ">=0.20.1"
65-
pytest-cov = ">=4.0.0"
66-
blobfile = ">=2.0.0"
67-
# poetry fails to resolve blobfile's dependencies
68-
urllib3 = "*"
69-
filelock = "*"
70-
71-
[tool.poetry.group.lint.dependencies]
72-
ipdb = "*"
73-
black = ">=24.2.0,<25"
74-
isort = "^5.11.1"
75-
ruff = "^0.2.2"
76-
77-
[tool.poetry.group.type.dependencies]
78-
mypy = "==1.8.0"
79-
80-
[tool.poetry.scripts]
81-
bbb = 'boostedblob.__main__:main'
82-
83-
[build-system]
84-
requires = ["poetry-core>=1.1"]
85-
build-backend = "poetry.core.masonry.api"

tox.ini

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
[tox]
22
minversion = 4.4.4
33
skipsdist = True
4-
envlist = py37, py38, py39, py310, lint, mypy
4+
envlist = py37, py38, py39, py310, lint, mypy, test
55

66
[testenv]
77
setenv = BBB_TEST_LOCATIONS = {env:BBB_TEST_LOCATIONS:az://shantanutest/container}
8-
allowlist_externals = bash
8+
allowlist_externals =
9+
bash
10+
uv
911
commands_pre =
10-
bash -c 'poetry lock && poetry export --with test --without-hashes -f requirements.txt | pip install --quiet --no-deps -r /dev/stdin'
12+
uv sync --group test
1113
commands =
12-
pytest --cov=boostedblob {posargs}
13-
coverage html
14+
uv run pytest --cov=boostedblob {posargs}
15+
uv run coverage html
1416

1517
[testenv:lint]
1618
commands_pre =
17-
bash -c 'poetry lock && poetry export --with lint --without-hashes -f requirements.txt | pip install --quiet --no-deps -r /dev/stdin'
19+
uv sync --group lint
1820
commands =
19-
ruff check .
20-
black --diff --check --quiet .
21-
isort --diff --check --quiet .
21+
uv run ruff check .
22+
uv run black --diff --check --quiet .
23+
uv run isort --diff --check --quiet .
2224

2325
[testenv:mypy]
2426
commands_pre =
25-
bash -c 'poetry lock && poetry export --with test --with type --without-hashes -f requirements.txt | pip install --quiet --no-deps -r /dev/stdin'
27+
uv sync --group test --group type
2628
commands =
27-
mypy boostedblob
28-
mypy tests --disable-error-code var-annotated
29+
uv run mypy boostedblob
30+
uv run mypy tests --disable-error-code var-annotated

0 commit comments

Comments
 (0)