From 695e1904e40b3fd0791c02e3031d4e16def299e4 Mon Sep 17 00:00:00 2001 From: pveigadecamargo Date: Wed, 14 Aug 2024 13:05:33 +1000 Subject: [PATCH] Package versioning --- docs/source/_static/switcher.json | 10 +++++----- docs/source/conf.py | 3 ++- docs/website/redir.py | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/source/_static/switcher.json b/docs/source/_static/switcher.json index 18523ecb4..0e090b25d 100644 --- a/docs/source/_static/switcher.json +++ b/docs/source/_static/switcher.json @@ -4,16 +4,16 @@ "version": "develop", "url": "https://aequilibrae.com/python/develop/" }, + { + "name": "1.1.1", + "version": "1.1.1", + "url": "https://aequilibrae.com/python/V.1.1.1/" + }, { "name": "1.1.0", "version": "1.1.0", "url": "https://aequilibrae.com/python/V.1.1.0/" }, - { - "name": "1.0.2", - "version": "1.0.2", - "url": "https://aequilibrae.com/python/V.1.0.2/" - }, { "name": "1.0.1", "version": "1.0.1", diff --git a/docs/source/conf.py b/docs/source/conf.py index d45471e02..c62812031 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,6 +17,7 @@ from datetime import datetime from pathlib import Path from sphinx_gallery.sorting import ExplicitOrder +import pkg_resources project_dir = Path(__file__).parent.parent.parent if str(project_dir) not in sys.path: @@ -27,7 +28,7 @@ if str(project_dir) not in sys.path: sys.path.insert(0, project_dir) -from __version__ import release_version +release_version = pkg_resources.get_distribution("aequilibrae").version # -- Project information ----------------------------------------------------- diff --git a/docs/website/redir.py b/docs/website/redir.py index c26694889..1633cd0d6 100644 --- a/docs/website/redir.py +++ b/docs/website/redir.py @@ -1,13 +1,13 @@ import os import sys import shutil +import pkg_resources npth = os.path.abspath(".") if npth not in sys.path: sys.path.append(npth) -from __version__ import release_version - +release_version = pkg_resources.get_distribution("aequilibrae").version version = f"V.{release_version}"