aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/sdist.py
diff options
context:
space:
mode:
authorRandy Syring <randy.syring@lev12.com>2014-09-20 16:29:41 -0400
committerRandy Syring <randy.syring@lev12.com>2014-09-20 16:29:41 -0400
commit4e5c7d0657a9719d2fa961c852daf0926de91ae3 (patch)
tree61201fb51fa5291806e2d4d7b88a1794137172b6 /setuptools/command/sdist.py
parent394ea0c104e7da5cf583680b418c3e5e4b9858d4 (diff)
downloadexternal_python_setuptools-4e5c7d0657a9719d2fa961c852daf0926de91ae3.tar.gz
external_python_setuptools-4e5c7d0657a9719d2fa961c852daf0926de91ae3.tar.bz2
external_python_setuptools-4e5c7d0657a9719d2fa961c852daf0926de91ae3.zip
sdist command: fix case insensitivity when adding some files to filelist
This should fix the problem in Bitbucket issue #100. It gives the same behavior for inclusion of default files (README*, etc.) on Windows as Linux. BACKWARDS INCOMPATABILITY: This may result in a backwards incompatible change for users on a case insensitive file system. If they were relying on some files getting included in their distribution due to setuptools defaults, and their files do not have the same case as the files being looked for in setuptools, those files will no longer be included in the package. For example, if a package had a file: readme.rst Previous to this commit, that file would have been included in the distribution as: README.rst But it will now no longer be included at all. To get the file included in the package, it can be added to the package's MANIFEST.in file: include readme.rst Files affected by this change will have a case variant of the files or patterns listed below: README README.txt README.rst setup.py (or whatever your setuptools script is named) setup.cfg test/test*.py
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-xsetuptools/command/sdist.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index 2aa1ee20..dc8d6773 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -8,6 +8,8 @@ import sys
from setuptools import svn_utils
from setuptools.compat import PY3
+from setuptools.utils import cs_path_exists
+
import pkg_resources
READMES = ('README', 'README.rst', 'README.txt')
@@ -146,7 +148,7 @@ class sdist(orig.sdist):
alts = fn
got_it = 0
for fn in alts:
- if os.path.exists(fn):
+ if cs_path_exists(fn):
got_it = 1
self.filelist.append(fn)
break
@@ -155,16 +157,17 @@ class sdist(orig.sdist):
self.warn("standard file not found: should have one of " +
', '.join(alts))
else:
- if os.path.exists(fn):
+ if cs_path_exists(fn):
self.filelist.append(fn)
else:
self.warn("standard file '%s' not found" % fn)
optional = ['test/test*.py', 'setup.cfg']
for pattern in optional:
- files = list(filter(os.path.isfile, glob(pattern)))
+ files = list(filter(cs_path_exists, glob(pattern)))
if files:
- self.filelist.extend(files)
+ actual_fnames = map(os.path.normcase, files)
+ self.filelist.extend(actual_fnames)
# getting python files
if self.distribution.has_pure_modules():