Skip to content

Commit

Permalink
Update version setup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones committed Apr 12, 2024
1 parent e0a1115 commit 8a995ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 7 additions & 5 deletions carbonplan_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

import os
import pathlib
from importlib.metadata import PackageNotFoundError as _PackageNotFoundError
from importlib.metadata import version as _version

import intake
from pkg_resources import DistributionNotFound, get_distribution

try:
version = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
version = "0.0.0" # pragma: no cover
__version__ = version
__version__ = _version(__name__)
except _PackageNotFoundError:
# package is not installed
__version__ = "unknown"


CATALOG_DIR_PATH = pathlib.Path(__file__)
MASTER_CATALOG_PATH = str(CATALOG_DIR_PATH.parent / "catalogs/master.yaml")
Expand Down
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,8 @@ repository = "https://github.com/carbonplan/data"
include = ["carbonplan_data*"]

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"
fallback_version = "999"
write_to = "carbonplan_data/_version.py"
write_to_template = '__version__ = "{version}"'


# [tool.setuptools.dynamic]
# version = { attr = "carbonplan_data.__version__" }


[tool.black]
Expand Down

0 comments on commit 8a995ce

Please sign in to comment.