Skip to content

Commit

Permalink
Better error message when build dependencies not satisfied (#1628)
Browse files Browse the repository at this point in the history
This only manifests on old platforms, but as we still support them
makes sense to provide better error messages, and relax a bit our
build requirements.

Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat authored Feb 14, 2020
1 parent 5e64776 commit 1d9b7d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docs/changelog/1621.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fail with better error message if trying to install source with unsupported ``setuptools``, allow ``setuptools-scm >= 2``
and move to legacy ``setuptools-scm`` format to support better older platforms (``CentOS 7`` and such) - by :user:`gaborbernat`.
9 changes: 1 addition & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
requires = [
"setuptools >= 41.0.0",
"wheel >= 0.30.0",
"setuptools_scm[toml]>=3.4",
"setuptools_scm >= 2",
]
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]
write_to = "src/virtualenv/version.py"
write_to_template = """
\"\"\" Version information \"\"\"
__version__ = "{version}"
"""

[tool.black]
line-length = 120

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[metadata]
name = virtualenv
version = attr: virtualenv.__version__
description = Virtual Python Environment builder
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from setuptools import setup
from setuptools import __version__, setup

setup()
if int(__version__.split(".")[0]) < 41:
raise RuntimeError("setuptools >= 41 required to build")

setup(
use_scm_version={"write_to": "src/virtualenv/version.py", "write_to_template": '__version__ = "{version}"'},
setup_requires=["setuptools_scm >= 2"],
)

0 comments on commit 1d9b7d1

Please sign in to comment.