From 5919b63e9abe1545bd266fac4d0cad3f080c50b2 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 23 Dec 2023 20:40:26 +0100 Subject: [PATCH 1/3] setup.py: drop deprecated setup_requires, fixes #6068 We now use pyproject.toml for that. Also, drop the >=1.7 requirement for setuptools_scm, that was from 2015 and we assume it is not used any more anyway. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 624add8f3..fab8e3521 100644 --- a/setup.py +++ b/setup.py @@ -306,7 +306,6 @@ setup( }, cmdclass=cmdclass, ext_modules=ext_modules, - setup_requires=['setuptools_scm>=1.7'], install_requires=install_requires, extras_require=extras_require, python_requires='>=3.9', From 021d08c8befc402261aca31ceeab53bf5bbd2ee8 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 24 Dec 2023 18:22:31 +0100 Subject: [PATCH 2/3] fix msys build build the sdist and wheel using "build", avoid using setup.py. use "pip install -e ." before invoking pyinstaller, so we have the _version.py built by setuptools_scm and also it compiled the extension modules, so pyinstaller can pick them up. msys2 hack: https://stackoverflow.com/questions/76079590/error-plat-name-must-be-one-of-win32-win-amd64-win-arm32-win-arm6 --- scripts/msys2-build | 7 +++++-- scripts/msys2-install-deps | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/msys2-build b/scripts/msys2-build index 9f6ff5204..377d879a3 100644 --- a/scripts/msys2-build +++ b/scripts/msys2-build @@ -1,5 +1,8 @@ #!/bin/bash -python setup.py build_ext --inplace -python setup.py bdist_wheel +# build borg.exe +SETUPTOOLS_USE_DISTUTILS=stdlib pip install -e . pyinstaller -y scripts/borg.exe.spec + +# build sdist and wheel in dist/... +SETUPTOOLS_USE_DISTUTILS=stdlib python -m build diff --git a/scripts/msys2-install-deps b/scripts/msys2-install-deps index 637008a43..a9a20f678 100644 --- a/scripts/msys2-install-deps +++ b/scripts/msys2-install-deps @@ -1,4 +1,4 @@ #!/bin/bash -pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,python,cython,python-setuptools,python-wheel,python-pkgconfig,python-packaging,python-msgpack,python-pip} +pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,python,cython,python-setuptools,python-wheel,python-build,python-pkgconfig,python-packaging,python-msgpack,python-pip} pip install pyinstaller==5.13.2 From 84df37a19f3b0cdd0c82fb0b17ea546d8cd5c821 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 24 Dec 2023 18:44:47 +0100 Subject: [PATCH 3/3] use less setup.py, use pip and build todo: clean clean2 build_usage build_man --- .github/workflows/ci.yml | 3 +-- Vagrantfile | 3 +-- requirements.d/development.lock.txt | 1 + requirements.d/development.txt | 1 + scripts/sdist-sign | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c743dc99..3d85d391c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,8 +122,7 @@ jobs: # so, set it here, again. PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH" run: | - # pip install -e . - python setup.py -v develop + pip install -e . - name: run pytest via tox env: # we already have that in the global env, but something is broken and overwrites that. diff --git a/Vagrantfile b/Vagrantfile index c8d382e23..2a56aa8b5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -193,8 +193,7 @@ def install_borg(fuse) pip install -U wheel # upgrade wheel, might be too old cd borg pip install -r requirements.d/development.lock.txt - python setup.py clean - python setup.py clean2 + python setup.py clean clean2 pip install -e .[#{fuse}] EOF end diff --git a/requirements.d/development.lock.txt b/requirements.d/development.lock.txt index c2a765cd4..55a51cdea 100644 --- a/requirements.d/development.lock.txt +++ b/requirements.d/development.lock.txt @@ -2,6 +2,7 @@ setuptools==69.0.3 setuptools-scm==8.0.4 pip==23.3.2 virtualenv==20.25.0 +build==1.0.3 pkgconfig==1.5.5 tox==4.11.4 pytest==7.4.3 diff --git a/requirements.d/development.txt b/requirements.d/development.txt index 270cdaf5a..309bd72e6 100644 --- a/requirements.d/development.txt +++ b/requirements.d/development.txt @@ -2,6 +2,7 @@ setuptools>=64 setuptools_scm>=8 pip virtualenv +build pkgconfig tox pytest diff --git a/scripts/sdist-sign b/scripts/sdist-sign index 50758a30a..81dd92365 100755 --- a/scripts/sdist-sign +++ b/scripts/sdist-sign @@ -13,7 +13,7 @@ else GPG=qubes-gpg-client-wrapper fi -python setup.py sdist +python -m build D=dist/borgbackup-$R.tar.gz