From 14c959c16f9ca043bdc9426dc978fda7acbe55e8 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Thu, 14 May 2026 13:55:33 +1200 Subject: [PATCH 01/12] Fix docstring formatting. --- src/gsolve/tide/earth_tide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gsolve/tide/earth_tide.py b/src/gsolve/tide/earth_tide.py index 30c87e6..ebaa782 100644 --- a/src/gsolve/tide/earth_tide.py +++ b/src/gsolve/tide/earth_tide.py @@ -934,7 +934,7 @@ class EternaPredictTidalCorrection(EarthTideCorrectionProvider): - ``4`` : Tamura (1987), 1200 waves. - ``7`` : Hartmann and Wenzel (1995), 12935 waves. - ``8`` (Default) : Kudryavtsev (2004), 28806 waves (highest resolution). - + See ETERNA/pygtide for the full list of available catalogues. tidalcompo : int, default 0 The tidal component to calculate. The default 0 is earth tide gravity, but other From b72375c943d62ac4ee21dbb831a9498f2282af9e Mon Sep 17 00:00:00 2001 From: Craig Miller <5473482+craigmillernz@users.noreply.github.com> Date: Thu, 14 May 2026 18:21:06 +1200 Subject: [PATCH 02/12] Update conf.py update GNS -->ESNZ and copyright year. --- docs/source/conf.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 01b029a..4d97898 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,19 +28,18 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "GSolve" -copyright = "2025, Adrian Benson, Alison Kirkby, Craig Miller, Aleksandr Spesivtsev, Vaughan Stagpoole, GNS Science" +project = "gSolve" +copyright = "2026, Adrian Benson, Alison Kirkby, Craig Miller, Aleksandr Spesivtsev, Vaughan Stagpoole, Earth Sciences New Zealand" author = "Adrian Benson, Alison Kirkby, Craig Miller, Aleksandr Spesivtsev, Vaughan Stagpoole" -release = "5.4.0" -version = "5.4" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The full version, including alpha/beta/rc tags. -# from gsolve import __version__ as version -# release = version +from gsolve import __version__ + +release = __version__ # The short X.Y version. # version = ".".join(release.split(".")[:2]) From a8cf3eacae19af1210ccb722200589b3204a0802 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Fri, 15 May 2026 11:24:38 +1200 Subject: [PATCH 03/12] Refactor Excel output handling and improve data formatting in reports --- examples/scripts/okataina_survey.py | 6 +++--- src/gsolve/observations.py | 2 +- src/gsolve/reports.py | 11 +++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/scripts/okataina_survey.py b/examples/scripts/okataina_survey.py index 206246b..5082480 100644 --- a/examples/scripts/okataina_survey.py +++ b/examples/scripts/okataina_survey.py @@ -18,7 +18,7 @@ import pathlib try: - import contextily as cx # ty:ignore[unresolved-import] + import contextily as cx # pyright: ignore[reportMissingImports] # ty:ignore[unresolved-import] except ImportError: has_contextily = False else: @@ -104,7 +104,7 @@ # Step 1: generate the input file for QTP using the site and observation datetimes. # - this has been run, uncomment code below to generate a new file. -#generate_qtp_input( +# generate_qtp_input( s = obs.data.site_id.to_numpy() generate_qtp_input( site_id=s, @@ -112,7 +112,7 @@ latitude=sites.data.loc[s, "latitude"].to_numpy(), longitude=sites.data.loc[s, "longitude"].to_numpy(), elevation=sites.data.loc[s, "height_ellipsoidal"].to_numpy(), - output_file=ocean_load_path / "okataina_qtp_input.csv" + output_file=ocean_load_path / "okataina_qtp_input.csv", ) # step 2: run QTP externally to generate the output file (not shown here) diff --git a/src/gsolve/observations.py b/src/gsolve/observations.py index 10c676e..c5135ed 100644 --- a/src/gsolve/observations.py +++ b/src/gsolve/observations.py @@ -629,7 +629,7 @@ def apply_earth_tide_correction( ) self.set_column(column_name, tcorr) identifier = tide_corrector.identifier(**kwargs) - self.earthtide_correction_method = identifier + self._earthtide_correction_method = identifier # self.set_column(f"{column_name}_method", identifier) def apply_ocean_load_correction( diff --git a/src/gsolve/reports.py b/src/gsolve/reports.py index 99bf602..26c84c3 100644 --- a/src/gsolve/reports.py +++ b/src/gsolve/reports.py @@ -17,7 +17,7 @@ # Copyright (c) 2025 Earth Sciences New Zealand. from pathlib import Path -from typing import Literal +from typing import Any import pandas as _pd @@ -205,7 +205,6 @@ def _set_obs_data( # after gsolve run, 'active' indicates if obs was used in solution # rename to 'included_in_solution' for clarity df = df.rename(columns={"active_duplicate": "included_in_solution"}) - # add flag for if site has a gsolve solution i_included_in_solution = df.columns.get_loc("included_in_solution") if not isinstance(i_included_in_solution, int): @@ -376,12 +375,20 @@ def to_excel( all_params = [] + def _format_value(x: Any) -> str | float | int | bool: # noqa: ANN401 + if isinstance(x, _pd.Timedelta): + return x.total_seconds() + elif isinstance(x, Path): + return str(x) + return x + for section, param in self.params.items(): df: _pd.DataFrame = ( param.to_series(series_name="value", index_name="parameter") .to_frame() .reset_index() ) + df.iloc[:, 1] = df.iloc[:, 1].map(_format_value) df.insert(0, "section", section) all_params.append(df) From 50563b2603d4f65446b43f981b1c1f4a9faf1b5f Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Fri, 15 May 2026 12:43:43 +1200 Subject: [PATCH 04/12] Clean up homepage etc in pyproject.oml --- .gitignore | 11 ---- .gitlab-ci.yml | 137 ----------------------------------------------- environment.yaml | 17 ------ pyproject.toml | 13 +++-- 4 files changed, 8 insertions(+), 170 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 environment.yaml diff --git a/.gitignore b/.gitignore index 5158b0d..08249d7 100644 --- a/.gitignore +++ b/.gitignore @@ -161,23 +161,12 @@ cython_debug/ gsolve.code-workspace docs/generated/* .vscode/settings.json -fake_data.ipynb -miller2020.ipynb -test_meter_correction.ipynb -test_miller copy.ipynb -test_miller.ipynb -test_orig_algorithm.ipynb -test1.ipynb -.xxxxxxdevcontainer/devcontainer.json -.xxxxxxdevcontainer/Dockerfile .vscode/launch.json /*.ipynb examples/scintrex/CG-6_0680_DRFT_CAL2.dat examples/scintrex/CG-6_0680_TEST1.dat examples/scintrex/lynx_CG6_0041_20220719_Final_1HZ.DAT examples/scintrex/lynx_CG6_0041_20220719_Final_FILT.DAT -run.bat -examples/surveys/terrain_corrections/wellington1m_lidar.tif tuhua_data/* paeroa_data/* /*.dat diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 46e028d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,137 +0,0 @@ -variables: - UV_VERSION: "0.11.9" - PYTHON_VERSION: "3.12" - BASE_LAYER: trixie-slim - # GitLab CI creates a separate mountpoint for the build directory, - # so we need to copy instead of using hard links. - UV_LINK_MODE: copy - UV_BASE_IMAGE: "ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER" - PROJECT_BUILD_IMAGE: "artifactory.gns.cri.nz/gns/gsolve-base:python$PYTHON_VERSION" - GIT_DEPTH: 1 - # UV_CACHE_DIR: ".uv-cache" - - - -# stages: [build, test, deploy-docs, release] -stages: [build, test, release, docs] -# ------------------------------------------------------- -# Build base image — on master when deps change, or on MR/feature branches -# ------------------------------------------------------- -build-gsolve-base: - stage: build - tags: - - linux - script: - - echo "Building image ${PROJECT_BUILD_IMAGE} based on ${UV_BASE_IMAGE}" - - docker build --build-arg BASE_IMAGE=$UV_BASE_IMAGE -t "${PROJECT_BUILD_IMAGE}" . - - echo "Pushing image ${PROJECT_BUILD_IMAGE}" - - docker push "${PROJECT_BUILD_IMAGE}" - rules: - - changes: - - "uv.lock" - - "Dockerfile" - - ".gitlab-ci.yml" - - ".python-version" - when: always - allow_failure: false - - when: manual - allow_failure: true - -# ------------------------------------------------------- -# Test -# ------------------------------------------------------- -run-tests: - stage: test - needs: - - job: build-gsolve-base - when: always - allow_failure: false - tags: - - docker - image: ${PROJECT_BUILD_IMAGE} - script: - - uv run --dev --cache-dir=/uv_cache --locked python -m pytest --cov-report term --cov - coverage: '/TOTAL.*\s+(\d+%)/' - -# ------------------------------------------------------- -# build packages -# ------------------------------------------------------- -build-packages: - stage: release - tags: - - docker - image: ${PROJECT_BUILD_IMAGE} - script: - - uv build --cache-dir=/uv_cache - artifacts: - paths: - - dist/*.whl - - dist/*.tar.gz - expire_in: 1 week - needs: - - job: run-tests - -# ------------------------------------------------------- -# release packages to PyPI — only on master, only after build and tests pass -# ------------------------------------------------------- -release-packages: - stage: release - tags: - - docker - needs: - - job: build-packages - rules: - - if: '$CI_COMMIT_BRANCH == "master"' - when: manual - image: ${PROJECT_BUILD_IMAGE} - script: - - uv publish --cache-dir=/uv_cache --repository pypi --dry-run - allow_failure: true - - -# ------------------------------------------------------- -# Build docs — only on master, only after tests pass -# ------------------------------------------------------- -build-docs: - stage: docs - tags: - - docker - needs: - - job: run-tests - rules: - - if: '$CI_COMMIT_BRANCH == "master"' - when: always - allow_failure: false - - changes: - - "docs/source/*" - - when: manual - allow_failure: true - image: ${PROJECT_BUILD_IMAGE} - script: - - uv run --cache-dir=/uv_cache --group docs --locked -- sphinx-build --fresh-env --write-all -b html -w docs/build/warnings.txt docs/source docs/build/html - artifacts: - paths: - - docs/build/html - - docs/build/warnings.txt - expire_in: 2 days - -# deploy-docs: -# image: sphinxdoc/sphinx -# tags: -# - docker -# stage: docs -# needs: -# - job: build-docs -# rules: -# - if: '$CI_COMMIT_BRANCH == "master"' -# when: on_success -# before_script: -# - apt-get update && apt-get install -y build-essential gcc gfortran python3-dev -# - pip3 install -e . -# script: -# - pip3 install -r docs/requirements.txt -# - sphinx-build -b html docs public -# artifacts: -# paths: -# - public -# expire_in: 2 days diff --git a/environment.yaml b/environment.yaml deleted file mode 100644 index 9a9a1ba..0000000 --- a/environment.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: gsolve -channels: - - conda-forge -dependencies: - - python=3.11 - - pandas - - ca-certificates - - openssl - - notebook - - certifi - - matplotlib - - sphinx - - myst-parser - - pytest - - pytest-cov - - openpyxl -prefix: /home/adrianmb/miniforge3/envs/gsolve diff --git a/pyproject.toml b/pyproject.toml index 3acb348..58c2493 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,11 @@ dependencies = [ dev = ["pytest>=9.0.3", "pytest-cov>=7.1.0", "pytest-datadir>=1.8.0", "ruff"] [project.urls] -Repository = "https://git.gns.cri.nz/gravity-processing/gsolve.git" -# Homepage = "https://example.com" -# Documentation = "https://readthedocs.org" -# Issues = "https://github.com/me/spam/issues" -# Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md" +Repository = "https://github.com/GNS-Science/gsolve" +# Homepage = "https://github.com/GNS-Science/gsolve" +Documentation = "https://gns-science.github.io/gsolve/" +Issues = "https://github.com/GNS-Science/gsolve/issues" +Changelog = "https://github.com/GNS-Science/gsolve/blob/main/CHANGELOG.md" [build-system] requires = ["uv_build>=0.11.8,<0.12"] @@ -64,6 +64,9 @@ dev = [ "ruff" ] +[tool.uv] +required-version = ">=0.11.8" + # ------------------------------ # Other tools configuration From d562b0c2bd6c4eb980284cbe84cdfb830b24c638 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Fri, 15 May 2026 21:30:06 +1200 Subject: [PATCH 05/12] Refactor actions workflows --- .github/workflows/publish.yml | 16 ++++------------ .github/workflows/sphinx-docs.yml | 15 ++++++++------- .github/workflows/test_and_build.yml | 22 +++++++--------------- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5b9e1bb..c40a0e8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,16 +22,12 @@ jobs: python-version: '3.12' - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v8.1.0 with: - version: "0.5.11" enable-cache: true - - name: Create virtual environment - run: uv venv - - name: Install dependencies - run: uv sync --all-groups + run: uv sync --all-groups --locked - name: Run tests run: uv run pytest tests/ -v @@ -57,16 +53,12 @@ jobs: python-version: '3.12' - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v8.1.0 with: - version: "0.5.11" enable-cache: true - - name: Create virtual environment - run: uv venv - - name: Build distribution - run: uv run --with build python -m build + run: uv build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index 8a779b9..c99323a 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -23,19 +23,20 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.12' + + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 + with: + enable-cache: true - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install sphinx sphinx-book-theme myst-parser numpydoc sphinx-copybutton sphinx-design - pip install -e . + run: uv sync --all-groups --locked - name: Build documentation - run: | - sphinx-build -b html docs/source docs/_build/html + run: uv run sphinx-build -b html docs/source docs/_build/html - name: Upload build artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7.0.1 with: name: sphinx-docs path: docs/_build/html/ diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 2afb182..2e2798b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -14,7 +14,7 @@ jobs: python-version: ['3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 @@ -22,16 +22,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v8.1.0 with: - version: "0.5.11" enable-cache: true - - name: Create virtual environment - run: uv venv - - name: Install dependencies - run: uv sync --all-groups + run: uv sync --all-groups --locked - name: Lint with ruff run: | @@ -57,7 +53,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v6 @@ -65,22 +61,18 @@ jobs: python-version: '3.12' - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v8.1.0 with: - version: "0.5.11" enable-cache: true - - name: Create virtual environment - run: uv venv - - name: Build distribution - run: uv run --with build python -m build + run: uv build - name: Check distribution with twine run: uv run --with twine twine check dist/* - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7.0.1 with: name: distributions-${{ matrix.os }} path: dist/ From 66f14aaa1fdab4146d053010437adaeee4ae4a7d Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Sat, 16 May 2026 00:07:38 +1200 Subject: [PATCH 06/12] bump action versions, ensure consistency --- .github/workflows/publish.yml | 4 ++-- .github/workflows/sphinx-docs.yml | 10 +++++----- .github/workflows/test_and_build.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c40a0e8..59185a3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v6 @@ -45,7 +45,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index c99323a..5c00d62 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -17,10 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.12' @@ -36,7 +36,7 @@ jobs: run: uv run sphinx-build -b html docs/source docs/_build/html - name: Upload build artifacts - uses: actions/upload-artifact@v7.0.1 + uses: actions/upload-artifact@v7 with: name: sphinx-docs path: docs/_build/html/ @@ -59,13 +59,13 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v8 with: name: sphinx-docs path: ./html - name: Setup Pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@v6 - name: Upload to Pages uses: actions/upload-pages-artifact@v5 diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 2e2798b..4c9606c 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -72,7 +72,7 @@ jobs: run: uv run --with twine twine check dist/* - name: Upload artifacts - uses: actions/upload-artifact@v7.0.1 + uses: actions/upload-artifact@v7 with: name: distributions-${{ matrix.os }} path: dist/ From e2b042f8e9c93e02871168ee44f256f272f50a20 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Sat, 16 May 2026 02:09:28 +1200 Subject: [PATCH 07/12] Update repo version etc in docs conf.py --- .github/workflows/sphinx-docs.yml | 6 +++--- docs/source/conf.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index 5c00d62..0a88bf9 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -29,11 +29,11 @@ jobs: with: enable-cache: true - - name: Install dependencies - run: uv sync --all-groups --locked + # - name: Install dependencies + # run: uv sync --all-groups --locked - name: Build documentation - run: uv run sphinx-build -b html docs/source docs/_build/html + run: uv run --group docs --locked -- sphinx-build -a -b html docs/source docs/_build/html - name: Upload build artifacts uses: actions/upload-artifact@v7 diff --git a/docs/source/conf.py b/docs/source/conf.py index 4d97898..62f88a5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -85,17 +85,17 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "sphinx_book_theme" -html_title = "GSolve" +html_title = "gSolve" html_logo = "_static/gsolve_logo.png" html_static_path = ["_static"] html_theme_options = { "show_navbar_depth": 1, - "repository_provider": "gitlab", - "repository_url": "https://git.gns.cri.nz/gravity-processing/gsolve", - "repository_branch": "master", + "repository_provider": "github", + "repository_url": "https://github.com/GNS-Science/gsolve", + "repository_branch": "main", "use_repository_button": True, } html_context = { "display_version": True, # Ensure version is displayed - "version": version, # Pass version variable to templates + "version": release, # Pass version variable to templates } From 8da2a3c0e7b5dfc185c0fb35ad0366729c96ad3b Mon Sep 17 00:00:00 2001 From: Craig Miller <5473482+craigmillernz@users.noreply.github.com> Date: Sun, 17 May 2026 20:46:46 +1200 Subject: [PATCH 08/12] Update history.md --- docs/source/history.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/source/history.md b/docs/source/history.md index ab29d40..7c92838 100644 --- a/docs/source/history.md +++ b/docs/source/history.md @@ -1,9 +1,21 @@ -# Gsolve history +# gSolve history -History of gsolve from the beginning. +##### 1970: Reilly alogrithm published. +The network adjusmtent algorithm used in gSolve. +Reilly, W. I. (1970). [Adjustment of gravity meter observations. New Zealand Journal of Geology and Geophysics, 13(3), 697–702.](https://doi.org/10.1080/00288306.1970.10431341) -In the beginning there was DSolve. +##### 1982: Reilly algorithms coded in Fortran to run on VAX. +Woodward, D. (1982). Reduction of gravity observations on the VAX11-780 computer, (No. 12). Department of Scientific and Industrial Research. -Then Gsolve was rewritten into python with a GUI +##### 1984: DSolve +Woodward, D., & Carmen, A. (1984). Computer program to reduce precise gravity observations (Technical Note No. 93). Geophysics Division, DSIR. -2024 GSolve v5 completely rewritten as a python module. +##### 2018: Gsolve +Reilly algorithm written in python 2, including a range of corrections to produce complete Bouguer anomalies. +[McCubbine, J., Tontini, F. C., Stagpoole, V., Smith, E., & O’Brien, G. (2018). Gsolve, a Python computer program with a graphical user interface to transform relative gravity survey measurements to absolute gravity values and gravity anomalies. SoftwareX, 7, 129–137.](https://doi.org/10.1016/j.softx.2018.04.003) + +##### 2024: gSolve +Complete rewrite of Gsolve in python3 begins. Shift to api based and no gui. We chose version 5 as representing the evolution since 1970. + +##### 2026: gSolve +Released as open source code. From 02f51e7a549f7bf9c3d20c27bd1a8d12e8a83879 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Mon, 18 May 2026 09:52:59 +1200 Subject: [PATCH 09/12] rm gitlab cicd dockerfile --- Dockerfile | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fc5a923..0000000 --- a/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Base image -ARG BASE_IMAGE="ghcr.io/astral-sh/uv:0.11-python3.12-trixie-slim" -# ARG UV_VENV="/venv" - -FROM ${BASE_IMAGE} AS build - -WORKDIR /app -COPY pyproject.toml uv.lock ./ - -# Install system dependencies required by rasterio and spatial libraries -# Create and fill a cache dir for uv to speed up installs in later stages - -RUN apt-get update \ - && apt-get install -y --no-install-recommends libexpat1 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && uv sync --all-groups --locked --no-install-project --cache-dir=/uv_cache \ - && rm -r .venv pyproject.toml uv.lock - From 0639a95d6f91757bedeea54326621a6181a82007 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Mon, 18 May 2026 10:42:37 +1200 Subject: [PATCH 10/12] Make package versioning dynamic - Change build system to hatch.build - Add more classifiers --- pyproject.toml | 14 +++++++++++--- src/gsolve/__init__.py | 8 ++++---- uv.lock | 1 - 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 58c2493..b857b8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gsolve" -version = "5.6.0" +dynamic = ["version"] # version = "5.6.0" description = "A Python package for processing gravity survey data." requires-python = ">=3.12" authors = [ @@ -15,9 +15,14 @@ license-files = ["LICENSE"] readme = "README.md" classifiers = [ "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Topic :: Scientific/Engineering", ] dependencies = [ "boule==0.5.*", @@ -41,8 +46,11 @@ Issues = "https://github.com/GNS-Science/gsolve/issues" Changelog = "https://github.com/GNS-Science/gsolve/blob/main/CHANGELOG.md" [build-system] -requires = ["uv_build>=0.11.8,<0.12"] -build-backend = "uv_build" +requires = ["hatchling", "uv-dynamic-versioning"] +build-backend = "hatchling.build" + +[tool.hatch.version] +source = "uv-dynamic-versioning" [dependency-groups] docs = [ diff --git a/src/gsolve/__init__.py b/src/gsolve/__init__.py index bc9e4ec..1efc12a 100644 --- a/src/gsolve/__init__.py +++ b/src/gsolve/__init__.py @@ -1,11 +1,11 @@ from __future__ import annotations -import importlib.metadata as _im +import importlib.metadata try: - __version__ = _im.version("gsolve") -except _im.PackageNotFoundError: - __version__ = "5.6.0" # pragma: no cover + __version__ = importlib.metadata.version(__name__) +except importlib.metadata.PackageNotFoundError: + __version__ = "5.X.X.dev" from gsolve.meter_conversion import LaCosteRombergDialConverter from gsolve.observations import GravityObservations, GravitySurvey diff --git a/uv.lock b/uv.lock index c2d09f7..0de95b7 100644 --- a/uv.lock +++ b/uv.lock @@ -616,7 +616,6 @@ wheels = [ [[package]] name = "gsolve" -version = "5.6.0" source = { editable = "." } dependencies = [ { name = "boule" }, From 6e69c78d1360747eec6733eb08f47093b0d36d40 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Mon, 18 May 2026 10:56:13 +1200 Subject: [PATCH 11/12] Add with: fetch-tags to code checkouts. Tags required for versioning --- .github/workflows/publish.yml | 6 ++++++ .github/workflows/sphinx-docs.yml | 5 ++++- .github/workflows/test_and_build.yml | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 59185a3..583ccf5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,6 +15,9 @@ jobs: steps: - uses: actions/checkout@v6 + with: + # fetch-depth: 0 # Fetch all history for tags + fetch-tags: true - name: Set up Python uses: actions/setup-python@v6 @@ -46,6 +49,9 @@ jobs: steps: - uses: actions/checkout@v6 + with: + # fetch-depth: 0 # Fetch all history for tags + fetch-tags: true - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index 0a88bf9..b5d3fbf 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -18,7 +18,10 @@ jobs: steps: - uses: actions/checkout@v6 - + with: + # fetch-depth: 0 # Fetch all history for tags + fetch-tags: true + - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 4c9606c..d93ffd9 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -54,7 +54,10 @@ jobs: steps: - uses: actions/checkout@v6 - + with: + # fetch-depth: 0 # Fetch all history for tags + fetch-tags: true + - name: Set up Python uses: actions/setup-python@v6 with: From 80273d4abd3e6001d0c67bffb309972e5f587fa0 Mon Sep 17 00:00:00 2001 From: Adrian Benson Date: Mon, 18 May 2026 11:13:53 +1200 Subject: [PATCH 12/12] Ensure tags are available to gh actions. --- .github/workflows/publish.yml | 6 ++---- .github/workflows/sphinx-docs.yml | 3 +-- .github/workflows/test_and_build.yml | 5 +++-- pyproject.toml | 3 +++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 583ccf5..7f9e7b7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,8 +16,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - # fetch-depth: 0 # Fetch all history for tags - fetch-tags: true + fetch-depth: 0 # Fetch all history for tags - name: Set up Python uses: actions/setup-python@v6 @@ -50,8 +49,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - # fetch-depth: 0 # Fetch all history for tags - fetch-tags: true + fetch-depth: 0 # Fetch all history for tags - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index b5d3fbf..482e762 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -19,8 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - # fetch-depth: 0 # Fetch all history for tags - fetch-tags: true + fetch-depth: 0 # Fetch all history for tags - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index d93ffd9..021387e 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 # Fetch all history for tags --- IGNORE --- - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 @@ -55,8 +57,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - # fetch-depth: 0 # Fetch all history for tags - fetch-tags: true + fetch-depth: 0 # Fetch all history for tags - name: Set up Python uses: actions/setup-python@v6 diff --git a/pyproject.toml b/pyproject.toml index b857b8b..f6cf800 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,9 @@ build-backend = "hatchling.build" [tool.hatch.version] source = "uv-dynamic-versioning" +[tool.uv-dynamic-versioning] +fallback-version = "5.X.X" + [dependency-groups] docs = [ "myst-parser>=5.0.0",