Skip to content

Use setuptools-scm for packge version handling #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ build

# Documentation
docs/build/

# setuptools-scm
xskillscore/_version.py
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Internal Changes
:py:func:`warnings.filterwarnings`. (:pr:`426`) `Trevor James Smith`_
- The minimum supported versions for several dependencies have been
updated. (:pr:`426`) `Trevor James Smith`_
- `xskillscore` now uses `setuptools-scm` to automatically determine the
version number. (:pr:`427`) `Trevor James Smith`_


xskillscore v0.0.26 (2024-03-10)
Expand Down
1 change: 1 addition & 0 deletions docs/source/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Contributors
* mcsitter (`github <https://github.com/mcsitter/>`__)
* Ray Bell (`github <https://github.com/raybellwaves/>`__
* Riley X. Brady (`github <https://github.com/bradyrx/>`__)
* Trevor James Smith (`github <https://github.com/Zeitsperre/>`__)
* Zachary Blackwood (`github <https://github.com/blackary/>`__)

For a list of all the contributions, see the github
Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "xskillscore"
version = "0.0.26"
dependencies = [
"dask[array] >=2023.4.0",
"numpy >=1.24",
Expand Down Expand Up @@ -33,15 +32,14 @@ classifiers = [
]
requires-python = ">=3.9"
license = {file = "LICENSE.txt"}
dynamic = ["readme"]
dynamic = ["readme", "version"]

[project.optional-dependencies]
accel = ["bottleneck", "numba>=0.52"]
accel = ["bottleneck", "numba >=0.57"]
test = [
"bottleneck",
"xskillscore[accel]",
"cftime",
"matplotlib",
"numba >=0.57",
"pre-commit",
"pytest",
"pytest-cov",
Expand Down Expand Up @@ -73,6 +71,7 @@ packages = ["xskillscore"]

[tool.setuptools_scm]
fallback_version = "9999"
version_file = "xskillscore/_version.py"

[tool.setuptools.dynamic]
readme = {file = ["README.rst"], content-type = "text/markdown"}
Expand Down
8 changes: 7 additions & 1 deletion xskillscore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib.metadata import version, PackageNotFoundError

# ruff: noqa
from xskillscore.core import resampling
from xskillscore.core.accessor import XSkillScoreAccessor
Expand Down Expand Up @@ -37,4 +39,8 @@
from xskillscore.core.stattests import multipletests
from xskillscore.versioning.print_versions import show_versions

__version__ = "0.0.26"
try:
__version__ = version("xskillscore")
except PackageNotFoundError:
# package is not installed
pass
Loading