mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-17 16:29:56 +02:00
Merge pull request #53 from cdtools-developers/version_source_of_truth
Add cdtools.__version__ and set it up so that there is a single source of truth for the version number
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
import setuptools
|
||||
import os
|
||||
import re
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
# read version from src/cdtools/_version.py
|
||||
version_file = os.path.join("src/cdtools", "_version.py")
|
||||
with open(version_file) as f:
|
||||
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
|
||||
if not version_match:
|
||||
raise RuntimeError("Unable to find version string.")
|
||||
version = version_match.group(1)
|
||||
|
||||
setuptools.setup(
|
||||
name="cdtools-py",
|
||||
version="0.3.0",
|
||||
version=version,
|
||||
python_requires='>3.8', # recommended minimum version for pytorch 2.3.0
|
||||
author="Abe Levitan",
|
||||
author_email="abraham.levitan@psi.ch",
|
||||
|
||||
@@ -6,6 +6,8 @@ warnings.filterwarnings("ignore",
|
||||
|
||||
__all__ = ['tools', 'datasets', 'models', 'reconstructors']
|
||||
|
||||
from ._version import __version__
|
||||
|
||||
from cdtools import tools
|
||||
from cdtools import datasets
|
||||
from cdtools import models
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
__version__ = "0.3.1.dev"
|
||||
Reference in New Issue
Block a user