From 7dcdf2bb5edb6303c2bc5df338f691ae56db879e Mon Sep 17 00:00:00 2001 From: PAT0216 Date: Thu, 29 Jan 2026 21:33:58 -0800 Subject: [PATCH 1/2] feat(versioning): add hatch-vcs for dynamic versioning from git tags - Configure hatch-vcs in pyproject.toml for automatic version derivation - Add _version.py generation hook - Update __init__.py to expose __version__ - Add .gitattributes for VCS compatibility --- .gitattributes | 1 + pyproject.toml | 12 +++++++++--- src/geospatial_toolkit/__init__.py | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cca662d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.py export-subst diff --git a/pyproject.toml b/pyproject.toml index 9e8fa49..80354e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [build-system] build-backend = "hatchling.build" -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] ################################################################################ # Project Configuration @@ -12,8 +12,7 @@ requires = ["hatchling"] [project] name = "geospatial_toolkit" -# You can chose to use dynamic versioning with hatch or static where you add it manually. -version = "0.1.0" +dynamic = ["version"] description = "Python package for geospatial functions." authors = [ @@ -101,6 +100,13 @@ all = [ [tool.hatch.build] only-packages = true +# Dynamic versioning from Git tags +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "src/geospatial_toolkit/_version.py" + # This tells Hatch to build the package from the src/ directory. # Read more about src layouts here: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html [tool.hatch.build.targets.wheel] diff --git a/src/geospatial_toolkit/__init__.py b/src/geospatial_toolkit/__init__.py index 0d54c99..0f80010 100644 --- a/src/geospatial_toolkit/__init__.py +++ b/src/geospatial_toolkit/__init__.py @@ -41,8 +41,14 @@ from geospatial_toolkit.latlong import standardize_latlong from geospatial_toolkit.point_to_city import point_to_city +try: + from geospatial_toolkit._version import __version__ +except ImportError: + __version__ = "unknown" + # This defines what is available when someone does 'from geospatial_toolkit import *' __all__ = [ + "__version__", "haversine_distance", "get_antipode", "standardize_latlong", From 77427982dede75db406fdd8fa05760c029dc4786 Mon Sep 17 00:00:00 2001 From: PAT0216 Date: Thu, 29 Jan 2026 23:27:13 -0800 Subject: [PATCH 2/2] docs: fix Attribution typo and list GenAI tools used - Fix 'Atribution' -> 'Attribution' heading typo - Add specific LLM names: Google Gemini, OpenAI ChatGPT, GitHub Copilot Closes #72 --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8a262b2..33c9cdf 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,6 @@ quarto preview - Copyright © 2026 Athul, Bala, Prabuddha, Shreya. - Free software distributed under the [MIT License](./LICENSE). -## Atribution - -Gen AI tools were used to assist in the creation of this package, including code generation and documentation drafting. All generated content was reviewed and edited by the human authors to ensure accuracy and quality. +## Attribution +Gen AI tools (Google Gemini, OpenAI ChatGPT, and GitHub Copilot) were used to assist in the creation of this package, including code generation and documentation drafting. All generated content was reviewed and edited by the human authors to ensure accuracy and quality.