Commit 161656d
fix: correct ADCP_VERSION packaging for PyPI (#85)
* fix: package ADCP_VERSION file correctly for PyPI distribution
Previously, get_adcp_version() returned "v1" (fallback) when installed
from PyPI because ADCP_VERSION was packaged in the wrong location
(adcp-2.12.0.data/data/) and couldn't be found at runtime.
Changes:
- Move ADCP_VERSION into src/adcp/ package directory
- Update pyproject.toml to include it as package data
- Update get_adcp_version() to read from package location
- Remove "v1" fallback to fail fast if file is missing
Now returns "2.5.0" correctly when installed from PyPI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: use importlib.resources for ADCP_VERSION file access
Switch from Path(__file__) to importlib.resources.files() for more
robust package data access across different installation methods
(editable installs, zip imports, etc.).
This is the modern, recommended way to access package data files
in Python 3.9+.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d3acbf7 commit 161656d
3 files changed
+9
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 64 | + | |
72 | 65 | | |
73 | 66 | | |
74 | 67 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
195 | 198 | | |
196 | | - | |
| 199 | + | |
197 | 200 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
0 commit comments