From 9f81db8eeb800ff97833244567735bd571a6c346 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Tue, 18 Jul 2023 17:12:34 +0200 Subject: [PATCH] Bla --- cpp_src/lasp_config.h.in | 3 --- cpp_src/lasp_cpp.cpp | 7 ------- pyproject.toml | 12 ++++++++---- python_src/lasp/__init__.py | 7 +++++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/cpp_src/lasp_config.h.in b/cpp_src/lasp_config.h.in index c71b8e9..af309b9 100644 --- a/cpp_src/lasp_config.h.in +++ b/cpp_src/lasp_config.h.in @@ -9,9 +9,6 @@ #ifndef LASP_CONFIG_H #define LASP_CONFIG_H -const int LASP_VERSION_MAJOR = @CMAKE_PROJECT_VERSION_MAJOR@; -const int LASP_VERSION_MINOR = @CMAKE_PROJECT_VERSION_MINOR@; - /* Debug flag */ #cmakedefine01 LASP_DEBUG diff --git a/cpp_src/lasp_cpp.cpp b/cpp_src/lasp_cpp.cpp index f541f1b..d5c7f76 100644 --- a/cpp_src/lasp_cpp.cpp +++ b/cpp_src/lasp_cpp.cpp @@ -52,12 +52,5 @@ PYBIND11_MODULE(lasp_cpp, m) { init_datahandler(m); init_siggen(m); - // We store the version number of the code via CMake, and create an - // attribute in the C++ code. - m.attr("__version__") = std::to_string(LASP_VERSION_MAJOR) + "." + - std::to_string(LASP_VERSION_MINOR); - - m.attr("LASP_VERSION_MAJOR") = LASP_VERSION_MAJOR; - m.attr("LASP_VERSION_MINOR") = LASP_VERSION_MINOR; } /** @} */ diff --git a/pyproject.toml b/pyproject.toml index fa45bde..f1611a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires-python = ">=3.10" description = "Library for Acoustic Signal Processing" license = { "file" = "LICENSE" } authors = [{ "name" = "J.A. de Jong", "email" = "j.a.dejong@ascee.nl" }] -dynamic = ["version"] +version = "1.0" keywords = ["DSP", "DAQ", "Signal processing"] @@ -26,7 +26,7 @@ dependencies = ["scipy", "numpy", "matplotlib", "appdirs", "dataclasses_json", "h5py", "pybind11"] [build-system] # How pip and other frontends should build this project -requires = ["py-build-cmake~=0.1.8", "setuptools_scm[toml]>=6.2"] +requires = ["py-build-cmake~=0.1.8" ] build-backend = "py_build_cmake.build" [tool.py-build-cmake.module] # Where to find the Python module to package @@ -42,5 +42,9 @@ source_path = "." build_args = ["-j"] install_components = ["python_modules"] -[tool.setuptools_scm] -version_file = ["python_src/lasp/_version.py" , "cpp_src/_version.txt"] +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_scheme = "semver" +version_provider = "pep621" +update_changelog_on_bump = true diff --git a/python_src/lasp/__init__.py b/python_src/lasp/__init__.py index 7cfbdc5..e6537f1 100644 --- a/python_src/lasp/__init__.py +++ b/python_src/lasp/__init__.py @@ -2,9 +2,12 @@ LASP: Library for Acoustic Signal Processing """ -from ._version import * + from .lasp_cpp import * -import lasp.lasp_cpp +from ._version import __version__, __version_tuple__ + +LASP_VERSION_MAJOR = __version_tuple__[0] +LASP_VERSION_MINOR = __version_tuple__[1] from .lasp_common import * # from .lasp_imptube import * # TwoMicImpedanceTube