Skip to content

Commit d9eaa74

Browse files
committed
🎉 init project
0 parents  commit d9eaa74

File tree

6 files changed

+1160
-0
lines changed

6 files changed

+1160
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
12+
# IDE
13+
.idea
14+
.vscode
15+
16+
# Ignore generated clients in the examples directory
17+
examples/*/client/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

openapi_burrito/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import logging
2+
from importlib.metadata import version, PackageNotFoundError
3+
4+
# Swallow logs unless the user configures a handler
5+
logging.getLogger(__name__).addHandler(logging.NullHandler())
6+
7+
# Dynamic versioning
8+
try:
9+
__version__ = version("openapi-burrito")
10+
except PackageNotFoundError:
11+
__version__ = "0.0.0"
12+
13+
__all__ = ["__version__"]

pyproject.toml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[project]
2+
name = "openapi-burrito"
3+
version = "0.1.0"
4+
description = "A lightweight CLI tool to generate a type-safe Python client from an OpenAPI specification."
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
license = {text = "MIT"}
8+
authors = [
9+
{name = "Simon Lund", email = "simon.lund@lmu.de"}
10+
]
11+
keywords = [
12+
"openapi",
13+
"openapi-fetch",
14+
"swagger",
15+
"type-safe",
16+
"code-generation",
17+
"sdk-generator",
18+
"httpx",
19+
]
20+
classifiers = [
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
24+
"License :: OSI Approved :: MIT License",
25+
"Operating System :: OS Independent",
26+
"Intended Audience :: Developers",
27+
]
28+
29+
dependencies = [
30+
"httpx>=0.28.1",
31+
"jinja2>=3.1.6",
32+
"openapi-spec-validator>=0.7.2",
33+
"prance>=25.4.8.0",
34+
"pyyaml>=6.0.3",
35+
"typer>=0.12.0",
36+
]
37+
38+
[project.urls]
39+
Homepage = "https://github.com/simon-lund/openapi-burrito"
40+
Documentation = "https://github.com/simon-lund/openapi-burrito#readme"
41+
Repository = "https://github.com/simon-lund/openapi-burrito.git"
42+
Issues = "https://github.com/simon-lund/openapi-burrito/issues"
43+
44+
[project.scripts]
45+
# Run all quality checks
46+
check = { composite = ["lint", "typecheck", "test"] }
47+
# Linting and auto-fixing
48+
lint = "ruff check --fix ."
49+
# Type checking
50+
typecheck = "mypy ."
51+
# Testing with coverage
52+
test = "pytest --cov=openapi_burrito"
53+
# CLI entry point
54+
openapi-burrito = "openapi_burrito.cli:app"
55+
56+
[build-system]
57+
requires = ["hatchling"]
58+
build-backend = "hatchling.build"
59+
60+
# --- Build Configuration ---
61+
62+
[tool.hatch.build.targets.sdist]
63+
include = ["/openapi_burrito", "/README.md", "/LICENSE"]
64+
exclude = ["examples/", "tests/"]
65+
66+
[tool.hatch.build.targets.wheel]
67+
packages = ["openapi_burrito"]
68+
69+
# --- Tooling Configuration ---
70+
71+
[tool.ruff]
72+
line-length = 88
73+
target-version = "py312"
74+
75+
[tool.ruff.lint]
76+
select = ["E", "F", "I", "UP", "N"] # Error, Flake, Import sort, Upgrade, Naming
77+
fixable = ["ALL"]
78+
79+
[tool.mypy]
80+
python_version = "3.12"
81+
strict = true
82+
83+
# --- Dependency Groups ---
84+
85+
[dependency-groups]
86+
dev = [
87+
"mypy>=1.14.0",
88+
"ruff>=0.9.0",
89+
]
90+
test = [
91+
"pytest>=8.0.0",
92+
"pytest-cov>=4.1.0",
93+
"cattrs>=25.3.0",
94+
"respx>=0.21.0", # Great for mocking httpx calls in tests
95+
]

0 commit comments

Comments
 (0)