Skip to content

Commit 3111bc9

Browse files
committed
Adjustments
1 parent dc623e8 commit 3111bc9

File tree

5 files changed

+59
-52
lines changed

5 files changed

+59
-52
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@ on: [push, pull_request]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
# Define the specific versions you want to test against
11+
python-version: ["3.10", "3.11", "3.12", "3.13"]
812
steps:
913
- uses: actions/checkout@v4
1014

1115
- name: Set up Python
1216
uses: actions/setup-python@v4
1317
with:
14-
python-version: "3.10"
18+
python-version: ${{ matrix.python-version }}
1519
cache: "pip"
1620

1721
- name: Install Dependencies
18-
# Installs the package in editable mode along with dev tools
1922
run: |
2023
pip install --upgrade pip
21-
pip install -e .[dev]
24+
# Install pinned dependencies first for reproducibility
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
# Install the project in editable mode + dev tools
27+
pip install -e ".[dev]"
2228
2329
- name: Lint & Format Check (Ruff)
2430
run: |
2531
ruff check .
2632
ruff format --check .
2733
34+
- name: Security (Bandit)
35+
run: |
36+
bandit -c pyproject.toml -r .
37+
2838
- name: Run Tests with Coverage
2939
# pytest will read config from pyproject.toml
3040
run: |

README.md

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,44 @@ Python Project Blueprint
66

77
Check the [Makefile](./Makefile) for automation as the initial step, it defines all project commands.
88

9-
Short summary of commands in a desired order of use.
9+
### Make Commands
10+
11+
| Make Command | Description |
12+
|:----------------------|:----------------------------------------------------------------------------------------|
13+
| `make venv` | Creates a virtual environment in `.venv`. |
14+
| `make lock` | Generates `requirements.txt` from `pyproject.toml` using `pip-compile`. |
15+
| `make upgrade` | Updates all packages in `requirements.txt` to the latest allowed versions. |
16+
| `make install` | Syncs the environment with locked dependencies and installs the app in editable mode. |
17+
| `make setup` | Installs dependencies and sets up git hooks (runs `install` and `pre-commit install`). |
18+
| `make outdated` | Checks for newer versions of dependencies using `pip-check-updates`. |
19+
| `make pip-upgrade` | Upgrades `pip` to its latest version. |
20+
| `make lint` | Checks code style using `ruff` without modifying files. |
21+
| `make format` | Automatically fixes code style issues using `ruff`. |
22+
| `make security` | Runs `bandit` to check for security vulnerabilities. |
23+
| `make test` | Runs unit and integration tests using `pytest` (also runs `security`). |
24+
| `make sbom` | Generates a Software Bill of Materials (SBOM) in `sbom.json`. |
25+
| `make audit` | Generates a security audit report in `audit.json`. |
26+
| `make build` | Creates distribution files (Wheel & Tarball) in `dist/`. |
27+
| `make publish` | Uploads artifacts to the repository using `twine`. |
28+
| `make docker-up` | Starts the application locally using `docker-compose`. |
29+
| `make docker-down` | Stops the application running via `docker-compose`. |
30+
| `make docker-build` | Builds the Docker image for the application. |
31+
| `make aws-login` | Authenticates Docker with AWS ECR. |
32+
| `make docker-publish` | Tags and pushes the Docker image to AWS ECR. |
33+
| `make docs` | Generates documentation from docstrings into the `docs/` directory. |
34+
| `make clean` | Removes build artifacts, caches, and generated files. |
35+
| `make all` | Runs the full development cycle: `lock`, `install`, `upgrade`, `lint`, `test`, `build`. |
36+
37+
The `make publish` require
1038

1139
```shell
12-
make venv # Create virtual environment (first step)
13-
14-
make install # Install dependencies (second step)
15-
make setup # Install dependencies and git hooks (runs install)
16-
17-
mske lock # Lock dependencies
18-
make upgrade # Upgrade dependencies
19-
make outdated # Check for outdated dependencies
20-
21-
make lint # Check the code style
22-
make format # Fix style issues
23-
make security # Check for security issues
24-
make test # Run tests
25-
26-
make sbom # Generate Software Bill of Materials - run it when dependencies change
27-
make audit # Run vulnerability audit - not tracked by Git
28-
29-
make build # Create distributable packages (artefacts)
30-
31-
make docker-build # Build Docker image
32-
make aws-login # Login to the ECR repository
33-
make docker-publish # Run Docker container
34-
make docker-up # Run the Docker container
35-
make docker-down # Stop Docker container and clean up
36-
37-
# Set repository access configurations
38-
# Alternative configuration is provided in the notes section
3940
export TWINE_USERNAME=your_ldap_user
4041
export TWINE_PASSWORD=your_ldap_password
4142
export TWINE_REPOSITORY_URL="https://nexus.mycompany.com/repository/pypi-internal/"
42-
make publish # Publish the artefacts
43-
44-
make clean # Remove all generated files
45-
make docs # Generate documentation - not tracked by Git
46-
47-
make all # In development (lock install upgrade lint test build)
4843
```
4944

45+
environment variables.
46+
5047
## Usage
5148

5249
Start the application

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "A production-ready Python project blueprint"
99
requires-python = ">=3.10"
1010
dependencies = [
1111
"httpx>=0.28.1",
12-
"fastapi>=0.129.0",
12+
"fastapi>=0.133.1",
1313
"uvicorn[standard]>=0.41.0"
1414
]
1515

@@ -21,11 +21,11 @@ dev = [
2121
"pytest>=9.0.2",
2222
"pytest-cov>=7.0.0",
2323
"pytest-mock>=3.15.1",
24-
"ruff>=0.15.1",
25-
"cyclonedx-bom>=7.2.1",
24+
"ruff>=0.15.4",
25+
"cyclonedx-bom>=7.2.2",
2626
"pip-audit>=2.10.0",
2727
"pdoc>=16.0.0",
28-
"bandit>=1.9.3",
28+
"bandit>=1.9.4",
2929
"pre-commit>=4.5.1",
3030
"pip-check-updates>=0.28.0",
3131
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ anyio==4.12.1
1313
# httpx
1414
# starlette
1515
# watchfiles
16-
certifi==2026.1.4
16+
certifi==2026.2.25
1717
# via
1818
# httpcore
1919
# httpx
2020
click==8.3.1
2121
# via uvicorn
22-
fastapi==0.129.0
22+
fastapi==0.133.1
2323
# via my-app (pyproject.toml)
2424
h11==0.16.0
2525
# via

sbom.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"bom-ref": "requirements-L16",
50-
"description": "requirements line 16: certifi==2026.1.4",
50+
"description": "requirements line 16: certifi==2026.2.25",
5151
"externalReferences": [
5252
{
5353
"comment": "implicit dist url",
@@ -56,9 +56,9 @@
5656
}
5757
],
5858
"name": "certifi",
59-
"purl": "pkg:pypi/certifi@2026.1.4",
59+
"purl": "pkg:pypi/certifi@2026.2.25",
6060
"type": "library",
61-
"version": "2026.1.4"
61+
"version": "2026.2.25"
6262
},
6363
{
6464
"bom-ref": "requirements-L20",
@@ -77,7 +77,7 @@
7777
},
7878
{
7979
"bom-ref": "requirements-L22",
80-
"description": "requirements line 22: fastapi==0.129.0",
80+
"description": "requirements line 22: fastapi==0.133.1",
8181
"externalReferences": [
8282
{
8383
"comment": "implicit dist url",
@@ -86,9 +86,9 @@
8686
}
8787
],
8888
"name": "fastapi",
89-
"purl": "pkg:pypi/fastapi@0.129.0",
89+
"purl": "pkg:pypi/fastapi@0.133.1",
9090
"type": "library",
91-
"version": "0.129.0"
91+
"version": "0.133.1"
9292
},
9393
{
9494
"bom-ref": "requirements-L24",
@@ -406,7 +406,7 @@
406406
}
407407
],
408408
"metadata": {
409-
"timestamp": "2026-02-17T23:27:51.185704+00:00",
409+
"timestamp": "2026-02-26T23:45:52.734310+00:00",
410410
"tools": {
411411
"components": [
412412
{
@@ -456,7 +456,7 @@
456456
],
457457
"name": "cyclonedx-py",
458458
"type": "application",
459-
"version": "7.2.1"
459+
"version": "7.2.2"
460460
},
461461
{
462462
"description": "Python library for CycloneDX",
@@ -510,7 +510,7 @@
510510
]
511511
}
512512
},
513-
"serialNumber": "urn:uuid:40a26945-26aa-49ff-9825-e93fa28c7d96",
513+
"serialNumber": "urn:uuid:0b90b493-fcf8-4060-88cf-3172d9b1e09c",
514514
"version": 1,
515515
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
516516
"bomFormat": "CycloneDX",

0 commit comments

Comments
 (0)