Skip to content
Snippets Groups Projects
Commit a983179d authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'RemoveSCM' into 'dev'

Remove scm

See merge request eclipse/aidge/aidge_core!277
parents 239b472c 46418bdd
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!277Remove scm
Pipeline #62217 passed
# general # general
.cache .cache
# C++ Build # C++ Build
build*/ build*/
install*/ install*/
cppcheck-result.xml cppcheck-result.xml
include/aidge/core_version.h
# VSCode # VSCode
.vscode .vscode
......
...@@ -3,17 +3,29 @@ set(CXX_STANDARD 14) ...@@ -3,17 +3,29 @@ set(CXX_STANDARD 14)
file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" version) file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" version)
# Parse version.txt to retrieve Major, Minor and Path
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" _ MATCHES ${version})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2})
set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3})
# Retrieve latest git commit
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
project(aidge_core project(aidge_core
VERSION ${version} VERSION ${version}
DESCRIPTION "Core algorithms for operators and graph of the AIDGE framework" DESCRIPTION "Core algorithms for operators and graph of the AIDGE framework"
LANGUAGES CXX) LANGUAGES CXX)
message(STATUS "Project name: ${CMAKE_PROJECT_NAME}")
message(STATUS "Project version: ${version}")
add_definitions(-DPROJECT_VERSION="${version}")
message(STATUS "Project name: ${CMAKE_PROJECT_NAME}") message(STATUS "Project name: ${CMAKE_PROJECT_NAME}")
message(STATUS "Project version: ${version}") message(STATUS "Project version: ${version}")
message(STATUS "Latest git commit: ${GIT_COMMIT_HASH}")
# helper for LSP users # helper for LSP users
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
...@@ -29,7 +41,6 @@ option(TEST "Enable tests" ON) ...@@ -29,7 +41,6 @@ option(TEST "Enable tests" ON)
option(COVERAGE "Enable coverage" OFF) option(COVERAGE "Enable coverage" OFF)
option(ENABLE_ASAN "Enable ASan (AddressSanitizer) for runtime analysis of memory use (over/underflow, memory leak, ...)" OFF) option(ENABLE_ASAN "Enable ASan (AddressSanitizer) for runtime analysis of memory use (over/underflow, memory leak, ...)" OFF)
############################################## ##############################################
# Import utils CMakeLists # Import utils CMakeLists
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
...@@ -168,6 +179,13 @@ if(NOT $ENV{AIDGE_INSTALL} STREQUAL "") ...@@ -168,6 +179,13 @@ if(NOT $ENV{AIDGE_INSTALL} STREQUAL "")
message(WARNING "CMAKE_INSTALL_PREFIX set to env variable AIDGE_INSTALL by default = ${CMAKE_INSTALL_PREFIX}") message(WARNING "CMAKE_INSTALL_PREFIX set to env variable AIDGE_INSTALL by default = ${CMAKE_INSTALL_PREFIX}")
endif() endif()
message(STATUS "Creating ${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/core_version.h")
# Generate version.h file from config file version.h.in
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/version.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/core_version.h"
)
include(GNUInstallDirs) include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}) set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})
......
...@@ -13,4 +13,3 @@ import aidge_core.utils ...@@ -13,4 +13,3 @@ import aidge_core.utils
from aidge_core.aidge_export_aidge import serialize_to_cpp from aidge_core.aidge_export_aidge import serialize_to_cpp
from aidge_core.show_graphview import gview_to_json from aidge_core.show_graphview import gview_to_json
from aidge_core.mem_info import * from aidge_core.mem_info import *
from ._version import *
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifndef AIDGE_IMPORTS_H_ #ifndef AIDGE_IMPORTS_H_
#define AIDGE_IMPORTS_H_ #define AIDGE_IMPORTS_H_
#include "aidge/core_version.h"
#include "aidge/backend/OperatorImpl.hpp" #include "aidge/backend/OperatorImpl.hpp"
#include "aidge/backend/TensorImpl.hpp" #include "aidge/backend/TensorImpl.hpp"
...@@ -92,5 +93,6 @@ ...@@ -92,5 +93,6 @@
#include "aidge/utils/Random.hpp" #include "aidge/utils/Random.hpp"
#include "aidge/utils/Registrar.hpp" #include "aidge/utils/Registrar.hpp"
#include "aidge/utils/Types.h" #include "aidge/utils/Types.h"
#include "aidge/utils/sys_info/CoreVersionInfo.hpp"
#endif /* AIDGE_IMPORTS_H_ */ #endif /* AIDGE_IMPORTS_H_ */
#ifndef AIDGE_UTILS_SYS_INFO_CORE_VERSION_INFO_H
#define AIDGE_UTILS_SYS_INFO_CORE_VERSION_INFO_H
#include "aidge/utils/Log.hpp"
#include "aidge/core_version.h"
namespace Aidge {
constexpr inline const char * getCoreProjectVersion(){
return PROJECT_VERSION;
}
constexpr inline const char * getCoreGitHash(){
return PROJECT_GIT_HASH;
}
void showCoreVersion() {
Log::info("Aidge core: {} ({}), {} {}", getCoreProjectVersion(), getCoreGitHash(), __DATE__, __TIME__);
// Compiler version
#if defined(__clang__)
/* Clang/LLVM. ---------------------------------------------- */
Log::info("Clang/LLVM compiler version: {}.{}.{}\n", __clang_major__ , __clang_minor__, __clang_patchlevel__);
#elif defined(__ICC) || defined(__INTEL_COMPILER)
/* Intel ICC/ICPC. ------------------------------------------ */
Log::info("Intel ICC/ICPC compiler version: {}\n", __INTEL_COMPILER);
#elif defined(__GNUC__) || defined(__GNUG__)
/* GNU GCC/G++. --------------------------------------------- */
Log::info("GNU GCC/G++ compiler version: {}.{}.{}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#elif defined(_MSC_VER)
/* Microsoft Visual Studio. --------------------------------- */
Log::info("Microsoft Visual Studio compiler version: {}\n", _MSC_VER);
#else
Log::info("Unknown compiler\n");
#endif
}
} // namespace Aidge
#endif // AIDGE_UTILS_SYS_INFO_CORE_VERSION_INFO_H
#ifndef VERSION_H
#define VERSION_H
namespace Aidge {
static constexpr const int PROJECT_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
static constexpr const int PROJECT_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
static constexpr const int PROJECT_VERSION_PATCH = @PROJECT_VERSION_PATCH@;
static constexpr const char * PROJECT_VERSION = "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@";
static constexpr const char * PROJECT_GIT_HASH = "@GIT_COMMIT_HASH@";
}
#endif // VERSION_H
[project] [project]
name = "aidge_core" name="aidge_core"
description="Core algorithms for operators and graph of the AIDGE framework" description="Core algorithms for operators and graph of the AIDGE framework"
dependencies = [ dependencies = [
"numpy>=1.21.6", "numpy>=1.21.6",
...@@ -8,11 +9,18 @@ dependencies = [ ...@@ -8,11 +9,18 @@ dependencies = [
requires-python = ">= 3.7" requires-python = ">= 3.7"
readme = "README.md" readme = "README.md"
license = { file = "LICENSE" } license = { file = "LICENSE" }
classifiers = [ classifiers = [
"Development Status :: 2 - Pre-Alpha", "Development Status :: 2 - Pre-Alpha",
"Programming Language :: Python :: 3" "Programming Language :: Python :: 3"
] ]
dynamic = ["version"] # defined in tool.setuptools_scm dynamic = ["version"] # defined by pbr
[project.urls]
Homepage = "https://www.deepgreen.ai/en/platform"
Documentation = "https://eclipse-aidge.readthedocs.io/en/latest/"
Repository = "https://gitlab.eclipse.org/eclipse/aidge/aidge_core"
Issues = "https://gitlab.eclipse.org/eclipse/aidge/aidge_core/-/issues/"
Changelog = "https://gitlab.eclipse.org/eclipse/aidge/aidge_core/-/releases"
[project.optional-dependencies] [project.optional-dependencies]
test = [ test = [
...@@ -22,8 +30,8 @@ test = [ ...@@ -22,8 +30,8 @@ test = [
[build-system] [build-system]
requires = [ requires = [
"setuptools>=64", "setuptools>=64",
"setuptools_scm[toml]==7.1.0", "cmake>=3.18.4.post1",
"cmake>=3.18.4.post1" "pbr"
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
...@@ -40,11 +48,7 @@ exclude = [ # exclude packages matching these glob patterns (empty by default) ...@@ -40,11 +48,7 @@ exclude = [ # exclude packages matching these glob patterns (empty by default)
".unit_tests.static", ".unit_tests.static",
".aidge_export_aidge.__pycache__", ".aidge_export_aidge.__pycache__",
".aidge_export_aidge.utils.__pycache__", ".aidge_export_aidge.utils.__pycache__",
] ]
# SETUPTOOLS_SCM
[tool.setuptools_scm]
write_to = "aidge_core/_version.py"
##################################################### #####################################################
# CIBUILDWHEEL # CIBUILDWHEEL
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
namespace py = pybind11; namespace py = pybind11;
namespace Aidge { namespace Aidge {
void init_CoreSysInfo(py::module&);
void init_Random(py::module&); void init_Random(py::module&);
void init_Data(py::module&); void init_Data(py::module&);
void init_Database(py::module&); void init_Database(py::module&);
...@@ -104,6 +105,7 @@ void init_TensorUtils(py::module&); ...@@ -104,6 +105,7 @@ void init_TensorUtils(py::module&);
void init_Filler(py::module&); void init_Filler(py::module&);
void init_Aidge(py::module& m) { void init_Aidge(py::module& m) {
init_CoreSysInfo(m);
init_Random(m); init_Random(m);
init_Data(m); init_Data(m);
......
#include <pybind11/pybind11.h>
#include "aidge/utils/sys_info/CoreVersionInfo.hpp"
namespace py = pybind11;
namespace Aidge {
void init_CoreSysInfo(py::module& m){
m.def("show_version", &showCoreVersion);
m.def("get_project_version", &getCoreProjectVersion);
m.def("get_git_hash", &getCoreGitHash);
}
}
# pbr file
[metadata]
name = file: project_name.txt
version = file: version.txt
...@@ -10,7 +10,11 @@ from setuptools import setup, Extension ...@@ -10,7 +10,11 @@ from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
PROJECT_NAME = "aidge_core" def get_project_name() -> str:
return open(pathlib.Path().absolute() / "project_name.txt", "r").read().strip()
PROJECT_NAME = get_project_name()
SETUP_DIR = pathlib.Path(__file__).parent SETUP_DIR = pathlib.Path(__file__).parent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment