Skip to content

Commit 28b2c01

Browse files
authored
Merge pull request #242 from harikitech/topic/use_hatch_vcs
Use hatch-vcs
2 parents b6179ec + aa309f5 commit 28b2c01

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
__version__ = "3.0.0"
1+
try:
2+
from ._version import __version__, __version_tuple__
3+
except ImportError:
4+
__version__ = "unknown"
5+
__version_tuple__ = ()
6+
7+
__all__ = [
8+
"__version__",
9+
"__version_tuple__",
10+
]

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = [
33
"hatchling>=1.25",
4+
"hatch-vcs>=0.5.0",
45
]
56
build-backend = "hatchling.build"
67

@@ -117,7 +118,7 @@ plugins = [
117118
django_settings_module = "tests.settings"
118119

119120
[tool.hatch.version]
120-
path = "django_elastipymemcache/__init__.py"
121+
source = "vcs"
121122

122123
[tool.hatch.build.targets.sdist]
123124
include = [

tests/smoke_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ def test_import_and_version() -> None:
22
import django_elastipymemcache
33

44
assert hasattr(django_elastipymemcache, "__version__")
5+
assert django_elastipymemcache.__version__ != "unknown"
6+
assert hasattr(django_elastipymemcache, "__version__tuple__")
7+
assert django_elastipymemcache.__version_tuple__ != ()
58

69

710
def test_backend_importable() -> None:

0 commit comments

Comments
 (0)