Skip to content

Commit 4206065

Browse files
committed
tox: use isolated build
Add pypoject.toml specifying the actual build dependencies. Update setup.py with similar requirements. Signed-off-by: Robin Jarry <[email protected]>
1 parent a70e2bf commit 4206065

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
requires = [
3+
# The minimum setuptools version is specific to the PEP 517 backend,
4+
# and may be stricter than the version required in `setup.py`
5+
"setuptools>=40.6.0",
6+
"cffi; platform_python_implementation != 'PyPy'",
7+
]
8+
build-backend = "setuptools.build_meta"

setup.py

+7-11
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,10 @@
66
import os
77
import re
88
import subprocess
9-
import sys
109

1110
import setuptools
1211

1312

14-
CFFI_REQ = 'cffi>=1.7,!=1.11.3'
15-
INSTALL_REQS = []
16-
SETUP_REQS = []
17-
if '_cffi_backend' not in sys.builtin_module_names:
18-
INSTALL_REQS.append(CFFI_REQ)
19-
SETUP_REQS.append(CFFI_REQ)
20-
21-
2213
#------------------------------------------------------------------------------
2314
if os.environ.get('LIBYANG_INSTALL', 'system') == 'embed':
2415
raise NotImplementedError(
@@ -126,8 +117,13 @@ def _version():
126117
zip_safe=False,
127118
include_package_data=True,
128119
python_requires='>=3.5',
129-
setup_requires=SETUP_REQS,
130-
install_requires=INSTALL_REQS,
120+
setup_requires=[
121+
'setuptools',
122+
'cffi; platform_python_implementation != "PyPy"',
123+
],
124+
install_requires=[
125+
'cffi; platform_python_implementation != "PyPy"',
126+
],
131127
cffi_modules=['cffi/build.py:BUILDER'],
132128
cmdclass={
133129
},

tox.ini

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[tox]
22
envlist = lint,py{35,36,37,38,py3},py3-{master,devel}
33
skip_missing_interpreters = true
4+
isolated_build = true
5+
distdir = {toxinidir}/dist
6+
7+
[tox:.package]
8+
basepython = python3
49

510
[testenv]
611
description = Compile extension and run tests against {envname}.

0 commit comments

Comments
 (0)