CSXCAD 0.8.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csxcad-0.8.0a1/.gitattributes +2 -0
- csxcad-0.8.0a1/.github/scripts/build_wheel_deps.py +105 -0
- csxcad-0.8.0a1/.github/scripts/resolve_dependent_repos.py +293 -0
- csxcad-0.8.0a1/.github/workflows/ci.yml +784 -0
- csxcad-0.8.0a1/.github/workflows/wheels.yml +113 -0
- csxcad-0.8.0a1/.gitignore +51 -0
- csxcad-0.8.0a1/AGENTS.md +168 -0
- csxcad-0.8.0a1/AI_POLICY.md +35 -0
- csxcad-0.8.0a1/CHANGELOG.md +215 -0
- csxcad-0.8.0a1/CMakeLists.txt +170 -0
- csxcad-0.8.0a1/COPYING +165 -0
- csxcad-0.8.0a1/INSTALL +22 -0
- csxcad-0.8.0a1/PKG-INFO +62 -0
- csxcad-0.8.0a1/README.md +124 -0
- csxcad-0.8.0a1/cmake/Modules/FindTinyXML.cmake +74 -0
- csxcad-0.8.0a1/linux/CSXCAD.dsc +9 -0
- csxcad-0.8.0a1/linux/CSXCAD.spec +131 -0
- csxcad-0.8.0a1/linux/CSXGeomPlot.m.patch +25 -0
- csxcad-0.8.0a1/linux/README.patch +15 -0
- csxcad-0.8.0a1/linux/debian.changelog +27 -0
- csxcad-0.8.0a1/linux/debian.control +18 -0
- csxcad-0.8.0a1/linux/debian.csxcad-dev.install +2 -0
- csxcad-0.8.0a1/linux/debian.csxcad.docs +2 -0
- csxcad-0.8.0a1/linux/debian.csxcad.install +2 -0
- csxcad-0.8.0a1/linux/debian.rules +8 -0
- csxcad-0.8.0a1/linux/debian.series +2 -0
- csxcad-0.8.0a1/matlab/AddBox.m +44 -0
- csxcad-0.8.0a1/matlab/AddConductingSheet.m +48 -0
- csxcad-0.8.0a1/matlab/AddCurve.m +45 -0
- csxcad-0.8.0a1/matlab/AddCylinder.m +36 -0
- csxcad-0.8.0a1/matlab/AddCylindricalShell.m +42 -0
- csxcad-0.8.0a1/matlab/AddDebyeMaterial.m +31 -0
- csxcad-0.8.0a1/matlab/AddDiscMaterial.m +69 -0
- csxcad-0.8.0a1/matlab/AddDjordjevicSarkarMaterial.m +132 -0
- csxcad-0.8.0a1/matlab/AddDump.m +104 -0
- csxcad-0.8.0a1/matlab/AddExcitation.m +33 -0
- csxcad-0.8.0a1/matlab/AddLinPoly.m +42 -0
- csxcad-0.8.0a1/matlab/AddLorentzMaterial.m +67 -0
- csxcad-0.8.0a1/matlab/AddLumpedElement.m +39 -0
- csxcad-0.8.0a1/matlab/AddMaterial.m +27 -0
- csxcad-0.8.0a1/matlab/AddMetal.m +27 -0
- csxcad-0.8.0a1/matlab/AddPlaneWaveExcite.m +39 -0
- csxcad-0.8.0a1/matlab/AddPoint.m +14 -0
- csxcad-0.8.0a1/matlab/AddPolygon.m +42 -0
- csxcad-0.8.0a1/matlab/AddPolyhedron.m +53 -0
- csxcad-0.8.0a1/matlab/AddProbe.m +106 -0
- csxcad-0.8.0a1/matlab/AddPropAttribute.m +24 -0
- csxcad-0.8.0a1/matlab/AddRotPoly.m +49 -0
- csxcad-0.8.0a1/matlab/AddSphere.m +31 -0
- csxcad-0.8.0a1/matlab/AddSphericalShell.m +37 -0
- csxcad-0.8.0a1/matlab/AddWire.m +47 -0
- csxcad-0.8.0a1/matlab/AnalyseMesh.m +42 -0
- csxcad-0.8.0a1/matlab/AutoSmoothMeshLines.m +160 -0
- csxcad-0.8.0a1/matlab/CSXGeomPlot.m +51 -0
- csxcad-0.8.0a1/matlab/CalcDebyeMaterial.m +29 -0
- csxcad-0.8.0a1/matlab/CalcDjordjevicSarkarApprox.m +335 -0
- csxcad-0.8.0a1/matlab/CalcDrudeMaterial.m +38 -0
- csxcad-0.8.0a1/matlab/CalcLorentzMaterial.m +62 -0
- csxcad-0.8.0a1/matlab/CheckMesh.m +65 -0
- csxcad-0.8.0a1/matlab/Convert_VF_DiscMaterial.m +256 -0
- csxcad-0.8.0a1/matlab/CreateDiscMaterial.m +84 -0
- csxcad-0.8.0a1/matlab/DefineRectGrid.m +52 -0
- csxcad-0.8.0a1/matlab/DetectEdges.m +279 -0
- csxcad-0.8.0a1/matlab/DirChar2Int.m +31 -0
- csxcad-0.8.0a1/matlab/ImportPLY.m +24 -0
- csxcad-0.8.0a1/matlab/ImportSTL.m +24 -0
- csxcad-0.8.0a1/matlab/InitCSX.m +33 -0
- csxcad-0.8.0a1/matlab/RecursiveSmoothMesh.m +179 -0
- csxcad-0.8.0a1/matlab/SetBackgroundMaterial.m +24 -0
- csxcad-0.8.0a1/matlab/SetExcitationWeight.m +69 -0
- csxcad-0.8.0a1/matlab/SetExcitationWeightFile.m +54 -0
- csxcad-0.8.0a1/matlab/SetMaterialProperty.m +30 -0
- csxcad-0.8.0a1/matlab/SetMaterialWeight.m +32 -0
- csxcad-0.8.0a1/matlab/SmoothMesh.m +74 -0
- csxcad-0.8.0a1/matlab/SmoothMeshLines.m +123 -0
- csxcad-0.8.0a1/matlab/SmoothMeshLines2.m +318 -0
- csxcad-0.8.0a1/matlab/WriteCSX.m +26 -0
- csxcad-0.8.0a1/matlab/export_empire.m +305 -0
- csxcad-0.8.0a1/matlab/export_excellon.m +144 -0
- csxcad-0.8.0a1/matlab/export_gerber.m +204 -0
- csxcad-0.8.0a1/matlab/export_povray.m +237 -0
- csxcad-0.8.0a1/matlab/isOctave.m +48 -0
- csxcad-0.8.0a1/matlab/private/Add2Property.m +26 -0
- csxcad-0.8.0a1/matlab/private/AddPrimitiveArgs.m +28 -0
- csxcad-0.8.0a1/matlab/private/AddProperty.m +29 -0
- csxcad-0.8.0a1/matlab/private/CheckSymmtricLines.m +34 -0
- csxcad-0.8.0a1/matlab/private/FindProperty.m +17 -0
- csxcad-0.8.0a1/matlab/private/GetPropertyPosition.m +41 -0
- csxcad-0.8.0a1/matlab/private/GetPropertyType.m +30 -0
- csxcad-0.8.0a1/matlab/private/SetPropertyArgs.m +16 -0
- csxcad-0.8.0a1/matlab/private/SmoothRange.m +58 -0
- csxcad-0.8.0a1/matlab/private/octave_struct2xml_2.m +57 -0
- csxcad-0.8.0a1/matlab/private/struct_2_xmlNode.m +48 -0
- csxcad-0.8.0a1/matlab/private/vector2str.m +35 -0
- csxcad-0.8.0a1/matlab/searchBinary.m +49 -0
- csxcad-0.8.0a1/matlab/struct_2_xml.m +48 -0
- csxcad-0.8.0a1/pyproject.toml +114 -0
- csxcad-0.8.0a1/python/CMakeLists.txt +42 -0
- csxcad-0.8.0a1/python/CSXCAD/CSObject.pxd +78 -0
- csxcad-0.8.0a1/python/CSXCAD/CSPrimitives.pxd +264 -0
- csxcad-0.8.0a1/python/CSXCAD/CSPrimitives.pyx +1405 -0
- csxcad-0.8.0a1/python/CSXCAD/CSProperties.pxd +421 -0
- csxcad-0.8.0a1/python/CSXCAD/CSProperties.pyx +1946 -0
- csxcad-0.8.0a1/python/CSXCAD/CSRectGrid.pxd +65 -0
- csxcad-0.8.0a1/python/CSXCAD/CSRectGrid.pyx +315 -0
- csxcad-0.8.0a1/python/CSXCAD/CSTransform.pxd +63 -0
- csxcad-0.8.0a1/python/CSXCAD/CSTransform.pyx +288 -0
- csxcad-0.8.0a1/python/CSXCAD/CSXCAD.pxd +100 -0
- csxcad-0.8.0a1/python/CSXCAD/CSXCAD.pyx +597 -0
- csxcad-0.8.0a1/python/CSXCAD/ParameterObjects.pxd +37 -0
- csxcad-0.8.0a1/python/CSXCAD/ParameterObjects.pyx +79 -0
- csxcad-0.8.0a1/python/CSXCAD/SmoothMeshLines.py +301 -0
- csxcad-0.8.0a1/python/CSXCAD/Utilities.pyx +74 -0
- csxcad-0.8.0a1/python/CSXCAD/__init__.py +40 -0
- csxcad-0.8.0a1/python/PYPI.md +30 -0
- csxcad-0.8.0a1/python/README.md +485 -0
- csxcad-0.8.0a1/python/bootstrap/setuptools_build_meta_custom.py +34 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimBox.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimCurve.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimCylinder.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimCylindricalShell.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimLinPoly.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimMultiBox.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimPoint.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimPolygon.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimPolyhedron.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimPolyhedronReader.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimRotPoly.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimSphere.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimSphericalShell.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimWire.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives/CSPrimitives.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSPrimitives.rst +27 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropAbsorbingBC.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropConductingSheet.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropDebyeMaterial.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropDiscMaterial.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropDispersiveMaterial.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropDumpBox.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropExcitation.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropLorentzMaterial.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropLumpedElement.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropMaterial.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropMetal.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSPropProbeBox.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties/CSProperties.rst +7 -0
- csxcad-0.8.0a1/python/doc/CSProperties.rst +24 -0
- csxcad-0.8.0a1/python/doc/CSRectGrid.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSTransform.rst +9 -0
- csxcad-0.8.0a1/python/doc/CSXCAD.rst +8 -0
- csxcad-0.8.0a1/python/doc/CSXCAD_API.rst +13 -0
- csxcad-0.8.0a1/python/doc/Makefile +225 -0
- csxcad-0.8.0a1/python/doc/Mesh.rst +12 -0
- csxcad-0.8.0a1/python/doc/Utilities.rst +8 -0
- csxcad-0.8.0a1/python/doc/about.rst +22 -0
- csxcad-0.8.0a1/python/doc/conf.py +348 -0
- csxcad-0.8.0a1/python/doc/index.rst +25 -0
- csxcad-0.8.0a1/python/doc/install.rst +32 -0
- csxcad-0.8.0a1/python/examples/StaticSolver.py +135 -0
- csxcad-0.8.0a1/python/pyproject.toml +61 -0
- csxcad-0.8.0a1/python/setup.py +242 -0
- csxcad-0.8.0a1/python/tests/__init__.py +0 -0
- csxcad-0.8.0a1/python/tests/sphere.ply +0 -0
- csxcad-0.8.0a1/python/tests/sphere.stl +0 -0
- csxcad-0.8.0a1/python/tests/test_CSPrimitives.py +449 -0
- csxcad-0.8.0a1/python/tests/test_CSProperties.py +966 -0
- csxcad-0.8.0a1/python/tests/test_CSRectGrid.py +157 -0
- csxcad-0.8.0a1/python/tests/test_CSTransform.py +144 -0
- csxcad-0.8.0a1/python/tests/test_CSXCAD.py +137 -0
- csxcad-0.8.0a1/python/tests/test_InsideTolerance.py +223 -0
- csxcad-0.8.0a1/python/tests/test_PolyhedronInside.py +249 -0
- csxcad-0.8.0a1/python/tests/test_PolyhedronReader.py +326 -0
- csxcad-0.8.0a1/python/tests/test_SmoothMeshLines.py +113 -0
- csxcad-0.8.0a1/python/tests/test_Utilities.py +55 -0
- csxcad-0.8.0a1/python/tests/test_WrapperCache.py +261 -0
- csxcad-0.8.0a1/python/tests/test_XML_RoundTrip.py +694 -0
- csxcad-0.8.0a1/src/CMakeLists.txt +117 -0
- csxcad-0.8.0a1/src/CSBackgroundMaterial.cpp +115 -0
- csxcad-0.8.0a1/src/CSBackgroundMaterial.h +67 -0
- csxcad-0.8.0a1/src/CSFunctionParser.cpp +78 -0
- csxcad-0.8.0a1/src/CSFunctionParser.h +34 -0
- csxcad-0.8.0a1/src/CSModeData.cpp +163 -0
- csxcad-0.8.0a1/src/CSModeData.h +59 -0
- csxcad-0.8.0a1/src/CSObject.cpp +35 -0
- csxcad-0.8.0a1/src/CSObject.h +139 -0
- csxcad-0.8.0a1/src/CSPrimBox.cpp +177 -0
- csxcad-0.8.0a1/src/CSPrimBox.h +59 -0
- csxcad-0.8.0a1/src/CSPrimCurve.cpp +198 -0
- csxcad-0.8.0a1/src/CSPrimCurve.h +56 -0
- csxcad-0.8.0a1/src/CSPrimCylinder.cpp +317 -0
- csxcad-0.8.0a1/src/CSPrimCylinder.h +69 -0
- csxcad-0.8.0a1/src/CSPrimCylindricalShell.cpp +130 -0
- csxcad-0.8.0a1/src/CSPrimCylindricalShell.h +56 -0
- csxcad-0.8.0a1/src/CSPrimLinPoly.cpp +147 -0
- csxcad-0.8.0a1/src/CSPrimLinPoly.h +53 -0
- csxcad-0.8.0a1/src/CSPrimMultiBox.cpp +284 -0
- csxcad-0.8.0a1/src/CSPrimMultiBox.h +64 -0
- csxcad-0.8.0a1/src/CSPrimPoint.cpp +128 -0
- csxcad-0.8.0a1/src/CSPrimPoint.h +59 -0
- csxcad-0.8.0a1/src/CSPrimPolygon.cpp +335 -0
- csxcad-0.8.0a1/src/CSPrimPolygon.h +77 -0
- csxcad-0.8.0a1/src/CSPrimPolyhedron.cpp +724 -0
- csxcad-0.8.0a1/src/CSPrimPolyhedron.h +84 -0
- csxcad-0.8.0a1/src/CSPrimPolyhedronReader.cpp +703 -0
- csxcad-0.8.0a1/src/CSPrimPolyhedronReader.h +55 -0
- csxcad-0.8.0a1/src/CSPrimRotPoly.cpp +210 -0
- csxcad-0.8.0a1/src/CSPrimRotPoly.h +61 -0
- csxcad-0.8.0a1/src/CSPrimSphere.cpp +176 -0
- csxcad-0.8.0a1/src/CSPrimSphere.h +72 -0
- csxcad-0.8.0a1/src/CSPrimSphericalShell.cpp +134 -0
- csxcad-0.8.0a1/src/CSPrimSphericalShell.h +57 -0
- csxcad-0.8.0a1/src/CSPrimUserDefined.cpp +252 -0
- csxcad-0.8.0a1/src/CSPrimUserDefined.h +66 -0
- csxcad-0.8.0a1/src/CSPrimWire.cpp +164 -0
- csxcad-0.8.0a1/src/CSPrimWire.h +53 -0
- csxcad-0.8.0a1/src/CSPrimitives.cpp +268 -0
- csxcad-0.8.0a1/src/CSPrimitives.h +232 -0
- csxcad-0.8.0a1/src/CSPropAbsorbingBC.cpp +137 -0
- csxcad-0.8.0a1/src/CSPropAbsorbingBC.h +76 -0
- csxcad-0.8.0a1/src/CSPropConductingSheet.cpp +103 -0
- csxcad-0.8.0a1/src/CSPropConductingSheet.h +70 -0
- csxcad-0.8.0a1/src/CSPropDebyeMaterial.cpp +254 -0
- csxcad-0.8.0a1/src/CSPropDebyeMaterial.h +94 -0
- csxcad-0.8.0a1/src/CSPropDiscMaterial.cpp +687 -0
- csxcad-0.8.0a1/src/CSPropDiscMaterial.h +124 -0
- csxcad-0.8.0a1/src/CSPropDispersiveMaterial.cpp +93 -0
- csxcad-0.8.0a1/src/CSPropDispersiveMaterial.h +63 -0
- csxcad-0.8.0a1/src/CSPropDumpBox.cpp +173 -0
- csxcad-0.8.0a1/src/CSPropDumpBox.h +101 -0
- csxcad-0.8.0a1/src/CSPropExcitation.cpp +399 -0
- csxcad-0.8.0a1/src/CSPropExcitation.h +139 -0
- csxcad-0.8.0a1/src/CSPropLorentzMaterial.cpp +438 -0
- csxcad-0.8.0a1/src/CSPropLorentzMaterial.h +170 -0
- csxcad-0.8.0a1/src/CSPropLumpedElement.cpp +180 -0
- csxcad-0.8.0a1/src/CSPropLumpedElement.h +86 -0
- csxcad-0.8.0a1/src/CSPropMaterial.cpp +336 -0
- csxcad-0.8.0a1/src/CSPropMaterial.h +116 -0
- csxcad-0.8.0a1/src/CSPropMetal.cpp +42 -0
- csxcad-0.8.0a1/src/CSPropMetal.h +44 -0
- csxcad-0.8.0a1/src/CSPropProbeBox.cpp +188 -0
- csxcad-0.8.0a1/src/CSPropProbeBox.h +114 -0
- csxcad-0.8.0a1/src/CSPropResBox.cpp +57 -0
- csxcad-0.8.0a1/src/CSPropResBox.h +48 -0
- csxcad-0.8.0a1/src/CSPropUnknown.cpp +55 -0
- csxcad-0.8.0a1/src/CSPropUnknown.h +48 -0
- csxcad-0.8.0a1/src/CSProperties.cpp +437 -0
- csxcad-0.8.0a1/src/CSProperties.h +238 -0
- csxcad-0.8.0a1/src/CSRectGrid.cpp +409 -0
- csxcad-0.8.0a1/src/CSRectGrid.h +186 -0
- csxcad-0.8.0a1/src/CSTransform.cpp +803 -0
- csxcad-0.8.0a1/src/CSTransform.h +150 -0
- csxcad-0.8.0a1/src/CSUseful.cpp +178 -0
- csxcad-0.8.0a1/src/CSUseful.h +41 -0
- csxcad-0.8.0a1/src/CSXCAD_Global.h +47 -0
- csxcad-0.8.0a1/src/ContinuousStructure.cpp +703 -0
- csxcad-0.8.0a1/src/ContinuousStructure.h +227 -0
- csxcad-0.8.0a1/src/ParameterCoord.cpp +261 -0
- csxcad-0.8.0a1/src/ParameterCoord.h +90 -0
- csxcad-0.8.0a1/src/ParameterObjects.cpp +720 -0
- csxcad-0.8.0a1/src/ParameterObjects.h +253 -0
- csxcad-0.8.0a1/tests/CMakeLists.txt +21 -0
- csxcad-0.8.0a1/tests/test_csobject.cpp +292 -0
- csxcad-0.8.0a1/tests/test_csrectgrid.cpp +97 -0
- csxcad-0.8.0a1/tests/test_cstransform.cpp +112 -0
- csxcad-0.8.0a1/third_party/CMakeLists.txt +19 -0
- csxcad-0.8.0a1/third_party/README.md +41 -0
- csxcad-0.8.0a1/third_party/fparser/extrasrc/fp_identifier_parser.inc +379 -0
- csxcad-0.8.0a1/third_party/fparser/extrasrc/fp_opcode_add.inc +7696 -0
- csxcad-0.8.0a1/third_party/fparser/extrasrc/fpaux.hh +1238 -0
- csxcad-0.8.0a1/third_party/fparser/extrasrc/fptypes.hh +288 -0
- csxcad-0.8.0a1/third_party/fparser/fparser.cc +3800 -0
- csxcad-0.8.0a1/third_party/fparser/fparser.hh +223 -0
- csxcad-0.8.0a1/third_party/fparser/fpconfig.hh +95 -0
- csxcad-0.8.0a1/third_party/fparser/fpoptimizer.cc +11745 -0
- csxcad-0.8.0a1/third_party/fparser/gpl.txt +674 -0
- csxcad-0.8.0a1/third_party/fparser/lgpl.txt +165 -0
- csxcad-0.8.0a1/third_party/licenses/hdf5-LICENSE.txt +111 -0
- csxcad-0.8.0a1/third_party/licenses/zlib-LICENSE.txt +22 -0
- csxcad-0.8.0a1/third_party/tinyxml/LICENSE.txt +21 -0
- csxcad-0.8.0a1/third_party/tinyxml/tinyxml.cpp +1863 -0
- csxcad-0.8.0a1/third_party/tinyxml/tinyxml.h +1807 -0
- csxcad-0.8.0a1/third_party/tinyxml/tinyxmlerror.cpp +52 -0
- csxcad-0.8.0a1/third_party/tinyxml/tinyxmlparser.cpp +1648 -0
- csxcad-0.8.0a1/vcpkg-configuration.json +14 -0
- csxcad-0.8.0a1/vcpkg.json +9 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Build static zlib and HDF5 (C + HL) into a prefix, for the wheels.
|
|
3
|
+
|
|
4
|
+
python build_wheel_deps.py PREFIX
|
|
5
|
+
|
|
6
|
+
The same on Linux (manylinux/musllinux containers), macOS and Windows; only
|
|
7
|
+
the standard library, CMake and a C compiler are needed. The sources are
|
|
8
|
+
pinned by version and SHA-256. Does nothing if PREFIX already holds them
|
|
9
|
+
(CI cache).
|
|
10
|
+
|
|
11
|
+
Static, so that the wheel brings no libhdf5 of its own name, which h5py
|
|
12
|
+
also brings: only one of them can be loaded per process on Windows.
|
|
13
|
+
Bump a version together with its licence in third_party/licenses/.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import hashlib
|
|
17
|
+
import os
|
|
18
|
+
import shutil
|
|
19
|
+
import subprocess
|
|
20
|
+
import sys
|
|
21
|
+
import tarfile
|
|
22
|
+
import tempfile
|
|
23
|
+
import urllib.request
|
|
24
|
+
|
|
25
|
+
ZLIB = ("https://github.com/madler/zlib/releases/download/v1.3.2/zlib-1.3.2.tar.gz",
|
|
26
|
+
"bb329a0a2cd0274d05519d61c667c062e06990d72e125ee2dfa8de64f0119d16")
|
|
27
|
+
HDF5 = ("https://github.com/HDFGroup/hdf5/releases/download/2.2.0/hdf5-2.2.0.tar.gz",
|
|
28
|
+
"1a1ab8209b35586fbc1aa279ba76d102130b95badcb20ca329587219112d8c16")
|
|
29
|
+
|
|
30
|
+
STAMP = "csxcad-wheel-deps.txt"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def fetch(url, sha256, dest):
|
|
34
|
+
path = os.path.join(dest, url.rsplit("/", 1)[1])
|
|
35
|
+
print("download", url, flush=True)
|
|
36
|
+
with urllib.request.urlopen(url) as r, open(path, "wb") as f:
|
|
37
|
+
shutil.copyfileobj(r, f)
|
|
38
|
+
with open(path, "rb") as f:
|
|
39
|
+
digest = hashlib.sha256(f.read()).hexdigest()
|
|
40
|
+
if digest != sha256:
|
|
41
|
+
sys.exit("%s: SHA-256 %s, expected %s" % (path, digest, sha256))
|
|
42
|
+
with tarfile.open(path) as tar:
|
|
43
|
+
# the HDF5 archive lists ./hdf5-x.y.z/...
|
|
44
|
+
names = [os.path.normpath(n) for n in tar.getnames()]
|
|
45
|
+
top = [n for n in names if n != "."][0].split(os.sep)[0]
|
|
46
|
+
if sys.version_info >= (3, 12):
|
|
47
|
+
tar.extractall(dest, filter="data")
|
|
48
|
+
else:
|
|
49
|
+
tar.extractall(dest)
|
|
50
|
+
return os.path.join(dest, top)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def cmake(src, build, prefix, options):
|
|
54
|
+
common = ["-DCMAKE_BUILD_TYPE=Release",
|
|
55
|
+
"-DCMAKE_INSTALL_PREFIX=" + prefix,
|
|
56
|
+
"-DCMAKE_PREFIX_PATH=" + prefix,
|
|
57
|
+
# linked into the shared libCSXCAD
|
|
58
|
+
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"]
|
|
59
|
+
subprocess.run(["cmake", "-S", src, "-B", build] + common + options, check=True)
|
|
60
|
+
subprocess.run(["cmake", "--build", build, "--config", "Release", "--parallel"], check=True)
|
|
61
|
+
subprocess.run(["cmake", "--install", build, "--config", "Release"], check=True)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def main():
|
|
65
|
+
if len(sys.argv) != 2:
|
|
66
|
+
sys.exit(__doc__)
|
|
67
|
+
prefix = os.path.abspath(sys.argv[1])
|
|
68
|
+
stamp = os.path.join(prefix, STAMP)
|
|
69
|
+
wanted = "%s\n%s\n" % (ZLIB[0], HDF5[0])
|
|
70
|
+
if os.path.exists(stamp) and open(stamp).read() == wanted:
|
|
71
|
+
print("zlib and HDF5 already in", prefix)
|
|
72
|
+
return
|
|
73
|
+
|
|
74
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
75
|
+
zlib = fetch(*ZLIB, tmp)
|
|
76
|
+
cmake(zlib, os.path.join(tmp, "build-zlib"), prefix, [
|
|
77
|
+
"-DZLIB_BUILD_SHARED=OFF",
|
|
78
|
+
"-DZLIB_BUILD_STATIC=ON",
|
|
79
|
+
"-DZLIB_BUILD_TESTING=OFF"])
|
|
80
|
+
|
|
81
|
+
hdf5 = fetch(*HDF5, tmp)
|
|
82
|
+
cmake(hdf5, os.path.join(tmp, "build-hdf5"), prefix, [
|
|
83
|
+
"-DBUILD_SHARED_LIBS=OFF",
|
|
84
|
+
"-DBUILD_STATIC_LIBS=ON",
|
|
85
|
+
"-DBUILD_TESTING=OFF",
|
|
86
|
+
"-DHDF5_BUILD_TOOLS=OFF",
|
|
87
|
+
"-DHDF5_BUILD_EXAMPLES=OFF",
|
|
88
|
+
"-DHDF5_BUILD_HL_LIB=ON",
|
|
89
|
+
"-DHDF5_BUILD_CPP_LIB=OFF",
|
|
90
|
+
"-DHDF5_BUILD_FORTRAN=OFF",
|
|
91
|
+
"-DHDF5_BUILD_JAVA=OFF",
|
|
92
|
+
"-DHDF5_BUILD_DOC=OFF",
|
|
93
|
+
"-DHDF5_NO_PACKAGES=ON",
|
|
94
|
+
# deflate, for compressed datasets in disc-material and mode files
|
|
95
|
+
"-DHDF5_ENABLE_ZLIB_SUPPORT=ON",
|
|
96
|
+
"-DHDF5_USE_ZLIB_STATIC=ON",
|
|
97
|
+
"-DZLIB_ROOT=" + prefix,
|
|
98
|
+
"-DHDF5_ENABLE_SZIP_SUPPORT=OFF"])
|
|
99
|
+
|
|
100
|
+
with open(stamp, "w") as f:
|
|
101
|
+
f.write(wanted)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
if __name__ == "__main__":
|
|
105
|
+
main()
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2026 Yifeng Li <tomli@tomli.me>
|
|
4
|
+
#
|
|
5
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
|
6
|
+
# any purpose with or without fee is hereby granted.
|
|
7
|
+
#
|
|
8
|
+
# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
|
|
9
|
+
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
10
|
+
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
11
|
+
# FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
|
12
|
+
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
13
|
+
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
14
|
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
#
|
|
16
|
+
#
|
|
17
|
+
# To test it locally, you can create a shell script:
|
|
18
|
+
#
|
|
19
|
+
# #!/bin/bash
|
|
20
|
+
# export GITHUB_API_URL="https://api.github.com"
|
|
21
|
+
# export GITHUB_REPOSITORY_OWNER="thliebig"
|
|
22
|
+
# export GITHUB_EVENT_NAME="pull_request"
|
|
23
|
+
# export GITHUB_OUTPUT="/dev/null"
|
|
24
|
+
# export GITHUB_FORK_OWNER="find the username who has an open pull request"
|
|
25
|
+
# export GITHUB_HEAD_REF="the source branch of the same pull request"
|
|
26
|
+
# export GITHUB_TOKEN="login is optional, but can bypass low API rate limit"
|
|
27
|
+
#
|
|
28
|
+
# Note that all variables but GITHUB_TOKEN and GITHUB_FORK_OWNER are default
|
|
29
|
+
# variables on GitHub Actions, while GITHUB_TOKEN and GITHUB_FORK_OWNER is are
|
|
30
|
+
# non-standard variables set manually in the ".yml" file.
|
|
31
|
+
#
|
|
32
|
+
# or --project openEMS, --project QCSXCAD, --project AppCSXCAD
|
|
33
|
+
# python3 resolve_dependent_repos.py --project CSXCAD
|
|
34
|
+
|
|
35
|
+
import argparse
|
|
36
|
+
import os
|
|
37
|
+
from time import sleep
|
|
38
|
+
|
|
39
|
+
import json
|
|
40
|
+
import urllib.request
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
PROJECT_FOUNDER = "thliebig"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def print_log(loglevel, string, title=None):
|
|
47
|
+
if loglevel not in ["debug", "notice", "warning", "error"]:
|
|
48
|
+
raise ValueError("Unsupported GitHub Actions loglevel: %s" % loglevel)
|
|
49
|
+
|
|
50
|
+
parameters = ""
|
|
51
|
+
if title:
|
|
52
|
+
parameters = " title=%s" % title
|
|
53
|
+
|
|
54
|
+
print("::%s%s::%s" % (loglevel, parameters, string))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def getenv(var):
|
|
58
|
+
value = os.getenv(var)
|
|
59
|
+
if not value:
|
|
60
|
+
errormsg = "Unable to determine GitHub Actions variable $%s!" % var
|
|
61
|
+
print_log("error", errormsg)
|
|
62
|
+
raise ValueError(errormsg)
|
|
63
|
+
else:
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def get_default_repo_dependency(project):
|
|
68
|
+
REPO = {
|
|
69
|
+
"fparser": {
|
|
70
|
+
"owner": PROJECT_FOUNDER,
|
|
71
|
+
"name": "fparser",
|
|
72
|
+
"branch": "master",
|
|
73
|
+
},
|
|
74
|
+
"CSXCAD": {
|
|
75
|
+
"owner": PROJECT_FOUNDER,
|
|
76
|
+
"name": "CSXCAD",
|
|
77
|
+
"branch": "master"
|
|
78
|
+
},
|
|
79
|
+
"openEMS": {
|
|
80
|
+
"owner": PROJECT_FOUNDER,
|
|
81
|
+
"name": "openEMS",
|
|
82
|
+
"branch": "master"
|
|
83
|
+
},
|
|
84
|
+
"QCSXCAD": {
|
|
85
|
+
"owner": PROJECT_FOUNDER,
|
|
86
|
+
"name": "QCSXCAD",
|
|
87
|
+
"branch": "master"
|
|
88
|
+
},
|
|
89
|
+
"AppCSXCAD": {
|
|
90
|
+
"owner": PROJECT_FOUNDER,
|
|
91
|
+
"name": "AppCSXCAD",
|
|
92
|
+
"branch": "master"
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
# We can check all repos, but it wastes GitHub API calls.
|
|
97
|
+
# Especially for local testing without logging it, the quota
|
|
98
|
+
# is only 60 calls/hr. You can burn it out just after a few
|
|
99
|
+
# try. It also spams useless NOTICE messages per repo to the
|
|
100
|
+
# GitHub Actions Summary.
|
|
101
|
+
#
|
|
102
|
+
# So we only check repos actually used by "project".
|
|
103
|
+
PER_PROJECT_DEPENDENCY = {
|
|
104
|
+
"CSXCAD": [REPO["fparser"]],
|
|
105
|
+
"openEMS": [REPO["fparser"], REPO["CSXCAD"]],
|
|
106
|
+
"QCSXCAD": [REPO["fparser"], REPO["CSXCAD"]],
|
|
107
|
+
"AppCSXCAD": [REPO["fparser"], REPO["CSXCAD"], REPO["QCSXCAD"]],
|
|
108
|
+
}
|
|
109
|
+
return PER_PROJECT_DEPENDENCY[project]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def determine_repo_dependency(project):
|
|
113
|
+
github_event_name = getenv("GITHUB_EVENT_NAME")
|
|
114
|
+
if github_event_name not in ["pull_request", "push"]:
|
|
115
|
+
print_log("error", "Unable to determine $GITHUB_EVENT_NAME!")
|
|
116
|
+
return get_default_repo_dependency(project)
|
|
117
|
+
|
|
118
|
+
if github_event_name == "pull_request":
|
|
119
|
+
src_branch = getenv("GITHUB_HEAD_REF")
|
|
120
|
+
elif github_event_name == "push":
|
|
121
|
+
src_branch = getenv("GITHUB_REF_NAME")
|
|
122
|
+
else:
|
|
123
|
+
assert False
|
|
124
|
+
|
|
125
|
+
repo_dependency = get_default_repo_dependency(project)
|
|
126
|
+
|
|
127
|
+
# If this project is a fork, we need to check whether the
|
|
128
|
+
# user or organization has also forked other repos. If they
|
|
129
|
+
# did, rewrite the project owner's name to the fork owner's
|
|
130
|
+
# name. This allows the fork itself to become a new "upstream"
|
|
131
|
+
# with correct CI/CD, since forks can also accept commits
|
|
132
|
+
# and Pull Requests.
|
|
133
|
+
owner = getenv("GITHUB_REPOSITORY_OWNER")
|
|
134
|
+
if owner != PROJECT_FOUNDER:
|
|
135
|
+
for repo in repo_dependency:
|
|
136
|
+
if reponame_exists(owner, repo["name"]):
|
|
137
|
+
repo["owner"] = owner
|
|
138
|
+
|
|
139
|
+
# Furthermore, if the dependency repo has a branch with the
|
|
140
|
+
# same name as the current repo branch, use that branch instead.
|
|
141
|
+
# This allowing testing multi-repo features.
|
|
142
|
+
for repo in repo_dependency:
|
|
143
|
+
if (
|
|
144
|
+
repo["branch"] != src_branch and
|
|
145
|
+
reponame_has_branch(owner, repo["name"], src_branch)
|
|
146
|
+
):
|
|
147
|
+
repo["branch"] = src_branch
|
|
148
|
+
|
|
149
|
+
# only warn dependencies, not current repo
|
|
150
|
+
current_repo = repo["name"] == getenv("GITHUB_REPOSITORY").split("/")[1]
|
|
151
|
+
|
|
152
|
+
if not current_repo:
|
|
153
|
+
print_log(
|
|
154
|
+
"warning",
|
|
155
|
+
'repo %s/%s branch %s is used instead of the default branch.' %
|
|
156
|
+
(repo["owner"], repo["name"], src_branch),
|
|
157
|
+
title='%s/%s: different branch "%s" used' %
|
|
158
|
+
(repo["owner"], repo["name"], src_branch)
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
# If the event is a pull request...
|
|
162
|
+
if github_event_name == "pull_request":
|
|
163
|
+
contributor = getenv("GITHUB_FORK_OWNER")
|
|
164
|
+
|
|
165
|
+
# check whether the contributor has forked other dependent repos.
|
|
166
|
+
for repo in repo_dependency:
|
|
167
|
+
# If they didn't, use the upstream dependency.
|
|
168
|
+
if not reponame_exists(contributor, repo["name"]):
|
|
169
|
+
continue
|
|
170
|
+
|
|
171
|
+
# If they did, check whether they've submitted an open pull
|
|
172
|
+
# request against the upstream, and the source branch uses
|
|
173
|
+
# the same name
|
|
174
|
+
pr = (
|
|
175
|
+
pr_by_user_with_branch(
|
|
176
|
+
repo["owner"], repo["name"], contributor, src_branch
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
if not pr:
|
|
180
|
+
continue
|
|
181
|
+
|
|
182
|
+
# If they also did, use that Pull Request's merge commit as
|
|
183
|
+
# the dependency repo.
|
|
184
|
+
repo["branch"] = pr["merge_commit_sha"]
|
|
185
|
+
repo["pr_url"] = pr["html_url"]
|
|
186
|
+
print_log(
|
|
187
|
+
"warning",
|
|
188
|
+
'%s/%s: %s must be merged first before merging this commit (%s)' %
|
|
189
|
+
(repo["owner"], repo["name"], pr["html_url"], pr["title"]),
|
|
190
|
+
title="Must-Merge Pull Request: %s" % pr["html_url"]
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
return repo_dependency
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def url_open(url, expect_code=None):
|
|
197
|
+
DEFAULT_HEADERS = {
|
|
198
|
+
"Accept": "application/vnd.github+json",
|
|
199
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
200
|
+
}
|
|
201
|
+
RETRIES = 3
|
|
202
|
+
error = None
|
|
203
|
+
|
|
204
|
+
headers = DEFAULT_HEADERS.copy()
|
|
205
|
+
try:
|
|
206
|
+
token = getenv("GITHUB_TOKEN")
|
|
207
|
+
headers["Authorization"] = "Bearer %s" % token
|
|
208
|
+
except ValueError:
|
|
209
|
+
# for local testing only
|
|
210
|
+
print_log(
|
|
211
|
+
"warning",
|
|
212
|
+
"$GITHUB_TOKEN not found! API requests are rate-limited!"
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
request = urllib.request.Request(url, headers=headers)
|
|
216
|
+
|
|
217
|
+
for i in range(RETRIES):
|
|
218
|
+
try:
|
|
219
|
+
response = urllib.request.urlopen(request)
|
|
220
|
+
return response, response.getcode()
|
|
221
|
+
except urllib.error.HTTPError as e:
|
|
222
|
+
if e.code == expect_code:
|
|
223
|
+
return None, e.code
|
|
224
|
+
else:
|
|
225
|
+
error = e
|
|
226
|
+
except urllib.error.URLError as e:
|
|
227
|
+
error = e
|
|
228
|
+
sleep(1)
|
|
229
|
+
|
|
230
|
+
raise error
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def url_check_existence(url):
|
|
234
|
+
response, code = url_open(url, expect_code=404)
|
|
235
|
+
if code == 404:
|
|
236
|
+
return False
|
|
237
|
+
elif code == 200:
|
|
238
|
+
return True
|
|
239
|
+
else:
|
|
240
|
+
raise RuntimeError("Unexpected HTTP status code: %d" % code)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def reponame_exists(owner, repo):
|
|
244
|
+
API = getenv("GITHUB_API_URL")
|
|
245
|
+
url = "%s/repos/%s/%s" % (API, owner, repo)
|
|
246
|
+
return url_check_existence(url)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def reponame_has_branch(owner, repo, branch):
|
|
250
|
+
API = getenv("GITHUB_API_URL")
|
|
251
|
+
url = "%s/repos/%s/%s/branches/%s" % (API, owner, repo, branch)
|
|
252
|
+
return url_check_existence(url)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def pr_by_user_with_branch(owner, repo, user, branch):
|
|
256
|
+
API = getenv("GITHUB_API_URL")
|
|
257
|
+
url = "%s/repos/%s/%s/pulls?head=%s:%s" % (API, owner, repo, user, branch)
|
|
258
|
+
raw_response, code = url_open(url)
|
|
259
|
+
pr = json.loads(raw_response.read().decode("UTF-8"))
|
|
260
|
+
|
|
261
|
+
if pr:
|
|
262
|
+
return pr[0]
|
|
263
|
+
else:
|
|
264
|
+
return None
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
def output_repo_dependency(repo_dependency):
|
|
268
|
+
for repo in repo_dependency:
|
|
269
|
+
repo_value = "%s/%s" % (repo["owner"], repo["name"])
|
|
270
|
+
branch_value = repo["branch"]
|
|
271
|
+
if "pr_url" in repo:
|
|
272
|
+
pr_value = repo["pr_url"]
|
|
273
|
+
else:
|
|
274
|
+
pr_value = "None"
|
|
275
|
+
|
|
276
|
+
print_log(
|
|
277
|
+
"notice", "%s, pr: %s, branch: %s" % (repo_value, pr_value, branch_value),
|
|
278
|
+
title="%s repo" % repo["name"]
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
with open(getenv("GITHUB_OUTPUT"), "a") as output:
|
|
282
|
+
output.write("%s_repo=%s\n" % (repo["name"], repo_value))
|
|
283
|
+
output.write("%s_branch=%s\n" % (repo["name"], branch_value))
|
|
284
|
+
output.write("%s_pr_url=%s\n" % (repo["name"], pr_value))
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
if __name__ == "__main__":
|
|
288
|
+
parser = argparse.ArgumentParser(description='Resolve dependent repos')
|
|
289
|
+
parser.add_argument("--project", type=str, required=True)
|
|
290
|
+
args = parser.parse_args()
|
|
291
|
+
|
|
292
|
+
repo_dependency = determine_repo_dependency(args.project)
|
|
293
|
+
output_repo_dependency(repo_dependency)
|