Skip to content

Commit

Permalink
adopt setuptools-scm for auto versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Jun 29, 2022
1 parent 32b515b commit dd101a1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*.py[co]

# setuptools-scm
_version.py

# Environment file which should be autogenerated
*conda_requirements.txt*

Expand Down
7 changes: 3 additions & 4 deletions lib/iris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,18 @@ def callback(cube, field, filename):
import threading

import iris._constraints
from iris._deprecation import IrisDeprecation, warn_deprecated
import iris.config
import iris.io

from ._deprecation import IrisDeprecation, warn_deprecated
from ._version import version as __version__ # noqa: F401

try:
import iris_sample_data
except ImportError:
iris_sample_data = None


# Iris revision.
__version__ = "3.3.dev0"

# Restrict the names imported when using "from iris import *"
__all__ = [
"AttributeConstraint",
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
[build-system]
# Defined by PEP 518
requires = [
"setuptools>=40.8.0",
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"setuptools_scm_git_archive",
"wheel",
]
# Defined by PEP 517
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "lib/iris/_version.py"
local_scheme = "dirty-tag"

[tool.black]
line-length = 79
Expand Down
4 changes: 3 additions & 1 deletion requirements/ci/py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ dependencies:
- python =3.8

# Setup dependencies.
- setuptools >=40.8.0
- setuptools >=45
- setuptools_scm >=6.2
- setuptools_scm_git_archive

# Core dependencies.
- cartopy >=0.20
Expand Down
4 changes: 3 additions & 1 deletion requirements/ci/py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ dependencies:
- python =3.9

# Setup dependencies.
- setuptools >=40.8.0
- setuptools >=45
- setuptools_scm >=6.2
- setuptools_scm_git_archive

# Core dependencies.
- cartopy >=0.20
Expand Down

0 comments on commit dd101a1

Please sign in to comment.