Skip to content

Commit b9114a8

Browse files
committed
chore: upgraded project setup
1 parent e06bf48 commit b9114a8

9 files changed

Lines changed: 1026 additions & 540 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ jobs:
1212
- name: Install UV
1313
uses: astral-sh/setup-uv@v6
1414
with:
15-
python-version: 3.9
15+
python-version: "3.10"
1616
enable-cache: true
1717
- name: Install dependencies
1818
run: uv sync --locked --dev
1919
- name: Run linters
20-
run: uv run mypy ./src
20+
run: |
21+
uv run ruff check .
22+
uv run mypy .
23+
uv run ty check .
2124
- name: Run tests
2225
run: uv run pytest
2326

.github/workflows/upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install UV
1414
uses: astral-sh/setup-uv@v6
1515
with:
16-
python-version: 3.9
16+
python-version: "3.10"
1717
enable-cache: true
1818
- name: Install dependencies
1919
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ venv.bak/
116116

117117
# mypy
118118
.mypy_cache/
119+
120+
# ruff
121+
.ruff_cache/
119122
.dmypy.json
120123
dmypy.json
121124

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9
1+
3.10

justfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env just --justfile
22

3-
set quiet := true
3+
set quiet
44

55
# show help
66
help:
@@ -12,7 +12,7 @@ build:
1212

1313
# remove temp build files
1414
clean:
15-
rm -Rf dist/ .pytest_cache/ .mypy_cache/
15+
rm -Rf dist/ .pytest_cache/ .mypy_cache/ .ruff_cache/
1616

1717
# upload package to test repository
1818
publish-test:
@@ -28,8 +28,14 @@ sync:
2828

2929
# run unit tests
3030
test:
31-
uv run pytest -qv
31+
uv run pytest -qv --cov=openapi_parser --cov-report=term:skip-covered
32+
33+
# run package formatters
34+
fmt:
35+
uv run ruff format .
3236

3337
# run package linters
3438
lint:
35-
uv run mypy ./src
39+
uv run ruff check --fix .
40+
uv run mypy .
41+
uv run ty check .

license.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Artyom Manchenkov
3+
Copyright (c) 2020 Artem Manchenkov
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "OpenAPI v3 parser"
55
readme = "readme.md"
66
license = { file = "license.txt" }
77
authors = [{ name = "Artem Manchenkov", email = "artem@manchenkoff.me" }]
8+
requires-python = ">=3.10"
89
keywords = [
910
"swagger",
1011
"python",
@@ -15,29 +16,31 @@ keywords = [
1516
"swagger-api",
1617
]
1718
classifiers = [
18-
"Development Status :: 4 - Beta",
1919
"License :: OSI Approved :: MIT License",
2020
"Operating System :: OS Independent",
2121
"Intended Audience :: Developers",
22-
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
2323
"Topic :: Software Development :: Libraries",
2424
]
25-
requires-python = ">=3.9"
26-
dependencies = ["openapi-spec-validator>=0.7.2", "prance>=23.6.21.0"]
25+
dependencies = [
26+
"openapi-spec-validator>=0.8.5",
27+
"prance>=25.4.8.0",
28+
"ty>=0.0.37",
29+
]
2730

2831
[project.urls]
2932
homepage = "https://github.com/manchenkoff/openapi3-parser"
3033
source = "https://github.com/manchenkoff/openapi3-parser"
3134

3235
[dependency-groups]
33-
dev = ["mypy>=1.18.2", "pytest>=8.4.2"]
36+
dev = ["mypy>=2.1.0", "pytest>=9.0.3", "pytest-cov>=6.1.0", "ruff>=0.15.13", "ty>=0.0.37"]
3437

3538
[build-system]
36-
requires = ["setuptools>=61.0"]
37-
build-backend = "setuptools.build_meta"
39+
requires = ["uv_build>=0.11.12,<0.12"]
40+
build-backend = "uv_build"
3841

39-
[tool.setuptools.packages.find]
40-
where = ["src"]
42+
[tool.uv.build-backend]
43+
module-name = "openapi_parser"
4144

4245
[[tool.uv.index]]
4346
name = "testpypi"
@@ -46,26 +49,30 @@ publish-url = "https://test.pypi.org/legacy/"
4649
explicit = true
4750

4851
[tool.mypy]
49-
python_version = 3.9
52+
python_version = "3.10"
53+
strict = true
54+
mypy_path = ["src"]
5055

51-
check_untyped_defs = true
52-
follow_imports = "silent"
53-
no_implicit_reexport = true
54-
no_implicit_optional = true
56+
[[tool.mypy.overrides]]
57+
module = "tests.*"
5558

56-
strict_optional = true
57-
strict_equality = true
59+
[tool.ruff.lint]
60+
extend-select = [
61+
"D", # pydocstyle
62+
"UP", # pyupgrade
63+
"B", # flake8-bugbear
64+
"SIM", # flake8-simplify
65+
"I", # isort
66+
"ARG", # unused arguments
67+
"RUF100", # unused noqa
68+
]
5869

59-
ignore_missing_imports = true
60-
ignore_errors = false
70+
[tool.ruff.lint.pydocstyle]
71+
convention = "google"
6172

62-
disallow_any_generics = false
63-
disallow_untyped_defs = true
64-
disallow_untyped_calls = true
65-
disallow_untyped_decorators = true
73+
[tool.ruff.lint.per-file-ignores]
74+
"tests/**" = ["D", "ARG"]
6675

67-
warn_redundant_casts = true
68-
warn_unused_ignores = true
69-
warn_unused_configs = true
70-
warn_unreachable = true
71-
warn_no_return = true
76+
[tool.coverage.run]
77+
source = ["openapi_parser"]
78+
omit = ["tests/*"]

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pip install openapi3-parser
2828

2929
Example of parser usage
3030

31-
```
31+
```bash
3232
>>> from openapi_parser import parse
3333
>>> content = parse('swagger.yml')
3434
>>> print(content)

uv.lock

Lines changed: 970 additions & 503 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)