Skip to content

Commit 782ee33

Browse files
ci: install dev group and use project name to do smoke test after build
1 parent 635afa3 commit 782ee33

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
# Install the package with uv in system mode
3535
# This installs ruff and other tools defined in dependencies
36-
run: uv pip install --system .
36+
run: uv pip install --system . --group dev
3737

3838
- name: Run ruff check
3939
run: ruff check --config ./afterpython/ruff.toml .
@@ -189,9 +189,18 @@ jobs:
189189
run: uv pip install --system dist/*.whl
190190

191191
- name: Verify installation
192-
# Confirm the CLI entry point works
193-
# This ensures the package is usable after installation
194-
run: ap --help
192+
# Generic verification: assume project.name maps to import name
193+
# by replacing '-' with '_'. If a project breaks this rule, CI fails.
194+
run: |
195+
PROJECT_NAME="$(python - <<'PY'
196+
import tomllib
197+
with open("pyproject.toml", "rb") as f:
198+
data = tomllib.load(f)
199+
print(data["project"]["name"])
200+
PY
201+
)"
202+
IMPORT_NAME="${PROJECT_NAME//-/_}"
203+
python -c "import ${IMPORT_NAME}"
195204
196205
# Job 5: Type Check
197206
# typecheck:

src/afterpython/templates/ci-workflow-template.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
# Install the package with uv in system mode
3535
# This installs ruff and other tools defined in dependencies
36-
run: uv pip install --system .
36+
run: uv pip install --system . --group dev
3737

3838
- name: Run ruff check
3939
run: ruff check --config ./afterpython/ruff.toml .
@@ -189,9 +189,18 @@ jobs:
189189
run: uv pip install --system dist/*.whl
190190

191191
- name: Verify installation
192-
# Confirm the CLI entry point works
193-
# This ensures the package is usable after installation
194-
run: ap --help
192+
# Generic verification: assume project.name maps to import name
193+
# by replacing '-' with '_'. If a project breaks this rule, CI fails.
194+
run: |
195+
PROJECT_NAME="$(python - <<'PY'
196+
import tomllib
197+
with open("pyproject.toml", "rb") as f:
198+
data = tomllib.load(f)
199+
print(data["project"]["name"])
200+
PY
201+
)"
202+
IMPORT_NAME="${PROJECT_NAME//-/_}"
203+
python -c "import ${IMPORT_NAME}"
195204
196205
# Job 5: Type Check
197206
# typecheck:

0 commit comments

Comments
 (0)