diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 3235602..a5a45f9 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: platform: [ 'windows-latest', 'ubuntu-latest' ] - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.10', '3.11', '3.12' ] timeout-minutes: 35 steps: - uses: actions/checkout@v3 @@ -33,7 +33,7 @@ jobs: fail-fast: false matrix: platform: [ 'windows-latest', 'ubuntu-latest' ] - python-version: [ 'cp38', 'cp39', 'cp310', 'cp311', 'cp312' ] + python-version: [ 'cp310', 'cp311', 'cp312' ] timeout-minutes: 35 env: CONAN_REVISIONS_ENABLED: 1 diff --git a/conan/conanfile.py b/conan/conanfile.py index abd89b9..6d075f3 100644 --- a/conan/conanfile.py +++ b/conan/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile class LibCosimpyConanDependency(ConanFile): @@ -6,9 +6,6 @@ class LibCosimpyConanDependency(ConanFile): requires = ( "libcosimc/0.10.2@osp/stable" ) - default_options = ( - "libcosim:proxyfmu=True" - ) def imports(self): self.copy("*.dll", dst="libcosimc", keep_path=False) diff --git a/hatch_build.py b/hatch_build.py index f38767e..6ca687d 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -2,7 +2,8 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface -from conans.client.conan_api import Conan +from conan.api.conan_api import ConanAPI +from conan.cli.cli import Cli import os import platform @@ -13,18 +14,13 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None: build_data["infer_tag"] = True build_data["pure_python"] = False system_os = platform.system() - conan, _, _ = Conan.factory() - conan.config_set("general.revisions_enabled", "True") - conan.remote_add( - remote_name="osp", - url="https://osp.jfrog.io/artifactory/api/conan/conan-local", - force=True, - insert=0, - ) - conan.install( - path="conan", - install_folder="build", - lockfile='conan/conan-linux64.lock' if system_os == "Linux" else 'conan/conan-win64.lock', - ) + api = ConanAPI() + cli = Cli(api) + cli.add_commands() + api.command.cli = cli + lockfile = "conan/conan-linux64.lock" if system_os == "Linux" else "conan/conan-win64.lock" + api.command.run("remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force --index 0") + api.command.run(f"install conan -b missing --lockfile {lockfile}") + if system_os == "Linux": os.system("patchelf --set-rpath '$ORIGIN' build/libcosimc/*") diff --git a/pyproject.toml b/pyproject.toml index f55286d..6089b0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,6 @@ readme = "README.md" requires-python = ">=3.8, <3.13" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -37,7 +35,7 @@ exclude = ["tests", ".github"] [tool.hatch.build.targets.wheel.hooks.custom] dependencies = [ - "conan==1.64.0", + "conan~=2.8.1", "patchelf>=0.17.2; platform_system == 'Linux'" ]