Skip to content

Commit 1923557

Browse files
committed
Using uv
1 parent c29165d commit 1923557

File tree

12 files changed

+1813
-62
lines changed

12 files changed

+1813
-62
lines changed

.idea/copyright/profiles_settings.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/mrmat-python-api-fastapi.iml

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

.idea/runConfigurations/build.xml

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

.idea/runConfigurations/run.xml

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

.idea/runConfigurations/test.xml

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

.idea/vcs.xml

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

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@ Boilerplate (and playground) for a code-first Python FastAPI API.
66

77
## How to build this
88

9-
Create a virtual environment, then:
9+
### Interactively
1010

11-
```shell
12-
(venv) $ pip install -r requirements.txt
13-
(venv) $ python -m build -n --wheel
14-
```
11+
The project uses the [uv build tool](https://docs.astral.sh/uv/). Install it first, then simply run `uv build --wheel`.
1512

16-
If you intend to run the testsuite or work on the code, then also install the requirements from `requirements.dev.txt`. You can run the testsuite using
13+
All interactive builds default their version to '0.0.0.dev0', which we use as a marker that this is a locally produced
14+
build which should not go into production. You can override this behaviour by setting the 'MRMAT_VERSION' environment
15+
variable to the desired version, but doing so is discouraged.
1716

18-
```shell
19-
(venv) $ PYTHONPATH=src pytest tests
20-
```
17+
### Continuous Integration
18+
19+
GitHub Actions will trigger builds for pushes and pull requests. A merge push onto the main branch will additionally
20+
create a release.
21+
22+
All builds on branches other than main will have their version calculated from the MAJOR, MINOR and GITHUB_RUN_NUMBER
23+
environment variables with a '.dev0' suffix appended. You can set the MAJOR and MINOR variables in
24+
`.github/workflows/build.yml`. Builds resulting from a merge push onto the main branch will not have a suffix.
25+
26+
The resulting code is aware of its version at build-time via the extra `src/ci` module, which is explicitly excluded from
27+
the distribution. Pythons own `importlib.metadata` is then used to make the version available at runtime.
2128

22-
The resulting wheel is installable and knows its runtime dependencies. Any locally produced wheel will have version 0.0.0.dev0. This is intentional to distinguish local versions from those that are produced as releases in GitHub. You can override this behaviour by setting the `MRMAT_VERSION` environment variable to the desired version.
29+
### Container Image
2330

2431
You can produce a container image and associated Helm chart using the provided Makefile:
2532

pyproject.toml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = [
3-
'setuptools==78.1.1',
3+
'setuptools==80.9.0',
4+
'build==1.3.0',
45
'wheel==0.45.1'
56
]
67
build-backend = 'setuptools.build_meta'
@@ -23,12 +24,47 @@ classifiers = [
2324
"Programming Language :: Python :: 3.13"
2425
]
2526
requires-python = ">=3.13"
26-
dynamic = ["version", "dependencies", "optional-dependencies"]
27+
dynamic = ["version"]
28+
dependencies = [
29+
"fastapi[standard]==0.119.0",
30+
"sqlalchemy[asyncio]==2.0.44",
31+
"uvicorn==0.37.0",
32+
"pydantic==2.12.2",
33+
"psycopg2-binary==2.9.11",
34+
"prometheus-fastapi-instrumentator==7.1.0",
35+
"opentelemetry-distro",
36+
"opentelemetry-exporter-otlp==1.38.0",
37+
"opentelemetry-instrumentation-asyncio==0.59b0",
38+
"opentelemetry-instrumentation-dbapi==0.59b0",
39+
"opentelemetry-instrumentation-logging==0.59b0",
40+
"opentelemetry-instrumentation-sqlite3==0.59b0",
41+
"opentelemetry-instrumentation-threading==0.59b0",
42+
"opentelemetry-instrumentation-urllib==0.59b0",
43+
"opentelemetry-instrumentation-wsgi==0.59b0",
44+
"opentelemetry-instrumentation-asgi==0.59b0",
45+
"opentelemetry-instrumentation-click==0.59b0",
46+
"opentelemetry-instrumentation-fastapi==0.59b0",
47+
"opentelemetry-instrumentation-grpc==0.59b0",
48+
"opentelemetry-instrumentation-httpx==0.59b0",
49+
"opentelemetry-instrumentation-requests==0.59b0",
50+
"opentelemetry-instrumentation-sqlalchemy==0.59b0",
51+
"opentelemetry-instrumentation-starlette==0.59b0",
52+
"opentelemetry-instrumentation-tortoiseorm==0.59b0",
53+
"opentelemetry-instrumentation-urllib3==0.59b0",
54+
"types-pyyaml==6.0.12.20250915",
55+
]
56+
[dependency-groups]
57+
dev = [
58+
"pytest==8.4.2",
59+
"pytest-cov==7.0.0",
60+
"mypy==1.18.2",
61+
"types-PyYAML==6.0.12.20250915",
62+
"httpx==0.28.1",
63+
"black>=25.9.0",
64+
]
2765

2866
[tool.setuptools.dynamic]
2967
version = { attr = "ci.version"}
30-
dependencies = {file = ["requirements.txt"]}
31-
optional-dependencies = { dev = {file = ["requirements.dev.txt"] } }
3268

3369
[tool.setuptools.packages.find]
3470
where = ["src"]

requirements.dev.txt

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

0 commit comments

Comments
 (0)