mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
use rattler-build to speed up daily conda builds and fix deps (#6692)
* use rattler-build to speed up daily conda builds and add typing_extensions * minor update
This commit is contained in:
committed by
GitHub
parent
809a20dc99
commit
b7cdb86327
@@ -39,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}-${{ matrix.variant }}
|
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}
|
||||||
needs: activate
|
needs: activate
|
||||||
runs-on: ${{ matrix.platform.distver }}
|
runs-on: ${{ matrix.platform.distver }}
|
||||||
defaults:
|
defaults:
|
||||||
@@ -48,9 +48,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
variant: [novtk, all]
|
|
||||||
pyver: [
|
pyver: [
|
||||||
# { name: py311, distver: '3.11'},
|
|
||||||
{ name: py312, distver: '3.12'}
|
{ name: py312, distver: '3.12'}
|
||||||
]
|
]
|
||||||
platform: [
|
platform: [
|
||||||
@@ -74,13 +72,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
|
curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
|
||||||
|
|
||||||
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
|
- uses: mamba-org/setup-micromamba@v2 # https://github.com/mamba-org/setup-micromamba
|
||||||
with:
|
with:
|
||||||
environment-name: test-env
|
environment-name: test-env
|
||||||
create-args: >-
|
create-args: >-
|
||||||
python=3.11
|
python=3.12
|
||||||
anaconda-client
|
anaconda-client
|
||||||
boa
|
rattler-build
|
||||||
|
|
||||||
- name: create conda package dist dir
|
- name: create conda package dist dir
|
||||||
run: |
|
run: |
|
||||||
@@ -88,17 +86,16 @@ jobs:
|
|||||||
|
|
||||||
- name: build & test ifcopenshell
|
- name: build & test ifcopenshell
|
||||||
run: |
|
run: |
|
||||||
conda mambabuild . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist' --variants='{variant: ${{ matrix.variant }}}'
|
rattler-build build -r conda/recipe.yaml --python ${{ matrix.pyver.distver }} --output-folder '${{ github.workspace }}/dist'
|
||||||
working-directory: ./conda
|
|
||||||
env:
|
env:
|
||||||
VERSION_OVERRIDE: ${{ needs.activate.outputs.verdate }}
|
VERSION_OVERRIDE: ${{ needs.activate.outputs.verdate }}
|
||||||
|
|
||||||
- name: upload to anaconda
|
- name: upload to anaconda
|
||||||
if: ${{ matrix.platform.name == 'win' }}
|
if: ${{ matrix.platform.name == 'win' }}
|
||||||
run: |
|
run: |
|
||||||
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell '${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2'
|
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell '${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.conda'
|
||||||
|
|
||||||
- name: upload to anaconda
|
- name: upload to anaconda
|
||||||
if: ${{ matrix.platform.name != 'win' }}
|
if: ${{ matrix.platform.name != 'win' }}
|
||||||
run: |
|
run: |
|
||||||
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2
|
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.conda
|
||||||
|
|||||||
@@ -49,3 +49,7 @@ if errorlevel 1 exit 1
|
|||||||
ninja install -j 1
|
ninja install -j 1
|
||||||
|
|
||||||
if errorlevel 1 exit 1
|
if errorlevel 1 exit 1
|
||||||
|
|
||||||
|
python %RECIPE_DIR%/update_version_init.py %PKG_VERSION% %SP_DIR%/ifcopenshell/__init__.py
|
||||||
|
|
||||||
|
if errorlevel 1 exit 1
|
||||||
+3
-1
@@ -46,4 +46,6 @@ cmake ${CMAKE_ARGS} -G Ninja \
|
|||||||
|
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
ninja install -j 1
|
ninja install -j 1
|
||||||
|
|
||||||
|
python "${RECIPE_DIR}/update_version_init.py" "${PKG_VERSION}" "${SP_DIR}/ifcopenshell/__init__.py"
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
variant:
|
|
||||||
- novtk
|
|
||||||
- all
|
|
||||||
|
|
||||||
occt:
|
occt:
|
||||||
- 7.8.1
|
- 7.8.1
|
||||||
|
|
||||||
@@ -27,9 +23,9 @@ c_stdlib_version:
|
|||||||
- '2.12' # [linux]
|
- '2.12' # [linux]
|
||||||
- '10.13' # [osx]
|
- '10.13' # [osx]
|
||||||
hdf5:
|
hdf5:
|
||||||
- 1.14.3
|
- 1.14.6
|
||||||
libboost_devel:
|
libboost_devel:
|
||||||
- '1.84'
|
- '1.86'
|
||||||
libxml2:
|
libxml2:
|
||||||
- '2'
|
- '2'
|
||||||
mpfr:
|
mpfr:
|
||||||
|
|||||||
@@ -1,64 +1,78 @@
|
|||||||
{% set version = environ.get('VERSION_OVERRIDE', '0.8.0') %}
|
context:
|
||||||
{% set build = 0 %}
|
version: ${{ env.get("VERSION_OVERRIDE", default="0.8.2.1") }}
|
||||||
|
build: 1
|
||||||
# Higher number -> Always prioritize "novtk" variant over "all" variant
|
|
||||||
{% set build = build + 200 %} # [variant == "novtk"]
|
|
||||||
{% set build = build + 100 %} # [variant == "all"]
|
|
||||||
|
|
||||||
package:
|
package:
|
||||||
name: ifcopenshell
|
name: ifcopenshell
|
||||||
version: {{ version }}
|
version: ${{ version }}
|
||||||
|
|
||||||
source:
|
source:
|
||||||
path: ../
|
- path: ..
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
number: {{ build }}
|
number: ${{ build }}
|
||||||
skip: true # [py<39]
|
dynamic_linking:
|
||||||
binary_relocation: false # [osx]
|
binary_relocation: ${{ true if osx }}
|
||||||
string: py{{ CONDA_PY }}_{{ variant }}_h{{ PKG_HASH }}_{{ build }}
|
|
||||||
run_exports:
|
|
||||||
- {{ pin_subpackage('ifcopenshell', max_pin='x.x.x') }} *{{ variant }}*
|
|
||||||
|
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
build:
|
build:
|
||||||
- cmake
|
- if: build_platform != target_platform
|
||||||
|
then:
|
||||||
|
- python
|
||||||
|
- cross-python_${{ target_platform }}
|
||||||
|
- cmake <4
|
||||||
- ninja
|
- ninja
|
||||||
- swig >=4.1.1
|
- swig >=4.1.1
|
||||||
- {{ stdlib("c") }}
|
- ${{ stdlib("c") }}
|
||||||
- {{ compiler('c') }}
|
- ${{ compiler('c') }}
|
||||||
- {{ compiler('cxx') }}
|
- ${{ compiler('cxx') }}
|
||||||
host:
|
host:
|
||||||
- python
|
- python
|
||||||
- libboost-devel
|
- libboost-devel
|
||||||
- occt *=*{{ variant }}*
|
- occt
|
||||||
- libxml2
|
- libxml2
|
||||||
- cgal-cpp
|
- cgal-cpp
|
||||||
- hdf5
|
- hdf5
|
||||||
- eigen
|
- eigen
|
||||||
- mpfr
|
- mpfr
|
||||||
- nlohmann_json
|
- nlohmann_json
|
||||||
- gmp # [unix]
|
- gmp
|
||||||
- mpir # [win]
|
|
||||||
- zlib
|
- zlib
|
||||||
run:
|
run:
|
||||||
- python
|
- python
|
||||||
- {{ pin_compatible('occt', max_pin='x.x.x') }} *{{ variant }}*
|
- shapely
|
||||||
- {{ pin_compatible('cgal-cpp', max_pin='x.x') }}
|
- typing_extensions
|
||||||
|
- ${{ pin_compatible('occt', upper_bound='x.x.x') }}
|
||||||
|
- ${{ pin_compatible('cgal-cpp', upper_bound='x.x') }}
|
||||||
test:
|
run_exports:
|
||||||
imports:
|
- ${{ pin_subpackage('ifcopenshell', upper_bound='x.x.x') }}
|
||||||
- ifcopenshell
|
|
||||||
|
|
||||||
|
tests:
|
||||||
|
- python:
|
||||||
|
imports:
|
||||||
|
- ifcopenshell
|
||||||
|
pip_check: false
|
||||||
|
- script:
|
||||||
|
- python -c "import ifcopenshell; assert ifcopenshell.version == '${{ version }}', 'print(ifcopenshell.version)'"
|
||||||
|
requirements:
|
||||||
|
run:
|
||||||
|
- occt * *novtk* # Ensure that even though compiled against OCCT with VTK, it can still run with OCCT without VTK
|
||||||
|
- pytest
|
||||||
|
- python-dateutil
|
||||||
|
- xmlschema
|
||||||
|
- xsdata
|
||||||
|
- lxml
|
||||||
|
- isodate
|
||||||
|
- lark
|
||||||
|
- networkx
|
||||||
|
- tabulate
|
||||||
|
- shapely
|
||||||
|
|
||||||
about:
|
about:
|
||||||
home: https://ifcopenshell.org
|
|
||||||
license: LGPL-3.0-or-later
|
license: LGPL-3.0-or-later
|
||||||
license_file: COPYING
|
license_file: COPYING
|
||||||
summary: 'IfcOpenShell is a library to support the IFC file format'
|
summary: IfcOpenShell is a library to support the IFC file format
|
||||||
description: |
|
description: |
|
||||||
IfcOpenShell
|
IfcOpenShell
|
||||||
============
|
============
|
||||||
@@ -293,8 +307,9 @@ about:
|
|||||||
[MSYS2]: https://msys2.github.io/ "MSYS2"
|
[MSYS2]: https://msys2.github.io/ "MSYS2"
|
||||||
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
|
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
|
||||||
[nix/build-all.py]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.py "nix/build-all.py"
|
[nix/build-all.py]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.py "nix/build-all.py"
|
||||||
doc_url: https://ifcopenshell.org/
|
homepage: https://ifcopenshell.org
|
||||||
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
|
repository: https://github.com/IfcOpenShell/IfcOpenShell
|
||||||
|
documentation: https://ifcopenshell.org/
|
||||||
|
|
||||||
extra:
|
extra:
|
||||||
recipe-maintainers:
|
recipe-maintainers:
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import re
|
||||||
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
def update_version(file_path: str, version: str) -> None:
|
||||||
|
"""Update the version string in the given __init__.py file."""
|
||||||
|
file_path = Path(file_path)
|
||||||
|
|
||||||
|
# Read the file and replace the version
|
||||||
|
file_contents = file_path.read_text(encoding="utf-8")
|
||||||
|
new_contents = re.sub(r'version = "0\.0\.0"', f'version = "{version}"', file_contents)
|
||||||
|
|
||||||
|
# Write the updated contents back to the file
|
||||||
|
file_path.write_text(new_contents, encoding="utf-8")
|
||||||
|
|
||||||
|
print(f"Updated version in {file_path} to {version}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Update the version string in a Python file.")
|
||||||
|
parser.add_argument(
|
||||||
|
"version",
|
||||||
|
type=str,
|
||||||
|
help="The version string to replace '0.0.0' with (e.g., '1.2.3')."
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"file",
|
||||||
|
type=str,
|
||||||
|
help="The path to the __init__.py file where the version will be updated."
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
update_version(args.file, args.version)
|
||||||
Reference in New Issue
Block a user