diff --git a/docs/DOCS_VERSION b/docs/DOCS_VERSION new file mode 100644 index 0000000..992977a --- /dev/null +++ b/docs/DOCS_VERSION @@ -0,0 +1 @@ +v1.1.0 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 8b1ae73..bf47c93 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,13 +1,19 @@ # Configuration file for the Sphinx documentation builder. +import pathlib # -- Project information +with open("DOCS_VERSION", 'r') as f: + version = f.read().strip() + +release = version + project = 'torchflows' copyright = '2024, David Nabergoj' author = 'David Nabergoj' -release = '1.0' -version = '1.0.6' +# release = f'{torchflows.__version__}' +# version = f'{torchflows.__version__}' # -- General configuration diff --git a/docs/source/conf.py b/docs/source/conf.py index bc399a8..4211bb7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,18 +2,18 @@ # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +import pathlib # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -import pathlib -import sys -sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()) +with open("../DOCS_VERSION", 'r') as f: + version = f.read().strip() project = 'Torchflows' copyright = '2024, David Nabergoj' author = 'David Nabergoj' -release = '1.0.2' +release = f'{version}' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 803ec33..e08352c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "torchflows" -version = "1.0.6" +dynamic = ["version"] authors = [ { name = "David Nabergoj", email = "david.nabergoj@fri.uni-lj.si" }, ] diff --git a/setup.py b/setup.py index 45735b1..40361b6 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,26 @@ from setuptools import setup, find_packages +from distutils.util import convert_path import pathlib +import sys -here = pathlib.Path(__file__).parent.resolve() -long_description = (here / "README.md").read_text(encoding="utf-8") +root = pathlib.Path(__file__).parent.resolve() +sys.path.append(root.as_posix()) + +main_ns = {} +ver_path = convert_path('torchflows/_version.py') +with open(ver_path) as ver_file: + exec(ver_file.read(), main_ns) + +long_description = (root / "README.md").read_text(encoding="utf-8") setup( - name="normalizing-flows", - version="1.0.4", + name="Torchflows", + version=main_ns['__version__'], description="Modern normalizing flows in Python", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/davidnabergoj/normalizing-flows", + url="https://github.com/davidnabergoj/torchflows", author="David Nabergoj", author_email="david.nabergoj@fri.uni-lj.si", classifiers=[ # Optional @@ -43,6 +52,6 @@ "tqdm" ], project_urls={ - "Bug Reports": "https://github.com/davidnabergoj/normalizing-flows/issues", + "Bug Reports": "https://github.com/davidnabergoj/torchflows/issues", }, ) diff --git a/torchflows/__init__.py b/torchflows/__init__.py index 1a7460a..313943c 100644 --- a/torchflows/__init__.py +++ b/torchflows/__init__.py @@ -27,6 +27,7 @@ from torchflows.bijections.continuous.ffjord import FFJORD from torchflows.bijections.continuous.ddnf import DeepDiffeomorphicBijection from torchflows.bijections.continuous.otflow import OTFlow +from torchflows._version import __version__ __all__ = [ 'NICE', @@ -46,10 +47,11 @@ 'ProximalResFlow', 'Radial', 'Planar', - 'InverseSylvester', + 'Sylvester', 'ElementwiseShift', 'ElementwiseAffine', 'ElementwiseRQSpline', 'Flow', 'FlowMixture', + '__version__' ] diff --git a/torchflows/_version.py b/torchflows/_version.py new file mode 100644 index 0000000..2f0abb8 --- /dev/null +++ b/torchflows/_version.py @@ -0,0 +1 @@ +__version__ = "v1.1.0"