fix: __version__ hardcoded to 0.1.0, drifted from pyproject 0.1.1
__init__.py:14 hardcoded "0.1.0" while pyproject.toml, the README
install pin, and the README changelog all said 0.1.1 - a consumer
gating on __version__ read one release behind the actual tag. Derive
__version__ from installed package metadata
(importlib.metadata.version("dpy_cache")) so the hardcoded literal
can no longer drift from the release tag; keep a fallback literal for
the not-installed/editable case, synced to the current pyproject
version.
Bump 0.1.1 -> 0.1.2.
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -9,7 +9,7 @@ bites you.
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```
|
```
|
||||||
dpy_cache @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_cache.git@v0.1.1
|
dpy_cache @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_cache.git@v0.1.2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -103,6 +103,14 @@ one, a `discord.File` source that can't be safely rebuilt for a repeat send). Un
|
|||||||
Tagged `vX.Y.Z`; pin a tag in your install line. Targets `discord.py>=2.0` (not
|
Tagged `vX.Y.Z`; pin a tag in your install line. Targets `discord.py>=2.0` (not
|
||||||
`discord.py-self`).
|
`discord.py-self`).
|
||||||
|
|
||||||
|
### v0.1.2
|
||||||
|
|
||||||
|
- `__version__` is now derived from installed package metadata
|
||||||
|
(`importlib.metadata.version("dpy_cache")`) instead of a hardcoded string, so it can
|
||||||
|
no longer drift from the `pyproject.toml` version that the release tag is cut from. A
|
||||||
|
not-installed/editable checkout falls back to a literal that is kept in sync with the
|
||||||
|
current `pyproject.toml` version at each release.
|
||||||
|
|
||||||
### v0.1.1
|
### v0.1.1
|
||||||
|
|
||||||
- `cache()` now rejects a duplicate filename in a **list** input with `DPYCacheError`
|
- `cache()` now rejects a duplicate filename in a **list** input with `DPYCacheError`
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "dpy_cache"
|
name = "dpy_cache"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
description = "Persist images/files to a Discord storage channel and get durable, re-resolvable CDN references — config-free, injectable, installable."
|
description = "Persist images/files to a Discord storage channel and get durable, re-resolvable CDN references — config-free, injectable, installable."
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
see :mod:`dpy_cache.dpy_cache` for the full module docstring, api, and error contract
|
see :mod:`dpy_cache.dpy_cache` for the full module docstring, api, and error contract
|
||||||
"""
|
"""
|
||||||
|
from importlib.metadata import PackageNotFoundError, version
|
||||||
|
|
||||||
from .dpy_cache import (
|
from .dpy_cache import (
|
||||||
MAX_ATTACHMENTS_PER_MESSAGE,
|
MAX_ATTACHMENTS_PER_MESSAGE,
|
||||||
CacheResult,
|
CacheResult,
|
||||||
@@ -11,7 +13,10 @@ from .dpy_cache import (
|
|||||||
FileRef,
|
FileRef,
|
||||||
)
|
)
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
try:
|
||||||
|
__version__ = version("dpy_cache")
|
||||||
|
except PackageNotFoundError:
|
||||||
|
__version__ = "0.1.2"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"DPYCache",
|
"DPYCache",
|
||||||
|
|||||||
Reference in New Issue
Block a user