summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-05-18 14:01:08 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-05-29 19:47:57 +0100
commitd220c4c3bcf31b9d4660a6e915e70269c891bd9f (patch)
tree249c9a16fe33a7af41b71e035abbbbee0268daba
parent7c9004b0d2836f8c2349f13f9e3d4bdc1eb6b8ed (diff)
downloadbuildstream-d220c4c3bcf31b9d4660a6e915e70269c891bd9f.tar.gz
Introduce pyproject.toml
Using pyproject.toml, defined in PEP518, allows us to have an isolated build environment, ensuring that Cython can be installed before calling setup.py in tox. This allows us to use cython helpers in the setup.py script. This is a prerequisite for introducing Cython in the codebase
-rw-r--r--.gitignore3
-rw-r--r--MANIFEST.in3
-rw-r--r--pyproject.toml8
-rwxr-xr-xsetup.py6
-rw-r--r--tox.ini6
5 files changed, 24 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 3bc4e29af..340d7ebe4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,9 @@ build
# Setuptools distribution folder.
/dist/
+# Pip build metadata
+pip-wheel-metadata/
+
# Python egg metadata, regenerated from source files by setuptools.
/src/*.egg-info
.eggs
diff --git a/MANIFEST.in b/MANIFEST.in
index d0de0e593..7be35c0be 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -43,3 +43,6 @@ include requirements/plugin-requirements.txt
# Versioneer
include versioneer.py
+
+# setuptools.build_meta don't include setup.py by default. Add it
+include setup.py
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 000000000..38bb870e3
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,8 @@
+[build-system]
+requires = [
+ # We need at least version 36.6.0 that introduced "build_meta"
+ "setuptools>=36.6.0",
+ # In order to build wheels, and as required by PEP 517
+ "wheel"
+]
+build-backend = "setuptools.build_meta"
diff --git a/setup.py b/setup.py
index 267ca6fb4..0caf7bae9 100755
--- a/setup.py
+++ b/setup.py
@@ -19,13 +19,15 @@
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
import os
+from pathlib import Path
import re
import shutil
import subprocess
import sys
-import versioneer
-from pathlib import Path
+# Add local directory to the path, in order to be able to import versioneer
+sys.path.append(os.path.dirname(__file__))
+import versioneer # noqa
##################################################################
diff --git a/tox.ini b/tox.ini
index a7a4874c7..0a269c17d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,6 +4,7 @@
[tox]
envlist = py{35,36,37}
skip_missing_interpreters = true
+isolated_build = true
#
# Defaults for all environments
@@ -147,3 +148,8 @@ deps =
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
-rrequirements/plugin-requirements.txt
+
+# When building using PEP518 and 517, we don't want default dependencies
+# installed by the base environment.
+[testenv:.package]
+deps =