summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-05-18 14:01:08 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-21 18:25:30 +0100
commit0058306889e7c2edc7e1845ae66a2ef4c65c7748 (patch)
tree212883177896fed64ed163065b7caeb2092c4621
parent5ea4da601d3a862934fc595cec7c3ea53fe5b9ff (diff)
downloadbuildstream-bschubert/ensure-cython.tar.gz
Introduce pyproject.tomlbschubert/ensure-cython
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.
-rw-r--r--MANIFEST.in3
-rw-r--r--pyproject.toml8
-rwxr-xr-xsetup.py6
-rw-r--r--tox.ini6
4 files changed, 21 insertions, 2 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 729a3e957..1dace8a01 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 c550fdd0b..097dd6a51 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
##################################################################
diff --git a/tox.ini b/tox.ini
index 6d5a7c575..d0c1f4452 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 =