diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 02b3cc1..a2f520b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ on: paths: - .github/workflows/docs.yaml - docs/** - - wizard_template/** + - src/wizard_template/** - pyproject.toml jobs: diff --git a/README.md b/README.md index cc40429..417ddb7 100644 --- a/README.md +++ b/README.md @@ -111,32 +111,31 @@ $ hatch env show --ascii codespell................................................................Passed mdformat.................................................................Passed nbstripout...............................................................Passed - cmd [2] | pytest --cov - ================================ test session starts ================================ - platform darwin -- Python 3.12.2, pytest-8.0.2, pluggy-1.4.0 + cmd [2] | pytest --cov --cov-report=term + ============================================================ test session starts ============================================================= + platform darwin -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 rootdir: /Users/fschuch/Documents/GitHub/wizard-template configfile: pyproject.toml - plugins: cov-4.1.0 - collected 7 items - - tests/test_core.py ...... [ 85%] - wizard_template/core.py . [100%] - - ---------- coverage: platform darwin, python 3.12.2-final-0 ------------- - Name Stmts Miss Branch BrPart Cover Missing - ------------------------------------------------------------------------- - - tests/__init__.py 0 0 0 0 100% - tests/test_core.py 10 0 6 0 100% - wizard_template/__init__.py 2 0 0 0 100% - wizard_template/core.py 8 0 2 0 100% - ------------------------------------------------------------------------- - - TOTAL 20 0 8 0 100% + plugins: cov-6.0.0 + collected 8 items + + src/wizard_template/core.py . [ 12%] + tests/test_core.py ...... [ 87%] + tools/rename_project_content.py s [100%] + + ---------- coverage: platform darwin, python 3.12.7-final-0 ---------- + Name Stmts Miss Branch BrPart Cover Missing + ------------------------------------------------------------------------------- + src/wizard_template/__init__.py 2 0 0 0 100.00% + src/wizard_template/core.py 8 0 2 0 100.00% + tests/__init__.py 0 0 0 0 100.00% + tests/test_core.py 10 0 0 0 100.00% + ------------------------------------------------------------------------------- + TOTAL 20 0 2 0 100.00% Required test coverage of 90.0% reached. Total coverage: 100.00% - ================================= 7 passed in 0.11s ================================= + ======================================================== 7 passed, 1 skipped in 0.05s ======================================================== cmd [3] | echo '✅ QA passed' ✅ QA passed ``` @@ -212,7 +211,7 @@ Some may argue about the importance of [Keeping a Changelog](https://keepachange ### Managing the Version Number The version in the project is set dynamically by [hatch-vcs](https://github.com/ofek/hatch-vcs). -At installation and build time, the version is recovered from the version control system and exported to the file `wizard_template/_version.py`. +At installation and build time, the version is recovered from the version control system and exported to the file `src/wizard_template/_version.py`. In this way, there is no need to keep the version hard-coded on the codebase. You can use the command `hatch version` to check the current version. On the deployment workflow, the version is recovered from the tag and used to build the package. diff --git a/pyproject.toml b/pyproject.toml index c7cc853..ef2d790 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,13 +39,13 @@ addopts = [ "--doctest-continue-on-failure", "--doctest-report=ndiff", ] - minversion = "8.0" + [tool.coverage.run] branch = true relative_files = true -source = ["wizard_template", "tests"] -omit = ["wizard_template/_version.py"] +source = ["src/wizard_template", "tests"] +omit = ["src/wizard_template/_version.py"] [tool.coverage.report] fail_under = 90 @@ -76,7 +76,7 @@ check-filenames = true source = "vcs" [tool.hatch.build.hooks.vcs] -version-file = "wizard_template/_version.py" +version-file = "src/wizard_template/_version.py" [tool.hatch.envs.default] description = "Base development environment" @@ -89,7 +89,7 @@ dependencies = [ ] [tool.hatch.envs.default.scripts] -_wizard = ["python ./scripts/rename_project_content.py"] +_wizard = ["python ./tools/rename_project_content.py"] pre-commit-install = "pre-commit install {args}" pre-commit-uninstall = "pre-commit uninstall {args}" check = "pre-commit run {args} --all-files" @@ -128,5 +128,5 @@ config = "jupyter-book config sphinx docs {args}" build = ["config", "jupyter-book build docs --path-output build {args}"] serve = [ "config", - "sphinx-autobuild docs build/_build/html --open-browser --watch wizard_template {args}", + "sphinx-autobuild docs build/_build/html --open-browser --watch src/wizard_template {args}", ] diff --git a/wizard_template/__init__.py b/src/wizard_template/__init__.py similarity index 100% rename from wizard_template/__init__.py rename to src/wizard_template/__init__.py diff --git a/wizard_template/core.py b/src/wizard_template/core.py similarity index 100% rename from wizard_template/core.py rename to src/wizard_template/core.py diff --git a/wizard_template/py.typed b/src/wizard_template/py.typed similarity index 100% rename from wizard_template/py.typed rename to src/wizard_template/py.typed diff --git a/scripts/rename_project_content.py b/tools/rename_project_content.py similarity index 98% rename from scripts/rename_project_content.py rename to tools/rename_project_content.py index ad882b3..0092473 100644 --- a/scripts/rename_project_content.py +++ b/tools/rename_project_content.py @@ -112,7 +112,7 @@ def main() -> None: # Rename the directory print(f"Renaming folder wizard_template to {project_name_underscore}") - Path("wizard_template").rename(project_name_underscore) + Path("src/wizard_template").rename(f"src/{project_name_underscore}") print("Done!")