[{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466185997","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-2466185997","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":2466185997,"node_id":"IC_kwDOADz_5s6S_wMN","user":{"login":"thliebig","id":1634387,"node_id":"MDQ6VXNlcjE2MzQzODc=","avatar_url":"https://avatars.githubusercontent.com/u/1634387?v=4","gravatar_id":"","url":"https://api.github.com/users/thliebig","html_url":"https://github.com/thliebig","followers_url":"https://api.github.com/users/thliebig/followers","following_url":"https://api.github.com/users/thliebig/following{/other_user}","gists_url":"https://api.github.com/users/thliebig/gists{/gist_id}","starred_url":"https://api.github.com/users/thliebig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thliebig/subscriptions","organizations_url":"https://api.github.com/users/thliebig/orgs","repos_url":"https://api.github.com/users/thliebig/repos","events_url":"https://api.github.com/users/thliebig/events{/privacy}","received_events_url":"https://api.github.com/users/thliebig/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2024-11-09T11:50:38Z","updated_at":"2024-11-09T11:50:38Z","body":"Sorry, can you fix the Readme I pulled from your other PR ;)","author_association":"OWNER","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466185997/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466190732","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-2466190732","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":2466190732,"node_id":"IC_kwDOADz_5s6S_xWM","user":{"login":"thliebig","id":1634387,"node_id":"MDQ6VXNlcjE2MzQzODc=","avatar_url":"https://avatars.githubusercontent.com/u/1634387?v=4","gravatar_id":"","url":"https://api.github.com/users/thliebig","html_url":"https://github.com/thliebig","followers_url":"https://api.github.com/users/thliebig/followers","following_url":"https://api.github.com/users/thliebig/following{/other_user}","gists_url":"https://api.github.com/users/thliebig/gists{/gist_id}","starred_url":"https://api.github.com/users/thliebig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thliebig/subscriptions","organizations_url":"https://api.github.com/users/thliebig/orgs","repos_url":"https://api.github.com/users/thliebig/repos","events_url":"https://api.github.com/users/thliebig/events{/privacy}","received_events_url":"https://api.github.com/users/thliebig/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2024-11-09T12:07:34Z","updated_at":"2024-11-09T12:07:42Z","body":"Additionally we need instructions for both? built from source and maybe if available from/with pip?","author_association":"OWNER","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466190732/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466216741","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-2466216741","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":2466216741,"node_id":"IC_kwDOADz_5s6S_3sl","user":{"login":"SengerM","id":24635121,"node_id":"MDQ6VXNlcjI0NjM1MTIx","avatar_url":"https://avatars.githubusercontent.com/u/24635121?v=4","gravatar_id":"","url":"https://api.github.com/users/SengerM","html_url":"https://github.com/SengerM","followers_url":"https://api.github.com/users/SengerM/followers","following_url":"https://api.github.com/users/SengerM/following{/other_user}","gists_url":"https://api.github.com/users/SengerM/gists{/gist_id}","starred_url":"https://api.github.com/users/SengerM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SengerM/subscriptions","organizations_url":"https://api.github.com/users/SengerM/orgs","repos_url":"https://api.github.com/users/SengerM/repos","events_url":"https://api.github.com/users/SengerM/events{/privacy}","received_events_url":"https://api.github.com/users/SengerM/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2024-11-09T13:33:39Z","updated_at":"2024-11-09T13:33:39Z","body":"Not sure I understand what you meant, but I think there are no additional instructions required. `pip install path/to/package` will build and install and, to the best of my understanding, it should be the preferred and unique installation method.","author_association":"CONTRIBUTOR","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/2466216741/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3481431045","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-3481431045","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":3481431045,"node_id":"IC_kwDOADz_5s7PgmwF","user":{"login":"MrHighVoltage","id":44137182,"node_id":"MDQ6VXNlcjQ0MTM3MTgy","avatar_url":"https://avatars.githubusercontent.com/u/44137182?v=4","gravatar_id":"","url":"https://api.github.com/users/MrHighVoltage","html_url":"https://github.com/MrHighVoltage","followers_url":"https://api.github.com/users/MrHighVoltage/followers","following_url":"https://api.github.com/users/MrHighVoltage/following{/other_user}","gists_url":"https://api.github.com/users/MrHighVoltage/gists{/gist_id}","starred_url":"https://api.github.com/users/MrHighVoltage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrHighVoltage/subscriptions","organizations_url":"https://api.github.com/users/MrHighVoltage/orgs","repos_url":"https://api.github.com/users/MrHighVoltage/repos","events_url":"https://api.github.com/users/MrHighVoltage/events{/privacy}","received_events_url":"https://api.github.com/users/MrHighVoltage/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-11-03T16:31:30Z","updated_at":"2025-11-03T16:31:30Z","body":"I can confirm that this patch works (built off @SengerM CSXCAD & openEMS forked repos).\r\nThe current `python setup.py` is deprecated and I strongly suggest this patch, as it provides a clean way to select the path to openEMS and the python libraries.","author_association":"CONTRIBUTOR","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3481431045/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3486359118","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-3486359118","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":3486359118,"node_id":"IC_kwDOADz_5s7PzZ5O","user":{"login":"thliebig","id":1634387,"node_id":"MDQ6VXNlcjE2MzQzODc=","avatar_url":"https://avatars.githubusercontent.com/u/1634387?v=4","gravatar_id":"","url":"https://api.github.com/users/thliebig","html_url":"https://github.com/thliebig","followers_url":"https://api.github.com/users/thliebig/followers","following_url":"https://api.github.com/users/thliebig/following{/other_user}","gists_url":"https://api.github.com/users/thliebig/gists{/gist_id}","starred_url":"https://api.github.com/users/thliebig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thliebig/subscriptions","organizations_url":"https://api.github.com/users/thliebig/orgs","repos_url":"https://api.github.com/users/thliebig/repos","events_url":"https://api.github.com/users/thliebig/events{/privacy}","received_events_url":"https://api.github.com/users/thliebig/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-11-04T14:46:13Z","updated_at":"2025-11-04T14:46:13Z","body":"I agree in principle. I guess I need to find the time to have a closer look at it...\r\n@biergaizi you are working on this too? Any comments from you on this?","author_association":"OWNER","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3486359118/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3486720974","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-3486720974","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":3486720974,"node_id":"IC_kwDOADz_5s7P0yPO","user":{"login":"biergaizi","id":1310693,"node_id":"MDQ6VXNlcjEzMTA2OTM=","avatar_url":"https://avatars.githubusercontent.com/u/1310693?v=4","gravatar_id":"","url":"https://api.github.com/users/biergaizi","html_url":"https://github.com/biergaizi","followers_url":"https://api.github.com/users/biergaizi/followers","following_url":"https://api.github.com/users/biergaizi/following{/other_user}","gists_url":"https://api.github.com/users/biergaizi/gists{/gist_id}","starred_url":"https://api.github.com/users/biergaizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biergaizi/subscriptions","organizations_url":"https://api.github.com/users/biergaizi/orgs","repos_url":"https://api.github.com/users/biergaizi/repos","events_url":"https://api.github.com/users/biergaizi/events{/privacy}","received_events_url":"https://api.github.com/users/biergaizi/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-11-04T15:54:54Z","updated_at":"2025-11-04T15:54:54Z","body":"Yes. I'm working on an updated and more complete version. It's already partially working, but it requires some polishing. ","author_association":"CONTRIBUTOR","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3486720974/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3487249491","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-3487249491","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":3487249491,"node_id":"IC_kwDOADz_5s7P2zRT","user":{"login":"biergaizi","id":1310693,"node_id":"MDQ6VXNlcjEzMTA2OTM=","avatar_url":"https://avatars.githubusercontent.com/u/1310693?v=4","gravatar_id":"","url":"https://api.github.com/users/biergaizi","html_url":"https://github.com/biergaizi","followers_url":"https://api.github.com/users/biergaizi/followers","following_url":"https://api.github.com/users/biergaizi/following{/other_user}","gists_url":"https://api.github.com/users/biergaizi/gists{/gist_id}","starred_url":"https://api.github.com/users/biergaizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biergaizi/subscriptions","organizations_url":"https://api.github.com/users/biergaizi/orgs","repos_url":"https://api.github.com/users/biergaizi/repos","events_url":"https://api.github.com/users/biergaizi/events{/privacy}","received_events_url":"https://api.github.com/users/biergaizi/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-11-04T17:32:53Z","updated_at":"2025-11-04T17:42:29Z","body":"As I said, I don't recommend merging (or updating) this PR, since I'm working on an improved version with similar changes against the latest git version.\r\n\r\nFor transparency, I'll give some technical justifications.\r\n\r\n## Problem 1: Sotfware license is deprecated in `classifiers`.\r\n\r\nThe PR still used a deprecated classifiers.\r\n\r\n    [project]\r\n    name = 'openEMS'\r\n    classifiers = [\r\n    \t'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',\r\n    ]\r\n\r\nThe practice of listing a software license in `classifiers` has been deprecated, and fails on newer systems:\r\n\r\n```\r\nProcessing /Users/homebrew/code/openEMS-Project/openEMS/python\r\n  Preparing metadata (pyproject.toml) ... error\r\n  error: subprocess-exited-with-error\r\n  \r\n  × Preparing metadata (pyproject.toml) did not run successfully.\r\n  │ exit code: 1\r\n  ╰─> [39 lines of output]\r\n      setuptools.errors.InvalidConfigError: License classifiers have been superseded by license expressions (see https://peps.python.org/pep-0639/). Please remove:\r\n      \r\n      License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)\r\n      [end of output]\r\n  \r\n  note: This error originates from a subprocess, and is likely not a problem with pip.\r\n```\r\n\r\nIt has been replaced by the `license` field with a SPDX-complaint string, such as `GPL-3.0-or-later`.\r\n\r\nIt would also be beneficial to add other useful fields, such as:\r\n\r\n    [project.urls]\r\n    Homepage = \"https://openems.de\"\r\n    Documentation = \"https://docs.openems.de\"\r\n    Repository = \"https://github.com/thliebig/openEMS.git\"\r\n    \"Bug Tracker\" = \"https://github.com/thliebig/openEMS/issues\"\r\n\r\n# Problem 2: `h5py` and `numpy` are not built-time dependencies.\r\n\r\nThe PR listed `h5py` and `numpy` as the build-time dependencies, but they served no purpose as they're not used by the build. `pip` creates an isolated environment when building packages, which is thrown away after the package is installed. Listing them only increases network traffic. Keep them as run-time dependencies are enough.\r\n\r\n    [build-system]\r\n    requires = [\r\n    \t'setuptools',\r\n    \t'cython', # Apache License 2.0 (https://github.com/cython/cython/blob/master/LICENSE.txt)\r\n        'h5py',   # BSD 3-Clause (https://github.com/h5py/h5py/blob/master/LICENSE)\r\n        'numpy',  # BSD 3-Clause (https://github.com/numpy/numpy/blob/main/LICENSE.txt)\r\n    ]\r\n\r\n# Problem 3: `runtime_library_dirs` must be removed for non-POSIX systems.\r\n\r\nThe PR sets `runtime_library_dirs` on all systems:\r\n\r\n    Extension(\r\n        '*',\r\n        ['openEMS/*.pyx',],\r\n        include_dirs = [str(path_to_openEMS_installation/'include')],\r\n        library_dirs = [str(path_to_openEMS_installation/'lib')],\r\n        runtime_library_dirs = [str(path_to_openEMS_installation/'lib')],\r\n        language = 'c++',\r\n        libraries = ['openEMS','nf2ff'],\r\n        extra_compile_args = cxxflags,\r\n    )\r\n\r\nAccording to the setuptools documentation,\r\n\r\n> **runtime_library_dirs** (*list[str]*) – list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is loaded). Setting this will cause an exception during build on Windows platforms.\r\n\r\nSo this option should not be set on Windows, it's better to control the options using a `kwargs` instead of passing them to `Extension` directly, otherwise @thliebig would have a hard-time building the modules on Windows in the future.\r\n\r\nI've completely overhauled the flag setting logic of the code, which does the following things instead. This will allow us to remove all path detection logic in `update_openEMS.sh`. \r\n\r\n    def determine_build_options():\r\n        local_prefix_list = []\r\n    \r\n        if 'OPENEMS_PREFIX' in os.environ:\r\n            # Because CSXCAD and openEMS are usually installed to a non-standard\r\n            # location such as the user's home directory rather than a standard\r\n            # directory, their paths must be told to the compilers explicitly.\r\n            # Since a general solution is impossible (the actual installation path\r\n            # is unpredictable), users should set OPENEMS_PREFIX to ensure a successful\r\n            # installation.\r\n            local_prefix_list.append(os.environ[\"OPENEMS_PREFIX\"])\r\n        if 'VIRTUAL_ENV' in os.environ:\r\n            # if Python venv used, our documentation recommends using the same\r\n            # path as OPENEMS_PREFIX, so that the custom C++ and Python prefix\r\n            # overlaps.\r\n            local_prefix_list.append(os.environ[\"VIRTUAL_ENV\"])\r\n    \r\n        if platform.system() == \"Darwin\":\r\n            # In additional to libraries in $OPENEMS_PREFIX and $VIRTUAL_ENV, we\r\n            # also need to list custom headers and libraries installed to the local\r\n            # system but are not used by compilers by default (such as a custom Boost).\r\n            # On macOS, the required prefix are -L $(brew --prefix)/include and\r\n            # -R $(brew --prefix)/lib respectively. Hardcode it as a special treatment.\r\n            try:\r\n                status = subprocess.run([\"brew\", \"--prefix\"], capture_output=True)\r\n                path = status.stdout.decode(\"UTF-8\").replace(\"\\n\", \"\")\r\n                local_prefix_list.append(path)\r\n            except FileNotFoundError:\r\n                pass\r\n        elif os.name == \"posix\":\r\n            # The path /usr/local is also too common on Unix systems, so we hardcode it\r\n            # as a special treatment but all non-macOS Unix-like systems. For example,\r\n            # on CentOS, the paths -L /usr/local/include and -R /usr/local/lib must be\r\n            # listed if a custom Boost is installed here.\r\n            local_prefix_list.append(\"/usr/local\")\r\n    \r\n        build_options = {\r\n            \"extra_compile_args\": [],\r\n            \"include_dirs\": [],\r\n            \"library_dirs\": [],\r\n            \"runtime_library_dirs\": [],\r\n        }\r\n    \r\n        for prefix in local_prefix_list:\r\n            build_options[\"include_dirs\"].append(\"%s/include\" % prefix)\r\n            build_options[\"library_dirs\"].append(\"%s/lib\" % prefix)\r\n            build_options[\"runtime_library_dirs\"].append(\"%s/lib\" % prefix)\r\n    \r\n        # Strictly speaking we should detect compiler, not platform,\r\n        # unfortunately there's no easy way to do so without implementing\r\n        # full compiler detection logic. This is good enough for 90% of\r\n        # use cases.\r\n        if os.name == \"posix\":\r\n            build_options[\"extra_compile_args\"].append(\"-std=c++11\")\r\n    \r\n        # Setting this will cause an exception during build on Windows platforms.\r\n        if os.name != \"posix\":\r\n            del build_options[\"runtime_library_dirs\"]\r\n    \r\n        return build_options\r\n\r\n\r\n    build_options = determine_build_options()\r\n    extensions = [\r\n        Extension(\r\n            name=\"*\",\r\n            sources=[os.path.join(\"openEMS\", \"*.pyx\")],\r\n            language=\"c++\",  # generate C++ code\r\n            libraries=['CSXCAD', 'openEMS', 'nf2ff'],\r\n            **build_options\r\n        ),\r\n    ]\r\n\r\n# Problem 4: openEMS and Build Isolation\r\n\r\nThis is the most problematic part of the PR:\r\n\r\n    sys.path.append(str(PATH_TO_CSXCAD_PYTHON_PACKAGE))\r\n\r\nI say problematic not as a criticism of the PR itself, but the underlying problem: a technical headache caused by a feature known as build isolation.\r\n\r\nIn simple words, `pip` has two environments, the build environment and the user package environment. To prevent version conflicts of build-time dependencies (i.e. a package needs a setuptools newer than what's installed on the user's system, but it's only needed to build the package, and doesn't affect actual installation), recent version of pip implements a feature called *build isolation*. When building a package, pip creates an internal environment, which ignores all existing packages in favor of reinstalling them in `pip`'s internal, temporarily, and fresh Python prefix.\r\n\r\nThis is a problem for the openEMS extension, because the CSXCAD extension is a build-time dependency. For build isolation to work, `pip` must be able to find it and rebuild it again. But because CSXCAD/openEMS extensions are distributed within the git repo, not PyPI (and it's probably not a good idea to distribute git master to PyPI), Python doesn't have it in the isolated environment, and installation fails.\r\n\r\nFor developers like us, we may say that the feature is counterproductive, so we can disable it via `pip install --no-build-isolation`. But the standard is the standard, the \"official\" method must work (even if it's sub-optimal in our opinion).\r\n\r\nThis PR bypasses build isolation by a trick in `setup.py`.\r\n\r\n    sys.path.append(str(PATH_TO_CSXCAD_PYTHON_PACKAGE))\r\n\r\nWe rewrite the search path ourselves, without `pip` knowing. But by doing so, build isolation is defeated silently, which I think is not the correct way to deal with it. So I'm not sure whether it's the best way to implement it. It's one thing explicitly not to use build isolation, but it's another thing to disable it.\r\n\r\nAnother complication is that this will only work if users are using the full `openEMS-Project.git` repo, running it inside the individual `openEMS.git` repo won't work. The PR itself states the fact:\r\n\r\n```\r\n# TODO remove hardcoded path:\r\nPATH_TO_CSXCAD_PYTHON_PACKAGE = Path(__file__).parent.parent.parent/'CSXCAD/python'\r\n```\r\n\r\nGiven these considerations, what I'm considering is to do:\r\n\r\n    [build-system]\r\n    requires = [\r\n        \"setuptools\",\r\n        \"cython\",\r\n        \"CSXCAD @ git+https://github.com/thliebig/openEMS-Project@master#subdirectory=CSXCAD/python/\"; extra == 'project'\r\n        \"CSXCAD @ git+https://github.com/thliebig/CSXCAD@master#subdirectory=python/\"; extra == 'dev'\r\n    ]\r\n\r\nThis reclones the project, either the stable or latest version (because of a peculiar limitation that we're not allowed to use relative paths in `file://` here, some 3rd-party package managers such as `uv` and `pdm` actually use a non-standard variable known as `PROJECT_ROOT` to work around it - but we work with pip here). Since build isolation is an official feature, this is what Python developers dictate us to do. For project development, `--no-build-isolation` skips both and works for developers.\r\n\r\nAn alternative solution is to inject CSXCAD into `setup_requires` in `setup.py` instead, if we're inside `openEMS-Project`. This is the old-style way, but to my best knowledge, still works. I'm going to see how this plays out, and possibly implements it.\r\n\r\n---\r\n\r\nAnyway, hopefully I'm able to show that I didn't dismiss this PR because I want to reinvent the wheel. There are some genuine corner cases that require cares here.\r\n\r\nIn short, don't worry about any of these problems here, I've already assigned these problems to myself.","author_association":"CONTRIBUTOR","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3487249491/reactions","total_count":1,"+1":1,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null},{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3489668072","html_url":"https://github.com/thliebig/openEMS/pull/151#issuecomment-3489668072","issue_url":"https://api.github.com/repos/thliebig/openEMS/issues/151","id":3489668072,"node_id":"IC_kwDOADz_5s7QABvo","user":{"login":"biergaizi","id":1310693,"node_id":"MDQ6VXNlcjEzMTA2OTM=","avatar_url":"https://avatars.githubusercontent.com/u/1310693?v=4","gravatar_id":"","url":"https://api.github.com/users/biergaizi","html_url":"https://github.com/biergaizi","followers_url":"https://api.github.com/users/biergaizi/followers","following_url":"https://api.github.com/users/biergaizi/following{/other_user}","gists_url":"https://api.github.com/users/biergaizi/gists{/gist_id}","starred_url":"https://api.github.com/users/biergaizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biergaizi/subscriptions","organizations_url":"https://api.github.com/users/biergaizi/orgs","repos_url":"https://api.github.com/users/biergaizi/repos","events_url":"https://api.github.com/users/biergaizi/events{/privacy}","received_events_url":"https://api.github.com/users/biergaizi/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-11-05T07:04:53Z","updated_at":"2025-11-05T07:05:42Z","body":"Update: It turned out that the official solution was in the first page of the Python documentation:\r\n\r\n> It is also possible for a build backend to provide dynamically calculated build dependencies, using [PEP 517](https://peps.python.org/pep-0517/)’s get_requires_for_build_wheel hook. This hook will be called by pip, and dependencies it describes will also be installed in the build environment. For example, newer versions of setuptools expose the contents of setup_requires to pip via this hook.\r\n\r\nThe official discussion can be found here: [[FR] User configurable get_requires_for_build_wheel and get_requires_for_build_sdist #2854](https://github.com/pypa/setuptools/issues/2854)\r\n\r\nAn usage example from a practical project can be found here: https://github.com/PyO3/maturin/commit/0eb13a7ca781a8e9b3cadde83f0c31a956dde581\r\n\r\nBasically, by creating a `get_requires_for_build_wheel` hook, we can provide additional build-time dependencies to `pip` in addition to those listed in `pyproject.toml`. This elegantly solved the whole problem: we can always provide the dynamically-calculated absolute path to `CSXCAD` in a Python script without breaching build isolation. This is a method endorsed by Python developers and fully standard conformant. \r\n\r\nI'll implement this solution soon.","author_association":"CONTRIBUTOR","reactions":{"url":"https://api.github.com/repos/thliebig/openEMS/issues/comments/3489668072/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null,"minimized":null}]