Skip to content

Commit 9c2c448

Browse files
EliEli
authored andcommitted
Corrected name of project from 'vtools3' to 'vtools' so that vtools.__version__ would be correct.
1 parent 1328ef8 commit 9c2c448

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61", "wheel", "setuptools-scm"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "vtools3"
6+
name = "vtools"
77
dynamic = ["version"] # Placeholder; setuptools-scm will manage this
88
description = "Timeseries analysis and processing tools using pandas/xarray"
99
readme = "README.md"
@@ -14,12 +14,11 @@ license-files = [
1414
authors = [
1515
{ name = "California Department of Water Resources", email = "Eli.Ateljevich@water.ca.gov"}
1616
]
17-
requires-python = ">=3.6"
17+
requires-python = ">=3.9"
1818
classifiers = [
19-
"Programming Language :: Python :: 3.6",
20-
"Programming Language :: Python :: 3.7",
21-
"Programming Language :: Python :: 3.8",
22-
"Programming Language :: Python :: 3.9"
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11"
2322
]
2423
keywords = ["vtools"]
2524
dependencies = [

vtools/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@
77
import sys
88

99
try:
10-
from ._version import __version__
10+
from importlib.metadata import version, PackageNotFoundError
1111
except ImportError:
12-
__version__ = "0.0.0" # fallback for weird dev cases
12+
from pkg_resources import get_distribution, DistributionNotFound
13+
def version(pkg): return get_distribution(pkg).version
14+
PackageNotFoundError = DistributionNotFound
15+
16+
try:
17+
__version__ = version("vtools")
18+
except PackageNotFoundError:
19+
# Fallback for running from a VCS checkout without installation
20+
try:
21+
from setuptools_scm import get_version
22+
__version__ = get_version(root="..", relative_to=__file__)
23+
except Exception:
24+
__version__ = "unknown"
1325

1426
from vtools.data.gap import *
1527
from vtools.data.vtime import *

0 commit comments

Comments
 (0)