Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
fix(__version__): reintroduce __version__ variable into PyDynamic/__i…
Browse files Browse the repository at this point in the history
…nit__.py

Reintroduce version variable
  • Loading branch information
BjoernLudwigPTB committed Oct 14, 2021
2 parents e0770fc + 95761b7 commit 0349b09
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
recursive-include src/PyDynamic/examples/uncertainty_for_dft *.dat
graft src/PyDynamic/examples/uncertainty_for_dft
graft requirements
prune test
include licence.txt
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[semantic_release]
version_variable=setup.py:current_release_version,docs/conf.py:version
version_variable=src/PyDynamic/__init__.py:__version__,docs/conf.py:version
version_source=commit
upload_to_pypi=true
upload_to_release=true
Expand Down
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Install PyDynamic in Python path and provide all packaging metadata."""
import codecs
from os import path

from setuptools import find_packages, setup

current_release_version = "1.10.0"


def get_readme():
"""Get README.md's content"""
Expand All @@ -13,6 +12,23 @@ def get_readme():
return f.read()


def read(rel_path):
here = path.abspath(path.dirname(__file__))
with codecs.open(path.join(here, rel_path), "r") as fp:
return fp.read()


def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")


current_release_version = get_version("src/PyDynamic/__init__.py")

setup(
metadata_version="2.1",
name="PyDynamic",
Expand Down
15 changes: 8 additions & 7 deletions src/PyDynamic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
-uptake-of-nmi-calibrations-of-dynamic-force-torque-and/>`_
- `GitHub website <https://www.github.com/PTB-M4D/PyDynamic>`_
"""

from .deconvolution.fit_filter import LSFIR_unc, LSFIR_uncMC, LSIIR_unc
from .identification.fit_transfer import fit_sos

from .misc import *
from .model_estimation import *
from .uncertainty import *
__version__ = "1.10.0"

__all__ = [
"invLSFIR",
Expand Down Expand Up @@ -74,3 +68,10 @@
"is_2d_matrix",
"number_of_rows_equals_vector_dim",
]

from .deconvolution.fit_filter import LSFIR_unc, LSFIR_uncMC, LSIIR_unc
from .identification.fit_transfer import fit_sos

from .misc import *
from .model_estimation import *
from .uncertainty import *

0 comments on commit 0349b09

Please sign in to comment.