From a20102800e00aa3645a10af75986bbcf3c7f9398 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:43:14 +0300 Subject: [PATCH] Prepare pyconcept Windows package build --- .vscode/settings.json | 1 + ccl/CMakeLists.txt | 11 +++++------ pyconcept/MANIFEST.in | 1 + pyconcept/README.md | 3 +-- pyconcept/VERSION | 2 +- pyconcept/pyproject.toml | 3 ++- pyconcept/requirements-dev.txt | Bin 0 -> 140 bytes pyconcept/scripts/Build.ps1 | 28 ++++++++++++++++++---------- pyconcept/setup.cfg | 6 +++--- pyconcept/setup.py | 22 +++++++++------------- 10 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 pyconcept/requirements-dev.txt diff --git a/.vscode/settings.json b/.vscode/settings.json index 69f2595..eecda43 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,6 +16,7 @@ "cmake.ctestArgs": ["--test-dir build", "--output-on-failure"], "cmake.installPrefix": "output", "cSpell.words": [ + "conanfile", "coredll", "DCMAKE", "debool", diff --git a/ccl/CMakeLists.txt b/ccl/CMakeLists.txt index 39e370a..f561ff1 100644 --- a/ccl/CMakeLists.txt +++ b/ccl/CMakeLists.txt @@ -15,12 +15,6 @@ option(CC_UseSanitizers "Use sanitizers" FALSE) ## Compiler options include(cmake/CXXTargets.cmake) -## Import internal targets -add_subdirectory(cclCommons) -add_subdirectory(cclGraph) -add_subdirectory(cclLang) -add_subdirectory(rslang) - ## ## Project Setup ## @@ -92,6 +86,11 @@ install(TARGETS ${PROJECT_NAME} install(DIRECTORY core/include/ DESTINATION include) if(CC_BuildTests) + add_subdirectory(cclCommons) + add_subdirectory(cclGraph) + add_subdirectory(cclLang) + add_subdirectory(rslang) + enable_testing() add_subdirectory("core/test") endif() \ No newline at end of file diff --git a/pyconcept/MANIFEST.in b/pyconcept/MANIFEST.in index 0f2b8ed..f6c3482 100644 --- a/pyconcept/MANIFEST.in +++ b/pyconcept/MANIFEST.in @@ -5,4 +5,5 @@ graft tests graft cmake include CMakeLists.txt +include conanfile.txt recursive-include ccl * \ No newline at end of file diff --git a/pyconcept/README.md b/pyconcept/README.md index 7ba845f..f1c1fea 100644 --- a/pyconcept/README.md +++ b/pyconcept/README.md @@ -1,4 +1,3 @@ # pyconcept -Python wrapepr for C++ library for manipulating concepts in formal language of advanced set theory - +Python wrapper for C++ library for manipulating concepts in formal language of advanced set theory diff --git a/pyconcept/VERSION b/pyconcept/VERSION index e21e727..6c6aa7c 100644 --- a/pyconcept/VERSION +++ b/pyconcept/VERSION @@ -1 +1 @@ -1.4.0 \ No newline at end of file +0.1.0 \ No newline at end of file diff --git a/pyconcept/pyproject.toml b/pyconcept/pyproject.toml index 6c6d2b5..c1d8afc 100644 --- a/pyconcept/pyproject.toml +++ b/pyconcept/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "setuptools", "wheel", "ninja", - "cmake" + "cmake", + "conan" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/pyconcept/requirements-dev.txt b/pyconcept/requirements-dev.txt new file mode 100644 index 0000000000000000000000000000000000000000..05d2db382f9f7558433aed09263ad8ba2fa6f9d3 GIT binary patch literal 140 zcmXAhSqgwK5JU4VcptB$wc^&X(296@H5n None: super().__init__(name, sources=[]) - self.sourcedir = os.fspath(Path(source).resolve()) + self.source_dir = os.fspath(Path(source).resolve()) class CMakeBuild(build_ext): '''CMake builder extension.''' - def build_extension(self, ext: CMakeExtension) -> None: - ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) - output_folder = ext_fullpath.parent.resolve() + def build_extension(self, target: CMakeExtension) -> None: + target_fullpath = Path.cwd() / self.get_ext_fullpath(target.name) + output_folder = target_fullpath.parent.resolve() debug_flag = int(os.environ.get('DEBUG', 0)) if self.debug is None else self.debug build_type = 'Debug' if debug_flag else 'Release' @@ -58,7 +58,7 @@ class CMakeBuild(build_ext): pass else: # Single config generators are handled "normally" - single_config = any(x in cmake_generator for x in ['NMake', 'Ninja']) + single_config = any(x in cmake_generator for x in ['N~Make', 'Ninja']) # CMake allows an arch-in-generator style for backward compatibility contains_arch = any(x in cmake_generator for x in ['ARM', 'Win64']) @@ -80,14 +80,10 @@ class CMakeBuild(build_ext): if hasattr(self, 'parallel') and self.parallel: build_args += [f"-j{self.parallel}"] - subprocess.run( - ['cmake', ext.sourcedir, *cmake_args], - check=True - ) - subprocess.run( - ['cmake', '--build', '.', *build_args], - check=True - ) + subprocess.run(['conan', 'profile', 'detect', '--force'], check=True) + subprocess.run(['conan', 'install', '.'], check=True) + subprocess.run(['cmake', target.source_dir, *cmake_args], check=True) + subprocess.run(['cmake', '--build', '.', *build_args], check=True) setup(