diff options
| -rw-r--r-- | src/wheel/bdist_wheel.py | 4 | ||||
| -rw-r--r-- | tests/test_bdist_wheel.py | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index 5cece1f..5bc9265 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -339,6 +339,10 @@ class bdist_wheel(Command): for pattern in patterns: for path in iglob(pattern): + if path.endswith('~'): + logger.debug('ignoring license file "%s" as it looks like a backup', path) + continue + if path not in files and os.path.isfile(path): logger.info('adding license file "%s" (matched pattern "%s")', path, pattern) files.add(path) diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py index 67df435..91eb8c1 100644 --- a/tests/test_bdist_wheel.py +++ b/tests/test_bdist_wheel.py @@ -21,6 +21,9 @@ DEFAULT_LICENSE_FILES = { 'LICENSE', 'LICENSE.txt', 'LICENCE', 'LICENCE.txt', 'COPYING', 'COPYING.md', 'NOTICE', 'NOTICE.rst', 'AUTHORS', 'AUTHORS.txt' } +OTHER_IGNORED_FILES = { + 'LICENSE~', 'AUTHORS~', +} @pytest.fixture @@ -34,7 +37,7 @@ setup( version='1.0' ) """) - for fname in DEFAULT_LICENSE_FILES: + for fname in DEFAULT_LICENSE_FILES | OTHER_IGNORED_FILES: basedir.join(fname).write('') basedir.join('licenses').mkdir().join('DUMMYFILE').write('') |
