configure isolated builds, with declarative setuptools

This commit is contained in:
Thomas Grainger 2020-10-09 09:17:51 +01:00
parent 25aca8f56b
commit 4f1376f4fd
No known key found for this signature in database
GPG Key ID: E452A1247BAC1A88
5 changed files with 19 additions and 18 deletions

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = [ "setuptools >= 35.0.2", "wheel >= 0.29.0"]
build-backend = "setuptools.build_meta"

View File

@ -1,5 +1,6 @@
[metadata]
name = incremental
version = attr: incremental._setuptools_version
maintainer = Amber Brown
maintainer_email = hawkowl@twistedmatrix.com
url = https://github.com/twisted/incremental

View File

@ -1,18 +0,0 @@
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import sys
from setuptools import setup
base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "src")
# We need to import outselves
sys.path.insert(0, src_dir)
import incremental
setup(version=incremental.__version__.base())

View File

@ -391,4 +391,8 @@ def _get_version(dist, keyword, value):
from ._version import __version__ # noqa
def _setuptools_version():
return __version__.public()
__all__ = ["__version__", "Version", "getVersionString"]

11
tox.ini
View File

@ -1,4 +1,9 @@
[tox]
minversion = 3.23.0
requires =
virtualenv >= 20.4.3
tox-wheel >= 0.6.0
isolated_build = true
envlist =
flake8,
tests,
@ -7,6 +12,8 @@ envlist =
[testenv]
wheel = true
wheel_build_env = build
deps =
tests: coverage
apidocs: pydoctor
@ -41,3 +48,7 @@ commands =
setenv =
; Clear the --check flag
BLACK_LINT_ARGS=
[testenv:build]
# empty environment to build universal wheel once per tox invocation
# https://github.com/ionelmc/tox-wheel#build-configuration