Commit ceec1745 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

Add Make target to build and publish package to PyPI

parent 6d927d45
Loading
Loading
Loading
Loading
+5 −2
Changes for Makefile: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ OSV_SCANNER ?= osv-scanner
TEST_ARGS ?= -q
CIRCE_ARGS ?=

.PHONY: help setup setup-prod lock lock-check deps-check build test test-live format format-check check serve workers run clean
.PHONY: help setup setup-prod lock lock-check deps-check build publish test test-live format format-check check serve workers run clean

help: ## Show available tasks and configuration
	@printf 'Usage: make <target>\n\n'
@@ -33,7 +33,10 @@ deps-check: lock-check ## Scan locked dependencies for vulnerabilities with OSV-
	"$(OSV_SCANNER)" scan source --lockfile=uv.lock

build: ## Build the source archive and wheel in dist/
	$(UV) build
	$(UV) build --clear

publish: build ## Build and upload the source archive and wheel to PyPI
	$(UV) publish

test: ## Run integration tests against an automatically managed temporary server
	$(UV) run --locked python scripts/run_tests.py $(TEST_ARGS)
+8 −1
Changes for README.md: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ uv doit être installé au préalable. Les principales commandes sont:
    make setup         # environnement de développement
    make setup-prod    # dépendances du service uniquement
    make build         # distributions source et wheel dans dist/
    make publish       # construction et publication sur PyPI
    make test          # tests avec un serveur temporaire isolé
    make check         # vérification du verrou, du formatage et tests
    make deps-check    # recherche de vulnérabilités dans les dépendances verrouillées
@@ -185,7 +186,13 @@ Pour ajouter une dépendance, utiliser `uv add nom-du-paquet` (ou `uv add --dev
pour le développement), puis versionner `pyproject.toml` et `uv.lock` ensemble.
Pour construire les distributions source et wheel dans `dist/`:

    uv build
    uv build --clear

La construction vide d'abord `dist/` pour supprimer les anciennes distributions.
Pour construire puis publier les distributions sur PyPI, fournir un jeton API PyPI
via la variable d'environnement `UV_PUBLISH_TOKEN`, puis lancer:

    make publish

### Variables d'environnement et configuration par défaut: