Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,41 @@
name: CI
on:
pull_request:
branches: [master]
branches: [main]
jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Git
- name: checkout
uses: actions/checkout@v6
- name: Install UV
- name: install uv
uses: astral-sh/setup-uv@v6
with:
python-version: 3.9
python-version: "3.10"
enable-cache: true
- name: Install dependencies
- name: dependencies
run: uv sync --locked --dev
- name: Run linters
run: uv run mypy ./src
- name: Run tests
- name: ruff
run: uv run ruff check .
- name: mypy
run: uv run mypy .
- name: ty
run: uv run ty check .
test:
name: test python ${{ matrix.python-version }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: dependencies
run: uv sync --locked --dev
- name: tests
run: uv run pytest

2 changes: 1 addition & 1 deletion .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install UV
uses: astral-sh/setup-uv@v6
with:
python-version: 3.9
python-version: "3.10"
enable-cache: true
- name: Install dependencies
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ venv.bak/

# mypy
.mypy_cache/

# ruff
.ruff_cache/
.dmypy.json
dmypy.json

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9
3.10
14 changes: 10 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env just --justfile

set quiet := true
set quiet

# show help
help:
Expand All @@ -12,7 +12,7 @@ build:

# remove temp build files
clean:
rm -Rf dist/ .pytest_cache/ .mypy_cache/
rm -Rf dist/ .pytest_cache/ .mypy_cache/ .ruff_cache/

# upload package to test repository
publish-test:
Expand All @@ -28,8 +28,14 @@ sync:

# run unit tests
test:
uv run pytest -qv
uv run pytest -qv --cov=openapi_parser --cov-report=term:skip-covered

# run package formatters
fmt:
uv run ruff format .

# run package linters
lint:
uv run mypy ./src
uv run ruff check --fix .
uv run mypy .
uv run ty check .
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Artyom Manchenkov
Copyright (c) 2020 Artem Manchenkov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
65 changes: 38 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "OpenAPI v3 parser"
readme = "readme.md"
license = { file = "license.txt" }
authors = [{ name = "Artem Manchenkov", email = "artem@manchenkoff.me" }]
requires-python = ">=3.10"
keywords = [
"swagger",
"python",
Expand All @@ -15,29 +16,30 @@ keywords = [
"swagger-api",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.9"
dependencies = ["openapi-spec-validator>=0.7.2", "prance>=23.6.21.0"]
dependencies = [
"openapi-spec-validator>=0.8.5",
"prance>=25.4.8.0",
]

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

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

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
requires = ["uv_build>=0.11.12,<0.12"]
build-backend = "uv_build"

[tool.setuptools.packages.find]
where = ["src"]
[tool.uv.build-backend]
module-name = "openapi_parser"

[[tool.uv.index]]
name = "testpypi"
Expand All @@ -46,26 +48,35 @@ publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.mypy]
python_version = 3.9

check_untyped_defs = true
follow_imports = "silent"
no_implicit_reexport = true
no_implicit_optional = true
python_version = "3.10"
strict = true
mypy_path = ["src"]

strict_optional = true
strict_equality = true
[[tool.mypy.overrides]]
module = "tests.*"

[[tool.mypy.overrides]]
module = "prance"
ignore_missing_imports = true
ignore_errors = false

disallow_any_generics = false
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
[tool.ruff.lint]
extend-select = [
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
"ARG", # unused arguments
"RUF100", # unused noqa
"TID252", # ban relative imports
]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D", "ARG"]

warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
warn_unreachable = true
warn_no_return = true
[tool.coverage.run]
source = ["openapi_parser"]
omit = ["tests/*"]
Loading
Loading