Skip to content

Commit

Permalink
conan2 upgrade preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Oct 22, 2024
1 parent 9f90e17 commit d30b707
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions conan/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile


class LibCosimpyConanDependency(ConanFile):
name = "libcosimpy-recipe"
requires = (
"libcosimc/0.10.2@osp/stable"
)
default_options = (
"libcosim:proxyfmu=True"
)

def imports(self):
self.copy("*.dll", dst="libcosimc", keep_path=False)
Expand Down
24 changes: 10 additions & 14 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/*")
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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'"
]

Expand Down

0 comments on commit d30b707

Please sign in to comment.