Skip to content

Commit 356275d

Browse files
committed
refactor: ♻️ update config for non-template package
1 parent f5ef33f commit 356275d

File tree

6 files changed

+16
-111
lines changed

6 files changed

+16
-111
lines changed

.github/workflows/build-website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions: read-all
1010

1111
jobs:
1212
build-website:
13-
uses: seedcase-project/.github/.github/workflows/reusable-build-docs-with-python.yml@main
13+
uses: seedcase-project/.github/.github/workflows/reusable-build-docs.yml@main
1414
secrets:
1515
netlify-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
1616
# This is to allow using `gh` CLI

.gitignore

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,41 +26,6 @@ venv
2626
__pycache__/
2727
*.py[cod]
2828

29-
# Python packaging and distribution
30-
.Python
31-
build/
32-
develop-eggs/
33-
dist/
34-
downloads/
35-
eggs/
36-
.eggs/
37-
lib/
38-
lib64/
39-
parts/
40-
sdist/
41-
var/
42-
wheels/
43-
share/python-wheels/
44-
*.egg-info/
45-
.installed.cfg
46-
*.egg
47-
MANIFEST
48-
49-
# Python testing and code coverage
50-
htmlcov/
51-
.tox/
52-
.nox/
53-
.coverage
54-
.coverage.*
55-
coverage.*
56-
.cache
57-
nosetests.xml
58-
*.cover
59-
*.py,cover
60-
.hypothesis/
61-
.pytest_cache/
62-
cover/
63-
6429
# MacOS
6530
.DS_Store
6631

.vscode/extensions.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
"felipecaputo.git-project-manager",
88
"GitHub.vscode-pull-request-github",
99
"ms-python.python",
10-
"ms-python.vscode-pylance",
11-
"matangover.mypy",
12-
"njpwerner.autodocstring",
1310
"quarto.quarto",
1411
"ms-toolsai.jupyter",
1512
"vivaxy.vscode-conventional-commits",
16-
"charliermarsh.ruff",
1713
"pshaddel.conventional-branch",
1814
"tekumara.typos-vscode",
1915
"EditorConfig.EditorConfig"

.vscode/settings.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"[quarto][qmd]": {
2727
"editor.formatOnSave": false
2828
},
29-
"[python]": {
30-
"editor.defaultFormatter": "charliermarsh.ruff"
31-
},
3229
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
3330
"python.languageServer": "Pylance",
3431
"files.insertFinalNewline": true,
35-
"python.testing.pytestEnabled": true,
36-
"python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest",
37-
"mypy.runUsingActiveInterpreter": true,
32+
"files.associations": {
33+
"*.yml.jinja": "jinja-yaml",
34+
"*.cff.jinja": "jinja-yaml",
35+
"*.toml.jinja": "jinja-toml",
36+
"*.qmd.jinja": "jinja-md"
37+
},
3838
}

_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
netlify:
33
# TODO: Include correct ID
44
- id: ""
5-
url: "https://NAME-seedcase-project.netlify.app"
5+
url: "https://seedcase-template-python-package.netlify.app"

justfile

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
just --list --unsorted
33

44
# Run all build-related recipes in the justfile
5-
run-all: install-deps format-python check-python check-unused test-python check-security check-spelling check-commits build-website
5+
run-all: check-spelling check-commits build-website
66

77
# Install the pre-commit hooks
88
install-precommit:
@@ -13,78 +13,22 @@ install-precommit:
1313
# Update versions of pre-commit hooks
1414
uvx pre-commit autoupdate
1515

16-
# Install Python package dependencies
17-
install-deps:
18-
uv sync --all-extras --dev
19-
20-
# Run the Python tests
21-
test-python:
22-
uv run pytest
23-
# Make the badge from the coverage report
24-
uv run genbadge coverage \
25-
-i coverage.xml \
26-
-o htmlcov/coverage.svg
27-
28-
# Check Python code for any errors that need manual attention
29-
check-python:
30-
# Check formatting
31-
uv run ruff check .
32-
# Check types
33-
uv run mypy .
34-
35-
# Reformat Python code to match coding style and general structure
36-
format-python:
37-
uv run ruff check --fix .
38-
uv run ruff format .
39-
40-
# Build the documentation website using Quarto
41-
build-website:
42-
# To let Quarto know where python is.
43-
export QUARTO_PYTHON=.venv/bin/python3
44-
# Delete any previously built files from quartodoc.
45-
# -f is to not give an error if the files don't exist yet.
46-
rm -f docs/reference/*.qmd
47-
uv run quartodoc build
48-
uv run quarto render --execute
49-
50-
# Run checks on commits with non-main branches
16+
# Check the commit messages on the current branch that are not on the main branch
5117
check-commits:
5218
#!/bin/zsh
5319
branch_name=$(git rev-parse --abbrev-ref HEAD)
5420
number_of_commits=$(git rev-list --count HEAD ^main)
5521
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
5622
then
57-
uv run cz check --rev-range main..HEAD
23+
uvx --from commitizen cz check --rev-range main..HEAD
5824
else
59-
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
25+
echo "On `main` or current branch doesn't have any commits."
6026
fi
6127

62-
# Run basic security checks on the package
63-
check-security:
64-
uv run bandit -r src/
65-
6628
# Check for spelling errors in files
6729
check-spelling:
68-
uv run typos
30+
uvx typos
6931

70-
# Build the documentation as PDF using Quarto
71-
build-pdf:
72-
# To let Quarto know where python is.
73-
export QUARTO_PYTHON=.venv/bin/python3
74-
uv run quarto install tinytex
75-
# For generating images from Mermaid diagrams
76-
uv run quarto install chromium
77-
uv run quarto render --profile pdf --to pdf
78-
find docs -name "mermaid-figure-*.png" -delete
79-
80-
# Check for unused code in the package and its tests
81-
check-unused:
82-
# exit code=0: No unused code was found
83-
# exit code=3: Unused code was found
84-
# Three confidence values:
85-
# - 100 %: function/method/class argument, unreachable code
86-
# - 90 %: import
87-
# - 60 %: attribute, class, function, method, property, variable
88-
# There are some things should be ignored though, with the allowlist.
89-
# Create an allowlist with `vulture --make-allowlist`
90-
uv run vulture src/ tests/ **/vulture-allowlist.py
32+
# Build the website using Quarto
33+
build-website:
34+
uvx --from quarto quarto render

0 commit comments

Comments
 (0)