From 6cbb7d650fcab4181429572b199267c40c066796 Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Fri, 25 Feb 2022 06:29:01 +0300 Subject: [PATCH 1/5] Add pyproject.toml This blocks #6264 because black configuration is stored in pyproject.toml. See I copied this from --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..fed528d4a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" From 142bb0e3d4aa2b689489b772501a4186b8f4470b Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Fri, 25 Feb 2022 07:52:50 +0300 Subject: [PATCH 2/5] setup.py: add parent to sys.path When using pyproject.toml the parent of setup.py is not on sys.path by default. See --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 98a844269..977035d7d 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ try: except ImportError: cythonize = None +sys.path += [os.path.dirname(__file__)] import setup_checksums import setup_compress import setup_crypto From 4df8255e6238fdf6761859fd65746f0c4d817b2d Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Fri, 25 Feb 2022 08:04:45 +0300 Subject: [PATCH 3/5] Add pkgconfig build requirement setup_crypto.crypto_ext_kwargs needs pkgconfig to find OpenSSL --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fed528d4a..37259982b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools", "pkgconfig"] build-backend = "setuptools.build_meta" From 30c145ec538e605305bf0d8d67cf7589c45bb596 Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Fri, 25 Feb 2022 08:17:34 +0300 Subject: [PATCH 4/5] pyproject.toml: running setup.py also requires Cython --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 37259982b..cda60db81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "pkgconfig"] +requires = ["setuptools", "pkgconfig", "Cython!=0.27"] build-backend = "setuptools.build_meta" From aba16ba0d427b59428b5540b7e93a60ca12cfcae Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Tue, 1 Mar 2022 08:44:40 +0300 Subject: [PATCH 5/5] CodeQL: Use venv A bug in pip or possibly setuptools broke editable installs into the per-user directory for packages that have pyproject.toml See https://github.com/pypa/setuptools/issues/3019 --- .github/workflows/codeql-analysis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 43e0aef9e..69b63ee29 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -64,6 +64,8 @@ jobs: sudo apt-get update sudo apt-get install -y pkg-config build-essential sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev + python3 -m venv ../borg-env + source ../borg-env/bin/activate pip3 install -r requirements.d/development.txt pip3 install -e .