Skip to content

Commit 3066aa4

Browse files
authored
use setuptools_scm for versioning (#14)
* use setuptools_scm * actually use setuptools_scm
1 parent b221cb0 commit 3066aa4

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

pintxarray/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
try:
2+
from importlib.metadata import version
3+
except ImportError:
4+
from importlib_metadata import version
5+
16
from .accessors import PintDataArrayAccessor, PintDatasetAccessor # noqa
7+
8+
try:
9+
__version__ = version("pint-xarray")
10+
except Exception:
11+
# Local copy or not installed with setuptools.
12+
# Disable minimum version checks on downstream libraries.
13+
__version__ = "999"

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[build-system]
2-
requires = ["setuptools >= 41", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools >= 42", "wheel", "setuptools_scm[toml] >= 3.4"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[metadata]
22
name = pint-xarray
3-
version = 0.0.1
43
author = Tom Nicholas
54
author_email = [email protected]
65
description = Physical units interface to xarray using Pint
@@ -9,7 +8,11 @@ url = https://github.com/TomNicholas/pint-xarray
98
[options]
109
packages = find:
1110
python_requires = >=3.6
12-
install_requires = numpy>=1.17.1; xarray>=0.15.1; pint>=0.12
11+
install_requires =
12+
numpy >= 1.17.1
13+
xarray >= 0.15.1
14+
pint >= 0.13
15+
importlib-metadata; python_version < "3.8"
1316

1417
[flake8]
1518
ignore =

0 commit comments

Comments
 (0)