From cc78716425b184fef0e8cda191c9a0cce53d26a9 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Tue, 26 Sep 2023 13:17:18 -0700 Subject: Reorganize code into src layout --- pyproject.toml | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index 87759c4..aab4b3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,6 @@ [build-system] -#requires = ["setuptools"] -#build-backend = "setuptools.build_meta" requires = ["hatchling"] build-backend = "hatchling.build" -#requires = ["pdm-backend"] -#build-backend = "pdm.backend" [project] name = "wikiget" @@ -51,21 +47,19 @@ Repository = "https://github.com/clpo13/wikiget" [project.scripts] wikiget = "wikiget.wikiget:main" -[tool.setuptools.dynamic] -version = {attr = "wikiget.version.__version__"} - [tool.hatch.version] -path = "wikiget/version.py" +path = "src/wikiget/version.py" -#[tool.pdm] -#version = { source = "file", path = "wikiget/version.py" } +[tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", +] +testpaths = ["tests"] -#[tool.pytest.ini_options] -#addopts = [ -# "--import-mode=importlib", -# "--cov=wikiget", -#] -#testpaths = ["test"] +[tool.hatch.build.targets.sdist] +exclude = [ + "/.github", +] [tool.hatch.envs.default] dependencies = [ @@ -73,8 +67,8 @@ dependencies = [ "pytest", ] [tool.hatch.envs.default.scripts] -test = "pytest {args:test}" -test-cov = "coverage run -m pytest {args:test}" +test = "python -m pytest {args}" +test-cov = "coverage run -m pytest {args}" cov-report = [ "- coverage combine", "coverage report", @@ -95,7 +89,7 @@ dependencies = [ "ruff", ] [tool.hatch.envs.lint.scripts] -typing = "mypy --install-types --non-interactive {args:wikiget test}" +typing = "mypy --install-types --non-interactive {args:src/wikiget tests}" style = [ "ruff {args:.}", "black --check --diff {args:.}", @@ -169,19 +163,16 @@ ban-relative-imports = "all" [tool.ruff.per-file-ignores] # Tests can use magic values, assertions, and relative imports -"test/**/*" = ["PLR2004", "S101", "TID252"] +"tests/**/*" = ["PLR2004", "S101", "TID252"] [tool.coverage.run] source_pkgs = ["wikiget"] branch = true parallel = true -omit = [ - "wikiget/version.py", -] [tool.coverage.paths] wikiget = ["wikiget"] -tests = ["test"] +tests = ["tests"] [tool.coverage.report] exclude_lines = [ -- cgit v1.2.3