diff options
author | Cristián Maureira-Fredes <[email protected]> | 2024-01-26 15:17:51 +0100 |
---|---|---|
committer | Cristián Maureira-Fredes <[email protected]> | 2024-01-26 16:20:13 +0100 |
commit | 29bc67566bf037d021da72e42290011c9d6d0206 (patch) | |
tree | 2db707edb13b1b1ba6506857e83e89b34aebcf78 | |
parent | 1cd5bd554ed4cfb52dd0cd18bc4eace8676fe9d7 (diff) |
build: move deps from setup.py to pyproject.toml
The usage of the new 'build' package version made the
install_requires statement in our setup.py worthless,
so we need to move for pyproject-specific configuration
in order to get dependencies installed for some of our
packages.
Pick-to: 6.6
Change-Id: I4e010e9c13ab005616b2e3948e3024da2a79ebea
Reviewed-by: Shyamnath Premnadh <[email protected]>
Reviewed-by: Friedemann Kleint <[email protected]>
-rw-r--r-- | create_wheels.py | 28 | ||||
-rw-r--r-- | wheel_artifacts/pyproject.toml.base | 1 | ||||
-rw-r--r-- | wheel_artifacts/setup.py.base | 1 |
3 files changed, 15 insertions, 15 deletions
diff --git a/create_wheels.py b/create_wheels.py index 5a157183a..783a363e9 100644 --- a/create_wheels.py +++ b/create_wheels.py @@ -137,6 +137,7 @@ def get_platform_tag() -> str: def generate_pyproject_toml(artifacts: Path, setup: SetupData) -> str: content = None + _name = setup.name _tag = get_platform_tag() _console_scripts = "" @@ -144,6 +145,18 @@ def generate_pyproject_toml(artifacts: Path, setup: SetupData) -> str: _formatted_console_scripts = "\n".join(setup.console_scripts) _console_scripts = f"[project.scripts]\n{_formatted_console_scripts}" + # Installing dependencies + _dependencies = [] + if _name in ("PySide6", "PySide6_Examples"): + _dependencies.append(f"shiboken6=={setup.version[0]}") + _dependencies.append(f"PySide6_Essentials=={setup.version[0]}") + _dependencies.append(f"PySide6_Addons=={setup.version[0]}") + elif _name == "PySide6_Essentials": + _dependencies.append(f"shiboken6=={setup.version[0]}") + elif _name == "PySide6_Addons": + _dependencies.append(f"shiboken6=={setup.version[0]}") + _dependencies.append(f"PySide6_Essentials=={setup.version[0]}") + with open(artifacts / "pyproject.toml.base") as f: content = ( f.read() @@ -153,8 +166,8 @@ def generate_pyproject_toml(artifacts: Path, setup: SetupData) -> str: .replace("PROJECT_README", f'"{setup.readme}"') .replace("PROJECT_TAG", f'"{_tag}"') .replace("PROJECT_SCRIPTS", _console_scripts) + .replace("PROJECT_DEPENDENCIES", f"{_dependencies}") ) - return content @@ -173,18 +186,6 @@ def generate_setup_py(artifacts: Path, setup: SetupData): else: fext = "Shiboken" - # Installing dependencies - install_requires = [] - if name in ("PySide6", "PySide6_Examples"): - install_requires.append(f"shiboken6=={setup.version[0]}") - install_requires.append(f"PySide6_Essentials=={setup.version[0]}") - install_requires.append(f"PySide6_Addons=={setup.version[0]}") - elif _name == "PySide6_Essentials": - install_requires.append(f"shiboken6=={setup.version[0]}") - elif _name == "PySide6_Addons": - install_requires.append(f"shiboken6=={setup.version[0]}") - install_requires.append(f"PySide6_Essentials=={setup.version[0]}") - # For special wheels based on 'PySide6' # we force the name to be PySide6 for the package_name, # so we can take the files from that packaged-directory @@ -195,7 +196,6 @@ def generate_setup_py(artifacts: Path, setup: SetupData): content = f.read().format( name=_name, fake_ext=fext, - install=install_requires, ) return content diff --git a/wheel_artifacts/pyproject.toml.base b/wheel_artifacts/pyproject.toml.base index 28ca43b8e..9e8546e80 100644 --- a/wheel_artifacts/pyproject.toml.base +++ b/wheel_artifacts/pyproject.toml.base @@ -13,6 +13,7 @@ dynamic = ["version"] requires-python = ">=3.8, <3.13" keywords = ["Qt"] license = {text = "LGPL"} +dependencies = PROJECT_DEPENDENCIES classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", diff --git a/wheel_artifacts/setup.py.base b/wheel_artifacts/setup.py.base index 9de30af5f..d65f746ee 100644 --- a/wheel_artifacts/setup.py.base +++ b/wheel_artifacts/setup.py.base @@ -21,7 +21,6 @@ setup_args = dict( include_package_data=True, packages = ["{name}"], ext_modules = [Extension("{fake_ext}", [], py_limited_api=True)], - install_requires={install}, cmdclass=dict([("build_ext", build_ext)]), ) setup(**setup_args) |