Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit 4cb72fb

Browse files
authored
Fix version (#113)
* fix version * Update conf.py
1 parent 6533f6c commit 4cb72fb

File tree

8 files changed

+68
-57
lines changed

8 files changed

+68
-57
lines changed

datatree/__init__.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
# flake8: noqa
2-
# Ignoring F401: imported but unused
3-
4-
from pkg_resources import DistributionNotFound, get_distribution
5-
61
# import public API
72
from .datatree import DataTree
83
from .io import open_datatree
94
from .mapping import TreeIsomorphismError, map_over_subtree
105

116
try:
12-
__version__ = get_distribution(__name__).version
13-
except DistributionNotFound: # noqa: F401; pragma: no cover
14-
# package is not installed
15-
pass
7+
# NOTE: the `_version.py` file must not be present in the git repository
8+
# as it is generated by setuptools at install time
9+
from ._version import __version__
10+
except ImportError: # pragma: no cover
11+
# Local copy or not installed with setuptools
12+
__version__ = "999"
13+
14+
__all__ = (
15+
"DataTree",
16+
"open_datatree",
17+
"TreeIsomorphismError",
18+
"map_over_subtree",
19+
"__version__",
20+
)

datatree/tests/test_version.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import datatree
2+
3+
4+
def test_version():
5+
assert datatree.__version__ != "999"

dev-requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
# built documents.
7979
#
8080
# The short X.Y version.
81-
version = "0.0.1" # datatree.__version__
81+
version = datatree.__version__
8282
# The full version, including alpha/beta/rc tags.
83-
release = "0.0.1" # datatree.__version__
83+
release = datatree.__version__
8484

8585
# The language for content autogenerated by Sphinx. Refer to documentation
8686
# for a list of supported languages.

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"setuptools_scm[toml]>=3.4",
6+
"setuptools_scm_git_archive",
7+
]
8+
9+
[tool.setuptools_scm]
10+
write_to = "datatree/_version.py"
11+
write_to_template = '''
12+
# Do not change! Do not track in version control!
13+
__version__ = "{version}"
14+
'''

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cfg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
[metadata]
2+
name = xarray-datatree
3+
description = Hierarchical tree-like data structures for xarray
4+
long_description_content_type=text/markdown
5+
long_description = file: README.md
6+
url = https://github.com/xarray-contrib/datatree
7+
author = Thomas Nicholas
8+
author_email = [email protected]
9+
license = Apache
10+
classifiers =
11+
Development Status :: 3 - Alpha
12+
Intended Audience :: Science/Research
13+
Topic :: Scientific/Engineering
14+
License :: OSI Approved :: Apache Software License
15+
Operating System :: OS Independent
16+
Programming Language :: Python
17+
Programming Language :: Python :: 3.8
18+
Programming Language :: Python :: 3.9
19+
Programming Language :: Python :: 3.10
20+
21+
[options]
22+
packages = find:
23+
python_requires = >=3.8
24+
install_requires =
25+
xarray >=2022.05.0.dev0
26+
27+
[options.packages.find]
28+
exclude =
29+
docs
30+
tests
31+
tests.*
32+
docs.*
33+
134
[flake8]
235
ignore =
336
E203 # whitespace before ':' - doesn't work well with black

setup.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)