Skip to content

Commit

Permalink
Single-source the version from ppl/__init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Feb 17, 2024
1 parent 2f72b69 commit ce977cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
13 changes: 3 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,9 @@
# built documents.
#
# The short X.Y version.
import configparser
config = configparser.ConfigParser(allow_no_value=True)
try:
with open("../../setup.cfg", encoding='utf-8') as f:
config.read_string(f.read())
except TypeError:
# NOTE: encoding is not a keyword in Python 2
with open("../../setup.cfg") as f:
config.read_string(f.read().decode('utf-8'))
version = release = config['metadata']['version']
from ppl import __version__ as release

version = release

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 2 additions & 0 deletions ppl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
Remove the _mutable_immutable class.
"""

__version__ = "0.8.8"

from .linear_algebra import (
Variable, Variables_Set, Linear_Expression,
)
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ build-backend = "setuptools.build_meta"

[project]
name = "pplpy"
version = "0.8.8"
description = "Python PPL wrapper"
readme = "README.rst"
authors = [{name = "Vincent Delecroix", email = "[email protected]"}]
Expand Down Expand Up @@ -39,6 +38,7 @@ dependencies = [
"cysignals",
"gmpy2>=2.1.0b1",
]
dynamic = ["version"]

[project.optional-dependencies]
doc = [
Expand All @@ -54,5 +54,8 @@ packages = ["ppl"]
platforms = ["any"]
include-package-data = false

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

[tool.setuptools.package-data]
ppl = ["*.pxd", "*.h", "*.hh"]

0 comments on commit ce977cd

Please sign in to comment.