Skip to content
Closed
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
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "tobac"
version = "1.6.1"
authors = [
{ name="Max Heikenfeld", email="max.heikenfeld@physics.ox.ac.uk" },
{ name="William Jones", email="william.jones@physics.ox.ac.uk" },
{ name="Fabian Senf", email="senf@tropos.de" },
{ name="Sean Freeman", email="sean.freeman@uah.edu" },
{ name="Julia Kukulies", email="kukulies@ucar.edu" },
{ name="Kelcy Brunner", email="Kelcy.Brunner@ttu.edu" },
]
description = "A package for identifying and tracking atmospheric phenomena"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
]

[project.urls]
Homepage = "http://github.com/tobac-project/tobac"
Documentation = "http://tobac.io"
Issues = "http://github.com/tobac-project/tobac/issues"
22 changes: 0 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,6 @@ def get_packages(package_name):


setup(
name=PACKAGE_NAME,
version=get_version(PACKAGE_NAME),
description="Tracking and object-based analysis of clouds",
url="http://github.com/tobac-project/tobac",
classifiers=CLASSIFIERS,
author=[
"Max Heikenfeld",
"William Jones",
"Fabian Senf",
"Sean Freeman",
"Julia Kukulies",
"Peter Marinescu",
],
author_email=[
"max.heikenfeld@physics.ox.ac.uk",
"william.jones@physics.ox.ac.uk",
"senf@tropos.de",
"sean.freeman@uah.edu",
"julia.kukulies@gu.se",
"peter.marinescu@colostate.edu",
],
license="BSD-3-Clause License",
packages=get_packages(PACKAGE_NAME),
install_requires=get_requirements("requirements.txt"),
test_requires=["pytest"],
Expand Down
25 changes: 24 additions & 1 deletion tobac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,29 @@
from .wrapper import maketrack
from .wrapper import tracking_wrapper
from . import merge_split
import importlib.metadata
import pathlib

# default version number
__version__ = "unknown_dev_version"

# Set version number
__version__ = "1.6.1"
# This version should work without needing the package installed
try:
__version__ = importlib.metadata.version(__package__ or __name__)
except importlib.metadata.PackageNotFoundError:
# need to get version directly from text file
try:
import tomllib

pyproject_toml_file_name = pathlib.Path(__file__).parent / "pyproject.toml"
if pyproject_toml_file_name.exists() and pyproject_toml_file_name.is_file():
toml_data = tomllib.load(pyproject_toml_file_name)
if "project" in toml_data and "version" in toml_data["project"]:
version = toml_data["project"]["version"]

except ImportError:
# on python <3.11 but not installing tobac.
# don't bother giving precise version number.
__version__ = "unknown_dev_version"
pass
5 changes: 4 additions & 1 deletion tobac/tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ def test_version():
# Make sure that we are following semantic versioning
# i.e., our version is of form x.x.x, where x are all
# integer numbers.
assert re.match(r"[0-9]+\.[0-9]+\.[0-9]+", tobac.__version__) is not None
assert (
re.match(r"[0-9]+\.[0-9]+\.[0-9]+", tobac.__version__) is not None
or tobac.__version__ == "unknown_dev_version"
)
Loading