]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: move `build.py` to `build_c_extensions.py`
authorOto Šťáva <oto.stava@nic.cz>
Mon, 5 Feb 2024 16:03:44 +0000 (17:03 +0100)
committerOto Šťáva <oto.stava@nic.cz>
Thu, 15 Feb 2024 12:40:43 +0000 (13:40 +0100)
This fixes a problem on some systems, where the `build.py` file
conflicts with the `build` module required by Poetry.

See <https://github.com/python-poetry/poetry/issues/7576>.

manager/build_c_extensions.py [moved from manager/build.py with 100% similarity]
manager/pyproject.toml
manager/setup.py
manager/tests/packaging/dependencies.py

index e9615b7dc363d00fcec3609e625b186f9ba73e7f..4d220a7bd2c9c97799fa03ea71d06cf18dbf6533 100644 (file)
@@ -10,7 +10,7 @@ authors = [
 # See currently open issue about building C extensions here:
 # https://github.com/python-poetry/poetry/issues/2740
 [tool.poetry.build]
-script = "build.py"
+script = "build_c_extensions.py"
 generate-setup-file = true
 
 [tool.poetry.dependencies]
@@ -64,7 +64,7 @@ run-debug = { cmd = "scripts/run-debug", help = "Run the manager under debugger"
 docs = { cmd = "scripts/docs", help = "Create HTML documentation" }
 test = { shell = "env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=knot_resolver_manager --show-capture=all tests/unit/", help = "Run tests" }
 check = { cmd = "scripts/codecheck", help = "Run static code analysis" }
-format = { shell = "black knot_resolver_manager/ tests/ scripts/ build.py; isort -rc .", help = "Run code formatter" }
+format = { shell = "black knot_resolver_manager/ tests/ scripts/ build_c_extensions.py; isort -rc .", help = "Run code formatter" }
 fixdeps = { shell = "poetry install; npm install; npm update", help = "Install/update dependencies according to configuration files"}
 commit = { shell = "scripts/commit", help = "Invoke every single check before commiting" }
 container = { cmd = "scripts/container.py", help = "Manage containers" }
index 09d6d8810bc522c3c56d71192c3e066af66bbd9b..411951a6afd41a18cc107ab807e24d29e57577eb 100644 (file)
@@ -46,7 +46,7 @@ setup_kwargs = {
     'entry_points': entry_points,
     'python_requires': '>=3.7,<4.0',
 }
-from build import *
+from build_c_extensions import *
 build(setup_kwargs)
 
 setup(**setup_kwargs)
index 4a426b6e58b7b1df39e6f35a12d574713beb3eb2..d92be71a989c9ab4439ffab508d1216f1ca7b902 100755 (executable)
@@ -12,7 +12,7 @@ dummy = ModuleType("dummy")
 dummy.__dict__["setup"] = lambda *args, **kwargs: None
 dummy.__dict__["build"] = lambda *args, **kwargs: None
 sys.modules["setuptools"] = dummy
-sys.modules["build"] = dummy
+sys.modules["build_c_extensions"] = dummy
 
 # load install_requires array from setup.py
 spec = importlib.util.spec_from_file_location("setup", sys.argv[1] if len(sys.argv) == 2 else "manager/setup.py")