diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-05-18 14:01:08 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-05-21 18:25:30 +0100 |
commit | 0058306889e7c2edc7e1845ae66a2ef4c65c7748 (patch) | |
tree | 212883177896fed64ed163065b7caeb2092c4621 | |
parent | 5ea4da601d3a862934fc595cec7c3ea53fe5b9ff (diff) | |
download | buildstream-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.in | 3 | ||||
-rw-r--r-- | pyproject.toml | 8 | ||||
-rwxr-xr-x | setup.py | 6 | ||||
-rw-r--r-- | tox.ini | 6 |
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" @@ -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 ################################################################## @@ -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 = |