diff --git a/.cz.toml b/.cz.toml index 0394a9a..5de657e 100644 --- a/.cz.toml +++ b/.cz.toml @@ -1,5 +1,5 @@ [tool.commitizen] -bump_message = "build(version): update version from $current_version to $new_version [skip ci]" +bump_message = "build(version): :bookmark: update version from $current_version to $new_version [skip ci]" update_changelog_on_bump = true version_provider = "poetry" version_files = [ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0385ab2..2c9b346 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,6 @@ repos: - id: end-of-file-fixer - repo: https://github.com/commitizen-tools/commitizen - rev: v4.1.0 + rev: v4.2.1 hooks: - id: commitizen diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 17d7aa4..10535a9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,6 @@ // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp // List of extensions which should be recommended for users of this workspace. "recommendations": [ - "jebbs.plantuml", "donjayamanne.githistory", "felipecaputo.git-project-manager", "GitHub.vscode-pull-request-github", diff --git a/.vscode/settings.json b/.vscode/settings.json index f006005..491bd60 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,9 +32,9 @@ "python.defaultInterpreterPath": "${workspaceFolder}/.venv", "python.languageServer": "Pylance", "files.insertFinalNewline": true, - "cSpell.enableFiletypes": [ - "quarto" - ], + "cSpell.enabledFileTypes": { + "quarto": true + }, "cSpell.language": "en,en-GB", "python.testing.pytestEnabled": true, "python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest", diff --git a/LICENSE.md b/LICENSE.md index 740f93f..aeed825 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # MIT License -Copyright (c) 2023-2024 Aarhus University +Copyright (c) 2023-2025 Aarhus University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d07ae2e..448872f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Template for Seedcase Python projects +# Template for Seedcase Python packages -This repository contains a template for setting up new Python (with Django) projects in Seedcase. The first step is to create a new repository using this template. This can easily be done by clicking the "Use this template" button on the repository page or by using the GitHub CLI: +This repository contains a template for setting up new Python package projects in Seedcase. The first step is to create a new repository using this template. This can easily be done by clicking the "Use this template" button on the repository page or by using the GitHub CLI: ``` bash # NAME is the name to give the new repository @@ -18,8 +18,6 @@ poetry init Search for `NAME` and `REPO` and replace them with the name of your project and the repository name. Then look for any `TODO` items. -You will need to set up Fly manually for now. - ## Setting things up Use the commands found in [`spaid`](https://github.com/seedcase-project/spaid) repo to run the next setup steps. diff --git a/index.qmd b/index.qmd index f667600..3d0f710 100644 --- a/index.qmd +++ b/index.qmd @@ -1,5 +1,5 @@ --- -title: "Welcome to Seedcase Sprout!" +title: "Welcome to NAME!" --- {{< include /docs/includes/_wip.qmd >}} diff --git a/justfile b/justfile index 98391bb..e297400 100644 --- a/justfile +++ b/justfile @@ -8,14 +8,6 @@ run-all: install-deps format-python check-python test-python check-commits build install-deps: poetry install -# Generate SVG images from all PlantUML files -generate-puml-all: - docker run --rm -v $(pwd):/puml -w /puml ghcr.io/plantuml/plantuml:latest -tsvg "**/*.puml" - -# Generate SVG image from specific PlantUML file -generate-puml name: - docker run --rm -v $(pwd):/puml -w /puml ghcr.io/plantuml/plantuml:latest -tsvg "**/{{name}}.puml" - # Run the Python tests test-python: poetry run pytest @@ -39,7 +31,11 @@ build-website: # Run checks on commits with non-main branches check-commits: #!/bin/zsh - if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]] + branch_name=$(git rev-parse --abbrev-ref HEAD) + number_of_commits=$(git rev-list --count HEAD ^$branch_name) + if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]] then poetry run cz check --rev-range main..HEAD + else + echo "Not on main or haven't committed yet." fi diff --git a/pyproject.toml b/pyproject.toml index 363b80f..db412f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "NAME" +name = "template-python-package" version = "0.0.1" description = "" authors = [ @@ -18,7 +18,6 @@ readme = "README.md" homepage = "https://NAME.seedcase-project.org" repository = "https://github.com/seedcase-project/REPO" license = "MIT" -packages = [{include = "NAME"}] [tool.poetry.urls] "Bug Tracker" = "https://github.com/seedcase-project/REPO/issues" @@ -35,3 +34,11 @@ ruff = "^0.6.2" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +addopts = [ + # A short traceback mode to make it easier to view + "--tb=short", + # Use the package in `src/` + "--import-mode=importlib", +] diff --git a/ruff.toml b/ruff.toml index 90a4c9e..9171953 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ -# Support Python 3.10+ -target-version = "py310" +# Support Python 3.12+ +target-version = "py312" # In addition to the default formatters/linters, add these as well. [lint] diff --git a/src/PACKAGE-NAME/__init__.py b/src/PACKAGE-NAME/__init__.py new file mode 100644 index 0000000..e69de29