diff options
author | Paul Ganssle <paul@ganssle.io> | 2019-01-31 08:29:36 -0500 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2019-02-07 08:08:14 -0500 |
commit | 179115b198387a21202433ea61cc53f2efd383fc (patch) | |
tree | 7689eb8f018a3e8c91a2714419d47e8a9e9ef43e /setuptools/tests | |
parent | c1243e96f05d3b13392a792144c97d9471581550 (diff) | |
download | external_python_setuptools-179115b198387a21202433ea61cc53f2efd383fc.tar.gz external_python_setuptools-179115b198387a21202433ea61cc53f2efd383fc.tar.bz2 external_python_setuptools-179115b198387a21202433ea61cc53f2efd383fc.zip |
Add support for setup.cfg-only projects
Many projects can get away with an empty `setup.py` and use *only* the
declarative `setup.cfg`. With the new PEP 517 backend, we can supply a
default empty `setup.py` if one is not provided.
Diffstat (limited to 'setuptools/tests')
-rw-r--r-- | setuptools/tests/test_build_meta.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 6236b9f4..74969322 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -110,6 +110,21 @@ defns = [ print('hello') """), }, + { + 'setup.cfg': DALS(""" + [metadata] + name = foo + version='0.0.0' + + [options] + py_modules=hello + setup_requires=six + """), + 'hello.py': DALS(""" + def run(): + print('hello') + """) + }, ] @@ -183,9 +198,13 @@ class TestBuildMetaBackend: # if the setup.py changes subsequent call of the build meta # should still succeed, given the # sdist_directory the frontend specifies is empty - with open(os.path.abspath("setup.py"), 'rt') as file_handler: + setup_loc = os.path.abspath("setup.py") + if not os.path.exists(setup_loc): + setup_loc = os.path.abspath("setup.cfg") + + with open(setup_loc, 'rt') as file_handler: content = file_handler.read() - with open(os.path.abspath("setup.py"), 'wt') as file_handler: + with open(setup_loc, 'wt') as file_handler: file_handler.write( content.replace("version='0.0.0'", "version='0.0.1'")) |