gri-plot 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gri_plot-0.2.5 → gri_plot-0.2.6}/.gitignore +1 -0
- gri_plot-0.2.6/.hatch_build.py +46 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/CONTRIBUTING.md +24 -17
- {gri_plot-0.2.5 → gri_plot-0.2.6}/PKG-INFO +2 -2
- {gri_plot-0.2.5 → gri_plot-0.2.6}/README.md +1 -1
- {gri_plot-0.2.5 → gri_plot-0.2.6}/pyproject.toml +6 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/LICENSE +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/_heatmap_image.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/basemap.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/data/natural_earth_boundaries.npz +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/figure3d.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/figure_map.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/frames.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/observables/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/observables/aoa.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/observables/los.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/observables/range_sphere.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/plot_ellipse.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/polylines.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/py.typed +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/scatter.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/scatter_map.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/cone.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/cylinder.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/ellipse.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/ellipsoid.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/meshgen.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/shapes/sphere.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/surfaces/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/gri_plot/surfaces/mesh.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/scripts/build_basemap_data.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_basemap.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_figure3d.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_figure_map.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_frames.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_heatmap_image.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_observables/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_observables/test_aoa.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_observables/test_los.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_observables/test_range_sphere.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_plot_ellipse.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_plot_scattermap.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_polylines.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_scatter.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/test_cone.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/test_cylinder.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/test_ellipse.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/test_ellipsoid.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_shapes/test_sphere.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_surfaces/__init__.py +0 -0
- {gri_plot-0.2.5 → gri_plot-0.2.6}/test/test_surfaces/test_mesh.py +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Custom hatchling build hook that wires up the project's git hooks.
|
|
2
|
+
|
|
3
|
+
`uv sync` installs this project in editable mode, which runs the hatchling
|
|
4
|
+
build backend and therefore this hook. The hook points git's ``core.hooksPath``
|
|
5
|
+
at the tracked ``.githooks`` directory, so a fresh clone gets working git hooks
|
|
6
|
+
on its first sync without a separate install step.
|
|
7
|
+
|
|
8
|
+
This only adjusts local git config and is a no-op outside a git work tree (for
|
|
9
|
+
example, in an isolated sdist/wheel build), so it is safe in CI release builds.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import shutil
|
|
13
|
+
import subprocess
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GitHooksBuildHook(BuildHookInterface):
|
|
21
|
+
"""Set ``core.hooksPath`` to the tracked ``.githooks`` directory."""
|
|
22
|
+
|
|
23
|
+
PLUGIN_NAME = "custom"
|
|
24
|
+
|
|
25
|
+
def initialize(self, version: str, build_data: dict[str, Any]) -> None: # noqa: ARG002
|
|
26
|
+
"""Point git at ``.githooks`` if this build runs inside a work tree."""
|
|
27
|
+
root = Path(self.root)
|
|
28
|
+
git = shutil.which("git")
|
|
29
|
+
if git is None or not (root / ".githooks").is_dir():
|
|
30
|
+
return
|
|
31
|
+
# Only act inside a real git work tree; check=False keeps release
|
|
32
|
+
# builds (sdist/wheel in a non-git temp dir) from failing.
|
|
33
|
+
inside = subprocess.run( # noqa: S603
|
|
34
|
+
[git, "rev-parse", "--is-inside-work-tree"],
|
|
35
|
+
cwd=root,
|
|
36
|
+
capture_output=True,
|
|
37
|
+
text=True,
|
|
38
|
+
check=False,
|
|
39
|
+
)
|
|
40
|
+
if inside.stdout.strip() != "true":
|
|
41
|
+
return
|
|
42
|
+
subprocess.run( # noqa: S603
|
|
43
|
+
[git, "config", "core.hooksPath", ".githooks"],
|
|
44
|
+
cwd=root,
|
|
45
|
+
check=False,
|
|
46
|
+
)
|
|
@@ -10,19 +10,25 @@ Requires **Python 3.12+** and **bash**.
|
|
|
10
10
|
```bash
|
|
11
11
|
git clone <repo-url>
|
|
12
12
|
cd <repo>
|
|
13
|
-
|
|
13
|
+
uv sync
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
installs all dependencies (including editable local siblings), and
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
`uv sync` creates a virtual environment with [uv](https://docs.astral.sh/uv/),
|
|
17
|
+
installs all dependencies (including any editable local siblings), and wires up
|
|
18
|
+
the git hooks automatically: a [hatchling](https://hatch.pypa.io/) build hook
|
|
19
|
+
(`.hatch_build.py`) runs during the editable install and points
|
|
20
|
+
`core.hooksPath` at the tracked `.githooks/` directory. No separate
|
|
21
|
+
`pre-commit install` step is needed. To run commands in the environment, prefix
|
|
22
|
+
them with `uv run` (for example `uv run pytest`), or activate it with
|
|
23
|
+
`source .venv/bin/activate`.
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
source .venv/bin/activate
|
|
23
|
-
```
|
|
25
|
+
To start fresh, delete `.venv/` and run `uv sync` again.
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
> **Note (editable local siblings):** some `gri-*` projects depend on sibling
|
|
28
|
+
> packages as editable path sources. uv requires `[tool.uv]`
|
|
29
|
+
> `config-settings = { editable_mode = "compat" }` in `pyproject.toml` for those
|
|
30
|
+
> to import correctly. If a project declares editable path dependencies and
|
|
31
|
+
> imports fail, verify that setting is present.
|
|
26
32
|
|
|
27
33
|
## Running Tests
|
|
28
34
|
|
|
@@ -62,18 +68,19 @@ ruff format # format
|
|
|
62
68
|
ty check
|
|
63
69
|
```
|
|
64
70
|
|
|
65
|
-
### Pre-
|
|
71
|
+
### Pre-push hooks
|
|
66
72
|
|
|
67
|
-
All of the above run automatically on `git
|
|
68
|
-
[pre-commit](https://pre-commit.com/)
|
|
69
|
-
|
|
73
|
+
All of the above run automatically on `git push` via
|
|
74
|
+
[pre-commit](https://pre-commit.com/) (configured for the `pre-push` stage, so
|
|
75
|
+
commits stay fast). If the push fails, fix the issues, commit the fix, and push
|
|
76
|
+
again.
|
|
70
77
|
|
|
71
78
|
```bash
|
|
72
|
-
pre-commit run --all-files # run manually
|
|
79
|
+
uv run pre-commit run --all-files --hook-stage pre-push # run manually
|
|
73
80
|
```
|
|
74
81
|
|
|
75
|
-
> **Tip:** To force a
|
|
76
|
-
> `git
|
|
82
|
+
> **Tip:** To force a push past the hooks (e.g. a work-in-progress branch), use
|
|
83
|
+
> `git push --no-verify`. CI will still enforce the same checks.
|
|
77
84
|
|
|
78
85
|
## Code Style
|
|
79
86
|
|
|
@@ -88,7 +95,7 @@ pre-commit run --all-files # run manually against everything
|
|
|
88
95
|
1. Create a branch from `main`
|
|
89
96
|
2. Make your changes with tests
|
|
90
97
|
3. Ensure `pytest --cov` passes with >= 70% coverage
|
|
91
|
-
4. Ensure `pre-commit run --all-files` passes
|
|
98
|
+
4. Ensure `uv run pre-commit run --all-files --hook-stage pre-push` passes
|
|
92
99
|
5. Open a merge request against `main`
|
|
93
100
|
|
|
94
101
|
## IDE Setup (VS Code)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gri-plot
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: 3D geolocation visualization and 2D plotting utilities built on Plotly
|
|
5
5
|
Project-URL: Homepage, https://geosolresearch.com
|
|
6
6
|
Project-URL: Repository, https://gitlab.com/geosol-foss/python/gri-plot
|
|
@@ -44,7 +44,7 @@ For development:
|
|
|
44
44
|
```bash
|
|
45
45
|
git clone https://gitlab.com/geosol-foss/python/gri-plot.git
|
|
46
46
|
cd gri-plot
|
|
47
|
-
|
|
47
|
+
uv sync
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## Quick Start
|
|
@@ -51,6 +51,10 @@ fallback-version = "0.0.0"
|
|
|
51
51
|
requires = ["hatchling", "uv-dynamic-versioning"]
|
|
52
52
|
build-backend = "hatchling.build"
|
|
53
53
|
|
|
54
|
+
# Runs on `uv sync` (editable build) to point git at the tracked .githooks dir.
|
|
55
|
+
[tool.hatch.build.hooks.custom]
|
|
56
|
+
path = ".hatch_build.py"
|
|
57
|
+
|
|
54
58
|
[tool.hatch.build.targets.wheel]
|
|
55
59
|
packages = ["gri_plot"]
|
|
56
60
|
|
|
@@ -68,6 +72,7 @@ include = [
|
|
|
68
72
|
"CONTRIBUTING.md",
|
|
69
73
|
"LICENSE",
|
|
70
74
|
"pyproject.toml",
|
|
75
|
+
".hatch_build.py",
|
|
71
76
|
]
|
|
72
77
|
|
|
73
78
|
[tool.uv]
|
|
@@ -75,6 +80,7 @@ config-settings = { editable_mode = "compat" }
|
|
|
75
80
|
|
|
76
81
|
[dependency-groups]
|
|
77
82
|
dev = [
|
|
83
|
+
"hatchling>=1.27",
|
|
78
84
|
"pre-commit>=4.3.0",
|
|
79
85
|
"pyqt6>=6.9.1",
|
|
80
86
|
"pytest>=8.4.2",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|