Skip to content

Commit 5b29ef0

Browse files
committed
Update CI configuration and improve Conan installation process
1 parent 6d13cb1 commit 5b29ef0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.github/workflows/ci-main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- uses: actions/checkout@v3
4343
- uses: actions/setup-python@v5
4444
with:
45-
python-version: 3.11
45+
python-version-file: 'pyproject.toml'
4646
- name: Install uv
4747
uses: astral-sh/setup-uv@v6
4848
with:
@@ -62,7 +62,7 @@ jobs:
6262
pip install twine
6363
twine check --strict ./wheelhouse/*
6464
- uses: actions/upload-artifact@v4
65-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
65+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
6666
name: Upload artifact (wheels)
6767
with:
6868
name: libcosimpy-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.python-version }}-wheel
@@ -82,14 +82,14 @@ jobs:
8282
python -m build --sdist
8383
twine check --strict ./dist/*
8484
- uses: actions/upload-artifact@v4
85-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
85+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
8686
name: Upload artifact (source)
8787
with:
8888
name: libcosimpy-${{ github.ref_name }}-source
8989
path: ./dist/*.tar.gz
9090

9191
publish:
92-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
92+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
9393
needs:
9494
- code_quality
9595
- build_wheels_and_test

hatch_build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ def initialize(self, version: str, build_data: dict[str, Any]) -> None:
2121
frame = frame_info.frame
2222
module = inspect.getmodule(frame)
2323
if module and module.__name__.startswith("hatchling.build") and "config_settings" in frame.f_locals:
24-
config_settings = frame.f_locals["config_settings"]
24+
config_settings = frame.f_locals["config_settings"] or {}
2525

2626
package_list = config_settings.get("CONAN_BUILD")
2727
if package_list:
2828
build_packages = " ".join([f"-b {p}/*" for p in package_list.split(",")])
2929
else:
3030
build_packages = "-b missing"
3131

32-
assert os.system(f"conan install . -u {build_packages} -of build --format json --out-file graph.json") == 0, (
33-
"Conan install failed"
34-
)
32+
assert (
33+
os.system(f"conan install . -u {build_packages} -of build --format json -b b2/* --out-file graph.json") == 0
34+
), "Conan install failed"
3535

3636
if "CONAN_UPLOAD_OSP" in os.environ:
3737
print("Uploading packages..")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test-command = "uv run --with pytest pytest {package}"
6262
[tool.cibuildwheel.linux]
6363
before-all = [
6464
"yum install -y libatomic",
65-
"yum install -y perl-IPC-Cmd perl-Digest-SHA",
65+
"yum install -y perl-IPC-Cmd perl-Digest-SHA perl-Time-Piece",
6666
]
6767
manylinux-x86_64-image = "manylinux_2_28"
6868

0 commit comments

Comments
 (0)