summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri+github@gmail.com>2022-10-20 13:53:00 +0100
committerGitHub <noreply@github.com>2022-10-20 15:53:00 +0300
commiteaa09fc98065a023699f36bb6a127b86cdde90c3 (patch)
tree9b3ddc6bd50cb7973914104f910f8ff3e09f62f2 /src
parent048b2ced1ad2ac1726ea556ed8049318b3e40b33 (diff)
downloadwheel-git-eaa09fc98065a023699f36bb6a127b86cdde90c3.tar.gz
Add support for `license_files` specified in `setup.py` (#466)
Wheel now leans on setuptools to provide the necessary information.
Diffstat (limited to 'src')
-rw-r--r--src/wheel/bdist_wheel.py35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py
index 929864e..7cbd140 100644
--- a/src/wheel/bdist_wheel.py
+++ b/src/wheel/bdist_wheel.py
@@ -15,7 +15,6 @@ import sysconfig
import warnings
from collections import OrderedDict
from email.generator import BytesGenerator, Generator
-from glob import iglob
from io import BytesIO
from shutil import rmtree
from sysconfig import get_config_var
@@ -432,38 +431,8 @@ class bdist_wheel(Command):
@property
def license_paths(self):
- metadata = self.distribution.get_option_dict("metadata")
- files = set()
- patterns = sorted(
- {option for option in metadata.get("license_files", ("", ""))[1].split()}
- )
-
- if "license_file" in metadata:
- warnings.warn(
- 'The "license_file" option is deprecated. Use '
- '"license_files" instead.',
- DeprecationWarning,
- )
- files.add(metadata["license_file"][1])
-
- if "license_file" not in metadata and "license_files" not in metadata:
- patterns = ("LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*")
-
- for pattern in patterns:
- for path in iglob(pattern):
- if path.endswith("~"):
- log.debug(
- f'ignoring license file "{path}" as it looks like a ' f"backup"
- )
- continue
-
- if path not in files and os.path.isfile(path):
- log.info(
- f'adding license file "{path}" (matched pattern "{pattern}")'
- )
- files.add(path)
-
- return files
+ metadata = self.distribution.metadata
+ return sorted(metadata.license_files or [])
def egg2dist(self, egginfo_path, distinfo_path):
"""Convert an .egg-info directory into a .dist-info directory"""