-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
ifcopenshell: 240611 -> 0.7.10, fix build and activate most tests #312381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
163 changes: 146 additions & 17 deletions
163
pkgs/development/python-modules/ifcopenshell/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,196 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| testers, | ||
| buildPythonPackage, | ||
| pythonOlder, | ||
| python, | ||
| pytestCheckHook, | ||
| # fetchers | ||
| fetchFromGitHub, | ||
| gcc10, | ||
| gitUpdater, | ||
| # build tools | ||
| cmake, | ||
| swig, | ||
| # native dependencies | ||
| eigen, | ||
| boost179, | ||
| cgal, | ||
| gmp, | ||
| hdf5, | ||
| icu, | ||
| swig, | ||
| pcre, | ||
| libaec, | ||
| libxml2, | ||
| mpfr, | ||
| nlohmann_json, | ||
| opencascade-occt_7_6, | ||
| opencollada, | ||
| libxml2, | ||
| pcre, | ||
| zlib, | ||
|
|
||
| # python deps | ||
| ## tools | ||
| setuptools, | ||
| build, | ||
| pytest, | ||
| ## dependencies | ||
| isodate, | ||
| lark, | ||
| numpy, | ||
| python-dateutil, | ||
| shapely, | ||
| typing-extensions, | ||
| ## additional deps for tests | ||
| lxml, | ||
| mathutils, | ||
| networkx, | ||
| tabulate, | ||
| xmlschema, | ||
| xsdata, | ||
| }: | ||
| let | ||
| opencascade-occt = opencascade-occt_7_6; | ||
| in | ||
| buildPythonPackage rec { | ||
| pname = "ifcopenshell"; | ||
| version = "240611"; | ||
| format = "other"; | ||
| version = "0.7.10"; | ||
| pyproject = false; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "IfcOpenShell"; | ||
| repo = "IfcOpenShell"; | ||
| rev = "refs/tags/blenderbim-${version}"; | ||
| rev = "refs/tags/ifcopenshell-python-${version}"; | ||
| fetchSubmodules = true; | ||
| hash = "sha256-fCgxSambC01qb14EoZTrVxNNw8H3nX8oMi6gk0O/HmQ="; | ||
| hash = "sha256-cRzv07T5VN5aTjMtAlLGbvI3c4SL0lfzCn/W6f/vdBY="; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ | ||
| gcc10 | ||
| # c++ | ||
| cmake | ||
| swig | ||
| # python | ||
| build | ||
| setuptools | ||
| ]; | ||
|
|
||
| buildInputs = [ | ||
| # ifcopenshell needs stdc++ | ||
| stdenv.cc.cc.lib | ||
| boost179 | ||
| cgal | ||
| eigen | ||
| gmp | ||
| hdf5 | ||
| icu | ||
| pcre | ||
| libaec | ||
| libxml2 | ||
| mpfr | ||
| nlohmann_json | ||
| opencascade-occt | ||
| opencollada | ||
| pcre | ||
| ]; | ||
|
|
||
| preConfigure = '' | ||
| cd cmake | ||
| ''; | ||
| propagatedBuildInputs = [ | ||
| isodate | ||
| lark | ||
| numpy | ||
| python-dateutil | ||
| shapely | ||
| typing-extensions | ||
| ]; | ||
|
|
||
| # list taken from .github/workflows/ci.yml:49 | ||
| nativeCheckInputs = [ | ||
| lxml | ||
| mathutils | ||
| networkx | ||
| pytest | ||
| tabulate | ||
| xmlschema | ||
| xsdata | ||
|
|
||
| pytestCheckHook | ||
| ]; | ||
|
|
||
| pythonImportsCheck = [ "ifcopenshell" ]; | ||
|
|
||
| PYTHONUSERBASE = "."; | ||
|
|
||
| # We still build with python to generate ifcopenshell_wrapper.py and ifcopenshell_wrapper.so | ||
| cmakeFlags = [ | ||
| "-DUSERSPACE_PYTHON_PREFIX=ON" | ||
| "-DBUILD_SHARED_LIBS=ON" | ||
| "-DBUILD_IFCPYTHON=ON" | ||
| "-DCITYJSON_SUPPORT=OFF" | ||
| "-DEIGEN_DIR=${eigen}/include/eigen3" | ||
| "-DJSON_INCLUDE_DIR=${nlohmann_json}/include/" | ||
| "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade" | ||
| "-DOCC_LIBRARY_DIR=${opencascade-occt}/lib" | ||
| "-DOCC_LIBRARY_DIR=${lib.getLib opencascade-occt}/lib" | ||
| "-DOPENCOLLADA_INCLUDE_DIR=${opencollada}/include/opencollada" | ||
| "-DOPENCOLLADA_LIBRARY_DIR=${opencollada}/lib/opencollada" | ||
| "-DOPENCOLLADA_LIBRARY_DIR=${lib.getLib opencollada}/lib/opencollada" | ||
| "-DSWIG_EXECUTABLE=${swig}/bin/swig" | ||
| "-DLIBXML2_INCLUDE_DIR=${libxml2.dev}/include/libxml2" | ||
| "-DLIBXML2_LIBRARIES=${libxml2.out}/lib/libxml2${stdenv.hostPlatform.extensions.sharedLibrary}" | ||
| "-DLIBXML2_LIBRARIES=${lib.getLib libxml2}/lib/libxml2${stdenv.hostPlatform.extensions.sharedLibrary}" | ||
| "-DGMP_LIBRARY_DIR=${lib.getLib gmp}/lib/" | ||
| "-DMPFR_LIBRARY_DIR=${lib.getLib mpfr}/lib/" | ||
| # HDF5 support is currently not optional, see https://github.com/IfcOpenShell/IfcOpenShell/issues/1815 | ||
| "-DHDF5_SUPPORT=ON" | ||
| "-DHDF5_INCLUDE_DIR=${hdf5.dev}/include/" | ||
| "-DHDF5_LIBRARIES=${lib.getLib hdf5}/lib/libhdf5_cpp.so;${lib.getLib hdf5}/lib/libhdf5.so;${lib.getLib zlib}/lib/libz.so;${lib.getLib libaec}/lib/libaec.so;" | ||
| ]; | ||
|
|
||
| postPatch = '' | ||
| pushd src/ifcopenshell-python | ||
| # The build process is here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifcopenshell-python/Makefile#L131 | ||
| # NOTE: it has changed a *lot* between 0.7.0 and 0.8.0, it *may* change again (look for mathutils and basically all the things this Makefile does manually) | ||
| substituteInPlace pyproject.toml --replace-fail "0.0.0" "${version}" | ||
| # NOTE: the following is directly inspired by https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifcopenshell-python/Makefile#L123 | ||
| cp ../../README.md README.md | ||
| popd | ||
| ''; | ||
|
|
||
| preConfigure = '' | ||
| cd cmake | ||
| ''; | ||
|
|
||
| preCheck = '' | ||
| pushd ../../src/ifcopenshell-python | ||
| # let's test like done in .github/workflows/ci.yml | ||
| # installing the python wrapper and the .so, both are needed to be able to test | ||
| cp -v $out/${python.sitePackages}/ifcopenshell/ifcopenshell_wrapper.py ./ifcopenshell | ||
| cp $out/${python.sitePackages}/ifcopenshell/_ifcopenshell_wrapper.cpython-${ | ||
| lib.versions.major python.version + lib.versions.minor python.version | ||
| }-${stdenv.targetPlatform.system}-gnu.so ./ifcopenshell | ||
| pushd ../../test | ||
| PYTHONPATH=../src/ifcopenshell-python/ python tests.py | ||
| popd | ||
| ''; | ||
|
|
||
| pytestFlagsArray = [ | ||
| "-p no:pytest-blender" | ||
| ]; | ||
|
|
||
| disabledTestPaths = [ | ||
| "test/test_open.py" | ||
| ]; | ||
|
|
||
| postCheck = '' | ||
| popd | ||
| ''; | ||
|
|
||
| passthru = { | ||
| updateScript = gitUpdater { rev-prefix = "ifcopenshell-python-"; }; | ||
| tests = { | ||
| version = testers.testVersion { command = "IfcConvert --version"; }; | ||
| }; | ||
| }; | ||
|
|
||
| meta = with lib; { | ||
| broken = stdenv.hostPlatform.isDarwin; | ||
| description = "Open source IFC library and geometry engine"; | ||
| homepage = "http://ifcopenshell.org/"; | ||
| license = licenses.lgpl3; | ||
| maintainers = with maintainers; [ fehnomenal ]; | ||
| maintainers = with maintainers; [ autra ]; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.