summaryrefslogtreecommitdiff
path: root/setuptools/tests/integration
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-07 18:49:19 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-07 18:49:19 +0000
commit7ff3dc10dc763a24cc9c3b44e713167b0485a340 (patch)
tree9042dbb51d9de95eb41b6eac0490002a38230c99 /setuptools/tests/integration
parent64386bae6be26dca1439eab833659dfc299d43bf (diff)
parent418b58e24823803690b39d20bdb599c9bc74bd62 (diff)
downloadpython-setuptools-git-7ff3dc10dc763a24cc9c3b44e713167b0485a340.tar.gz
Automatic discovery of packages, py_modules and name (#2894)
It is desirable to have some configurations automatically derived. This is definitely possible for packages and py_modules, and (based on these two) also for name. This change adds a new class `setuptools.discovery.ConfigDiscovery` implementing the automatic discovery logic for packages, py_modules and name.
Diffstat (limited to 'setuptools/tests/integration')
-rw-r--r--setuptools/tests/integration/helpers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/setuptools/tests/integration/helpers.py b/setuptools/tests/integration/helpers.py
index 43f43902..24c02be0 100644
--- a/setuptools/tests/integration/helpers.py
+++ b/setuptools/tests/integration/helpers.py
@@ -8,6 +8,7 @@ import os
import subprocess
import tarfile
from zipfile import ZipFile
+from pathlib import Path
def run(cmd, env=None):
@@ -59,3 +60,16 @@ class Archive:
raise ValueError(msg)
return str(content.read(), "utf-8")
return str(self._obj.read(zip_or_tar_info), "utf-8")
+
+
+def get_sdist_members(sdist_path):
+ with tarfile.open(sdist_path, "r:gz") as tar:
+ files = [Path(f) for f in tar.getnames()]
+ # remove root folder
+ relative_files = ("/".join(f.parts[1:]) for f in files)
+ return {f for f in relative_files if f}
+
+
+def get_wheel_members(wheel_path):
+ with ZipFile(wheel_path) as zipfile:
+ return set(zipfile.namelist())