Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message when build dependencies not satisfied #1628

Merged
merged 1 commit into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly using the toml config degrades really bad on old platforms, so we've dropped it's usage in line with https://github.com/pypa/setuptools_scm#setuppy-usage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pradyunsg 😢

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"],
)