diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..872f85c --- /dev/null +++ b/.coveragerc @@ -0,0 +1,10 @@ +[run] +branch = true + +[paths] +source = + src/app + +[report] +exclude_lines = + pragma: not covered diff --git a/pyproject.toml b/pyproject.toml index 99c8e71..5830216 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,6 @@ -[build-system] -build-backend = "hatchling.build" -requires = [ "hatchling" ] - [project] name = "land-sight-backend" +version = "0.1.0" description = "LandSight backend." readme = "README.md" license = "MIT" @@ -13,7 +10,6 @@ authors = [ ] requires-python = ">=3.14" classifiers = [ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.14" ] -dynamic = [ "version" ] dependencies = [ "pydantic-settings>=2.12", ] @@ -45,82 +41,3 @@ pre-commit = [ changelog = [ "towncrier>=25.8", ] - -[tool.hatch.version] -source = "code" -path = "src/app/__meta__.py" -attribute = "__version__" - -[tool.hatch.build.targets.wheel] -packages = [ "src/app" ] - -[tool.pytest.ini_options] -cache_dir = ".cache/pytest" -pythonpath = [ "src" ] -testpaths = [ "tests" ] -addopts = [ - "-ra", - "--strict-config", - "--strict-markers", - "--disable-warnings", -] -xfail_strict = true -log_cli = true -log_cli_level = "INFO" -filterwarnings = [ - "error", -] - -[tool.coverage.run] -source = [ "src/app" ] -branch = true - -[tool.coverage.report] -exclude_lines = [ - "pragma: not covered", -] - -[tool.towncrier] -directory = "changelog.d" -filename = "docs/changelog.md" -title_format = "## [{version}](https://github.com/LandSight/backend/releases/tag/{version}) - {project_date}" -issue_format = "[#{issue}](https://github.com/LandSight/backend/issues/{issue})" - -[[tool.towncrier.type]] -name = "Feature" -directory = "feat" -showcontent = true - -[[tool.towncrier.type]] -name = "Bugfix" -directory = "bugfix" -showcontent = true - -[[tool.towncrier.type]] -name = "Security" -directory = "security" -showcontent = true - -[[tool.towncrier.type]] -name = "Deprecation" -directory = "deprecation" -showcontent = true - -[[tool.towncrier.type]] -name = "Removal" -directory = "removal" -showcontent = true - -[[tool.towncrier.type]] -name = "Docs" -directory = "docs" -showcontent = true - -[[tool.towncrier.type]] -name = "Ops" -directory = "ops" -showcontent = true - -[tool.ty.environment] -root = [ "src", "tests" ] -python-version = "3.14" diff --git a/pytest.toml b/pytest.toml new file mode 100644 index 0000000..bfe0d7e --- /dev/null +++ b/pytest.toml @@ -0,0 +1,18 @@ +[pytest] +minversion = "9" +cache_dir = ".cache/pytest" +pythonpath = ["src",] +testpaths = ["tests",] +python_files = ["test_*.py",] +python_classes = ["Test*",] +python_functions = ["test_*",] +addopts = [ + "-ra", + "--strict-config", + "--strict-markers", + "--disable-warnings", + "--cov", +] +xfail_strict = true +log_cli = true +log_cli_level = "INFO" diff --git a/src/app/__init__.py b/src/app/__init__.py index 1e4e3d4..e69de29 100644 --- a/src/app/__init__.py +++ b/src/app/__init__.py @@ -1,4 +0,0 @@ -from .__meta__ import __version__ - - -__all__ = ("__version__",) diff --git a/src/app/__meta__.py b/src/app/__meta__.py deleted file mode 100644 index 0beccff..0000000 --- a/src/app/__meta__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.0.0a0" diff --git a/tests/test_version.py b/tests/test_version.py deleted file mode 100644 index 8077f7e..0000000 --- a/tests/test_version.py +++ /dev/null @@ -1,13 +0,0 @@ -import re - -from app import __version__ - - -VERSION_PATTERN = re.compile(r"^(?P\d+)\.(?P\d+)\.(?P\d+)(?P.*)$") - - -def test_version_format() -> None: - """Ensure __version__ looks like major.minor.patch optionally followed by any suffix such as 'a0'.""" - match = VERSION_PATTERN.match(__version__) - assert match is not None, "Version must start with three numeric release components." - assert all(part.isdigit() for part in match.group("major", "minor", "patch")) diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 0000000..1a6505f --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,40 @@ +[tool.towncrier] +directory = "changelog.d" +filename = "docs/changelog.md" +title_format = "## [{version}](https://github.com/LandSight/backend/releases/tag/{version}) - {project_date}" +issue_format = "[#{issue}](https://github.com/LandSight/backend/issues/{issue})" + +[[tool.towncrier.type]] +name = "Feature" +directory = "feat" +showcontent = true + +[[tool.towncrier.type]] +name = "Bugfix" +directory = "bugfix" +showcontent = true + +[[tool.towncrier.type]] +name = "Security" +directory = "security" +showcontent = true + +[[tool.towncrier.type]] +name = "Deprecation" +directory = "deprecation" +showcontent = true + +[[tool.towncrier.type]] +name = "Removal" +directory = "removal" +showcontent = true + +[[tool.towncrier.type]] +name = "Docs" +directory = "docs" +showcontent = true + +[[tool.towncrier.type]] +name = "Ops" +directory = "ops" +showcontent = true diff --git a/ty.toml b/ty.toml new file mode 100644 index 0000000..06f131b --- /dev/null +++ b/ty.toml @@ -0,0 +1,5 @@ +[src] +include = [ + "src", + "tests", +] diff --git a/uv.lock b/uv.lock index c885b58..44f705b 100644 --- a/uv.lock +++ b/uv.lock @@ -224,7 +224,8 @@ sdist = { url = "https://files.pythonhosted.org/packages/5e/73/e01e4c5e11ad0494f [[package]] name = "land-sight-backend" -source = { editable = "." } +version = "0.1.0" +source = { virtual = "." } dependencies = [ { name = "pydantic-settings" }, ]