we want to generate /-separated paths setup.cfg files even under win32
This commit is contained in:
parent
95c7c46077
commit
2db5674a95
|
@ -383,19 +383,25 @@ class MainProgram:
|
||||||
path_tokens.sort(key=cmp_to_key(length_comparison))
|
path_tokens.sort(key=cmp_to_key(length_comparison))
|
||||||
for dest, srcs in (dist.data_files or []):
|
for dest, srcs in (dist.data_files or []):
|
||||||
dest = os.path.join(sys.prefix, dest)
|
dest = os.path.join(sys.prefix, dest)
|
||||||
|
dest = dest.replace(os.path.sep, '/')
|
||||||
for tok, path in path_tokens:
|
for tok, path in path_tokens:
|
||||||
if dest.startswith(path):
|
path = path.replace(os.path.sep, '/')
|
||||||
dest = ('{%s}' % tok) + dest[len(path):]
|
if not dest.startswith(path):
|
||||||
files = [('/ '.join(src.rsplit('/', 1)), dest)
|
|
||||||
for src in srcs]
|
|
||||||
data['resources'].extend(files)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
dest = ('{%s}' % tok) + dest[len(path):]
|
||||||
|
files = [('/ '.join(src.rsplit('/', 1)), dest)
|
||||||
|
for src in srcs]
|
||||||
|
data['resources'].extend(files)
|
||||||
|
|
||||||
# 2.2 package_data -> extra_files
|
# 2.2 package_data -> extra_files
|
||||||
package_dirs = dist.package_dir or {}
|
package_dirs = dist.package_dir or {}
|
||||||
for package, extras in iter(dist.package_data.items()) or []:
|
for package, extras in iter(dist.package_data.items()) or []:
|
||||||
package_dir = package_dirs.get(package, package)
|
package_dir = package_dirs.get(package, package)
|
||||||
files = [os.path.join(package_dir, f) for f in extras]
|
for file_ in extras:
|
||||||
data['extra_files'].extend(files)
|
if package_dir:
|
||||||
|
file_ = package_dir + '/' + file_
|
||||||
|
data['extra_files'].append(file_)
|
||||||
|
|
||||||
# Use README file if its content is the desciption
|
# Use README file if its content is the desciption
|
||||||
if "description" in data:
|
if "description" in data:
|
||||||
|
|
Loading…
Reference in New Issue