Skip to content

Commit 00fccf7

Browse files
authored
use pyproject.toml and setuptools_scm (#13)
* use pyproject.toml and setuptools_scm * use correct package
1 parent 9b26708 commit 00fccf7

File tree

6 files changed

+32
-2
lines changed

6 files changed

+32
-2
lines changed

.git_archival.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true)$
4+
ref-names: $Format:%D$

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

mplotutils/__init__.py

+15
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44
from .cartopy_utils import *
55
from .colorbar_utils import *
66
from .mpl_utils import *
7+
8+
try:
9+
from importlib.metadata import version as _get_version
10+
except ImportError:
11+
# importlib.metadata not available in python 3.7
12+
import pkg_resources
13+
14+
_get_version = lambda pkg: pkg_resources.get_distribution(pkg).version
15+
16+
try:
17+
__version__ = _get_version("mplotutils")
18+
except Exception:
19+
# Local copy or not installed with setuptools.
20+
# Disable minimum version checks on downstream libraries.
21+
__version__ = "999"

mplotutils/version.py

-1
This file was deleted.

pyproject.toml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"setuptools_scm[toml]>=7.0",
6+
]
7+
build-backend = "setuptools.build_meta"
8+
9+
[tool.setuptools_scm]
10+
fallback_version = "999"
11+
version_scheme = "no-guess-dev"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup()
3+
setup(use_scm_version={"fallback_version": "999", "version_scheme": "no-guess-dev"})

0 commit comments

Comments
 (0)