diff options
author | Thomas Grainger <tagrain@gmail.com> | 2019-12-06 11:22:38 +0000 |
---|---|---|
committer | Bernát Gábor <bgabor8@bloomberg.net> | 2019-12-06 11:22:38 +0000 |
commit | 2343c6a010bfdb24577e86ad7c3606ce8d12da62 (patch) | |
tree | 99909e959f7b8bae857e7c67c2409dc66d0e79b4 /src | |
parent | 760b0343808c8a8439784036827cfcb1c98e441f (diff) | |
download | tox-git-2343c6a010bfdb24577e86ad7c3606ce8d12da62.tar.gz |
clarify legacy setup.py error message further (#1478)
a follow up to #1467
Diffstat (limited to 'src')
-rw-r--r-- | src/tox/package/builder/legacy.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/tox/package/builder/legacy.py b/src/tox/package/builder/legacy.py index 935a68ab..ffe5ebd0 100644 --- a/src/tox/package/builder/legacy.py +++ b/src/tox/package/builder/legacy.py @@ -8,16 +8,26 @@ from tox.util.path import ensure_empty_dir def make_sdist(config, session): setup = config.setupdir.join("setup.py") - if not setup.check(): + pyproject = config.setupdir.join("pyproject.toml") + setup_check = setup.check() + if not setup_check and not pyproject.check(): reporter.error( - "No setup.py file found. The expected location is:\n" - " {}\n" + "No pyproject.toml or setup.py file found. The expected locations are:\n" + " {pyproject} or {setup}\n" "You can\n" " 1. Create one:\n" " https://tox.readthedocs.io/en/latest/example/package.html\n" " 2. Configure tox to avoid running sdist:\n" " https://tox.readthedocs.io/en/latest/example/general.html\n" - " 3. Configure tox to use an isolated_build".format(setup) + " 3. Configure tox to use an isolated_build".format(pyproject=pyproject, setup=setup) + ) + raise SystemExit(1) + if not setup_check: + reporter.error( + "pyproject.toml file found.\n" + "To use a PEP 517 build-backend you are required to " + "configure tox to use an isolated_build:\n" + "https://tox.readthedocs.io/en/latest/example/package.html\n" ) raise SystemExit(1) with session.newaction("GLOB", "packaging") as action: |