Skip to content

Commit 5b0b7dc

Browse files
authored
Merge pull request #17 from community-of-python/16-migrate-to-uv-and-community-workflow
migrate to uv
2 parents fb21f04 + 2400309 commit 5b0b7dc

File tree

7 files changed

+63
-1578
lines changed

7 files changed

+63
-1578
lines changed

.github/dependabot.yml

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

.github/workflows/workflow.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ on:
1313

1414
jobs:
1515
ci:
16-
uses: community-of-python/community-workflow/.github/workflows/preset.yml@main
16+
uses: community-of-python/community-workflow/.github/workflows/preset_uv.yml@main
17+
with:
18+
python-version: '["3.9","3.10","3.11","3.12","3.13"]'
1719
secrets: inherit

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
__pycache__
2-
.coverage*
2+
.coverage
33
.mypy_cache
44
.pytest_cache
55
.venv
66
.vscode
77
dist
8+
.idea
9+
.python-version
10+
uv.lock

.pre-commit-config.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
repos:
2-
- repo: https://github.com/pre-commit/mirrors-mypy
3-
rev: v1.10.1
2+
- repo: local
43
hooks:
5-
- id: mypy
6-
name: mypy
7-
always_run: true
8-
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.5.0
4+
- id: lint
5+
name: lint
6+
entry: just
7+
args: [lint]
8+
language: system
9+
types: [python]
10+
pass_filenames: false
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v5.0.0
1013
hooks:
11-
- id: ruff
12-
name: ruff-check
13-
always_run: true
14-
args: [--fix]
15-
- id: ruff-format
16-
name: ruff-format
17-
always_run: true
14+
- id: end-of-file-fixer
15+
- id: mixed-line-ending

Justfile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
default: install lint check-types test
1+
default: install lint test
22

33
install:
4-
poetry install
4+
uv lock --upgrade
5+
uv sync --frozen
56

67
lint:
7-
poetry run ruff check .
8-
poetry run ruff format .
8+
uv run ruff format
9+
uv run ruff check --fix
10+
uv run mypy .
911

10-
check-types:
11-
poetry run mypy .
12+
lint-ci:
13+
uv run ruff format --check
14+
uv run ruff check --no-fix
15+
uv run mypy .
1216

1317
test *args:
14-
poetry run pytest {{args}}
18+
uv run --no-sync pytest {{ args }}
19+
20+
publish:
21+
rm -rf dist
22+
uv build
23+
uv publish --token $PYPI_TOKEN
24+
25+
hook:
26+
uv run pre-commit install
27+
28+
unhook:
29+
uv run pre-commit uninstall

poetry.lock

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

pyproject.toml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
1-
[tool.poetry]
1+
[project]
22
name = "litestar-offline-docs"
3-
version = "1.0.1"
43
description = "Offline API docs for Litestar"
5-
authors = ["community-of-python"]
4+
authors = [{ name = "community-of-python" }]
65
readme = "README.md"
7-
packages = [{ include = "litestar_offline_docs" }]
8-
include = [{ path = "static/*.*" }]
9-
10-
[tool.poetry.dependencies]
11-
python = "^3.9"
12-
litestar = { version = "^2.9.1", extras = ["standard"] }
6+
requires-python = ">=3.9,<4"
7+
dynamic = ["version"]
8+
dependencies = [
9+
"litestar>=2.9.1",
10+
]
1311

14-
[tool.poetry.group.dev.dependencies]
15-
pytest = "^8.2.2"
16-
pytest-cov = "^5.0.0"
17-
anyio = "^4.4.0"
18-
pre-commit = "^3.5.0"
19-
pytest-xdist = "^3.6.1"
20-
ruff = "^0.7.1"
21-
mypy = "^1.13.0"
12+
[dependency-groups]
13+
dev = [
14+
"anyio>=4.4.0",
15+
"mypy>=1.13.0",
16+
"pre-commit>=3.5.0",
17+
"pytest>=8.2.2",
18+
"pytest-cov>=5.0.0",
19+
"pytest-xdist>=3.6.1",
20+
"ruff>=0.7.1",
21+
]
2222

2323
[build-system]
24-
requires = ["poetry-core"]
25-
build-backend = "poetry.core.masonry.api"
24+
requires = ["hatchling", "hatch-vcs"]
25+
build-backend = "hatchling.build"
26+
27+
[tool.hatch.version]
28+
source = "vcs"
2629

2730
[tool.mypy]
2831
files = ["litestar_offline_docs", "tests"]
2932
python_version = "3.9"
3033
strict = true
31-
ignore_missing_imports = true
3234
pretty = true
3335
show_error_codes = true
34-
implicit_reexport = true
35-
warn_unused_ignores = false
36-
warn_return_any = false
37-
namespace_packages = true
38-
disable_error_code = "attr-defined,valid-type"
39-
disallow_subclassing_any = false
40-
disallow_untyped_decorators = false
4136

4237
[tool.ruff]
4338
target-version = "py39"
@@ -58,16 +53,12 @@ ignore = [
5853
"D213",
5954
"G004",
6055
"FA",
61-
"ANN101",
62-
"ANN102",
6356
"COM812",
6457
"ISC001",
6558
]
6659

6760
[tool.ruff.lint.isort]
6861
no-lines-before = ["standard-library", "local-folder"]
69-
known-third-party = []
70-
known-local-folder = []
7162
lines-after-imports = 2
7263

7364
[tool.ruff.lint.extend-per-file-ignores]

0 commit comments

Comments
 (0)