mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
build_rocky: use uv to acquire more recent version of Python
This commit is contained in:
@@ -9,6 +9,13 @@ jobs:
|
|||||||
container: rockylinux:9
|
container: rockylinux:9
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up uv
|
||||||
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
|
|
||||||
|
- name: Install Python
|
||||||
|
# Installs latest Python version so it's preferred by uv over Rocky's system Python.
|
||||||
|
run: uv python install
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
dnf update -y
|
dnf update -y
|
||||||
@@ -17,7 +24,6 @@ jobs:
|
|||||||
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
||||||
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
||||||
findutils xz byacc
|
findutils xz byacc
|
||||||
python3 -m pip install typing_extensions
|
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
- name: Install aws cli
|
- name: Install aws cli
|
||||||
@@ -45,7 +51,7 @@ jobs:
|
|||||||
- name: Unpack Dependencies
|
- name: Unpack Dependencies
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
python3 ../nix/cache_dependencies.py unpack
|
uv run ../nix/cache_dependencies.py unpack
|
||||||
|
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.22
|
uses: hendrikmuhs/ccache-action@v1.2.22
|
||||||
@@ -56,7 +62,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log
|
CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release uv run ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log
|
||||||
|
|
||||||
- name: Upload Build Logs
|
- name: Upload Build Logs
|
||||||
if: always()
|
if: always()
|
||||||
@@ -71,7 +77,7 @@ jobs:
|
|||||||
- name: Pack Dependencies
|
- name: Pack Dependencies
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
python3 ../nix/cache_dependencies.py pack
|
uv run ../nix/cache_dependencies.py pack
|
||||||
|
|
||||||
- name: Commit and Push Changes to Build Repository
|
- name: Commit and Push Changes to Build Repository
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ jobs:
|
|||||||
container: arm64v8/rockylinux:9
|
container: arm64v8/rockylinux:9
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up uv
|
||||||
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
|
|
||||||
|
- name: Install Python
|
||||||
|
# Installs latest Python version so it's preferred by uv over Rocky's system Python.
|
||||||
|
run: uv python install
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
dnf update -y
|
dnf update -y
|
||||||
@@ -17,7 +24,6 @@ jobs:
|
|||||||
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
sqlite-devel bzip2-devel zlib-devel openssl-devel xz-devel \
|
||||||
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
readline-devel ncurses-devel libffi-devel libuuid-devel git-lfs \
|
||||||
findutils xz byacc
|
findutils xz byacc
|
||||||
python3 -m pip install typing_extensions
|
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
- name: Install aws cli
|
- name: Install aws cli
|
||||||
@@ -45,7 +51,7 @@ jobs:
|
|||||||
- name: Unpack Dependencies
|
- name: Unpack Dependencies
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
python3 ../nix/cache_dependencies.py unpack
|
uv run ../nix/cache_dependencies.py unpack
|
||||||
|
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.22
|
uses: hendrikmuhs/ccache-action@v1.2.22
|
||||||
@@ -56,7 +62,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log
|
CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release uv run ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log
|
||||||
|
|
||||||
- name: Upload Build Logs
|
- name: Upload Build Logs
|
||||||
if: always()
|
if: always()
|
||||||
@@ -71,7 +77,7 @@ jobs:
|
|||||||
- name: Pack Dependencies
|
- name: Pack Dependencies
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
python3 ../nix/cache_dependencies.py pack
|
uv run ../nix/cache_dependencies.py pack
|
||||||
|
|
||||||
- name: Commit and Push Changes to Build Repository
|
- name: Commit and Push Changes to Build Repository
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -95,8 +95,7 @@ jobs:
|
|||||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||||
}
|
}
|
||||||
|
|
||||||
run_check poe ruff-main
|
run_check poe ruff
|
||||||
run_check poe ruff-old
|
|
||||||
|
|
||||||
exit $ERROR
|
exit $ERROR
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
+3
-7
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# /// script
|
||||||
|
# ///
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# This file is part of IfcOpenShell. #
|
# This file is part of IfcOpenShell. #
|
||||||
@@ -126,13 +128,7 @@ from collections.abc import Generator, Sequence
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve
|
||||||
|
|
||||||
try:
|
from typing import Literal, Union
|
||||||
from typing import Literal, Union
|
|
||||||
except:
|
|
||||||
# python 3.6 compatibility for rocky 8
|
|
||||||
from typing import Union
|
|
||||||
|
|
||||||
from typing_extensions import Literal
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# /// script
|
||||||
|
# ///
|
||||||
"""
|
"""
|
||||||
Cache built dependencies for builds.
|
Cache built dependencies for builds.
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -215,10 +215,7 @@ exclude = [
|
|||||||
|
|
||||||
[tool.poe.tasks]
|
[tool.poe.tasks]
|
||||||
|
|
||||||
ruff-main = "ruff check --extend-exclude nix/build-all.py"
|
ruff = "ruff check"
|
||||||
# It's actually Python 3.6, but ruff only supports 3.7+, but it should do.
|
|
||||||
ruff-old = "ruff check nix/build-all.py --target-version py37"
|
|
||||||
ruff.sequence = ["ruff-main", "ruff-old"]
|
|
||||||
|
|
||||||
black = "black ."
|
black = "black ."
|
||||||
|
|
||||||
@@ -238,7 +235,7 @@ ty-venv-ios.sequence = [
|
|||||||
{cmd = "uv pip install -r src/ifcopenshell-python/type-check-requirements.txt --python=src/ifcopenshell-python/.venv"},
|
{cmd = "uv pip install -r src/ifcopenshell-python/type-check-requirements.txt --python=src/ifcopenshell-python/.venv"},
|
||||||
]
|
]
|
||||||
|
|
||||||
format.sequence = ["black", "ruff-main", "ruff-old"]
|
format.sequence = ["black", "ruff"]
|
||||||
|
|
||||||
cmake-format = "gersemi . --in-place"
|
cmake-format = "gersemi . --in-place"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user