Skip to content

Commit

Permalink
Fix bogus '. missing from VCS' error
Browse files Browse the repository at this point in the history
I've only started seeing this error today, only on Appveyor (but not on
my Windows Jenkins instance), and only on Python 2.7.

Somehow the sdist archive mentions the top-level directory name twice,
once with a slash, and once without.  Possibly my own preprocessors
could've been adding the second entry.  Anyway, strip it.

Again, I've no idea how I never saw this before.  Did Appveyor update
their Python or something?  Maybe a newer setuptools caused this?
  • Loading branch information
mgedmin committed May 19, 2019
1 parent d0b583d commit 403d640
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ install:
- choco install bzr
- "set PATH=C:\\Program Files (x86)\\Bazaar;%PATH%"
- bzr --version
- git --version
- svn --version
- hg --version

build: off

Expand Down
5 changes: 4 additions & 1 deletion check_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ def strip_toplevel_name(filelist):
>>> strip_toplevel_name(['a', 'a/b', 'a/c', 'a/c/d'])
['b', 'c', 'c/d']
>>> strip_toplevel_name(['a', 'a/', 'a/b', 'a/c', 'a/c/d'])
['b', 'c', 'c/d']
>>> strip_toplevel_name(['a/b', 'a/c', 'a/c/d'])
['b', 'c', 'c/d']
Expand All @@ -300,7 +303,7 @@ def strip_toplevel_name(filelist):
if not name.startswith(prefix):
raise Failure("File doesn't have the common prefix (%s): %s"
% (name, prefix))
return [name[len(prefix):] for name in names]
return [name[len(prefix):] for name in names if name != prefix]


def add_prefix_to_each(prefix, filelist):
Expand Down
10 changes: 6 additions & 4 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,19 +1394,20 @@ def test_forgot_to_git_add_anything(self):
def test_all_is_well(self):
from check_manifest import check_manifest
self._create_repo_with_code()
self.assertTrue(check_manifest())
self.assertTrue(check_manifest(), sys.stderr.getvalue())

def test_relative_pathname(self):
from check_manifest import check_manifest
subdir = self._create_repo_with_code_in_subdir()
self.assertTrue(check_manifest(subdir))
self.assertTrue(check_manifest(subdir), sys.stderr.getvalue())

def test_relative_python(self):
# https://github.com/mgedmin/check-manifest/issues/36
from check_manifest import check_manifest
subdir = self._create_repo_with_code_in_subdir()
python = os.path.relpath(sys.executable)
self.assertTrue(check_manifest(subdir, python=python))
self.assertTrue(check_manifest(subdir, python=python),
sys.stderr.getvalue())

def test_python_from_path(self):
# https://github.com/mgedmin/check-manifest/issues/57
Expand All @@ -1418,7 +1419,8 @@ def test_python_from_path(self):
if shutil.which(python):
break
subdir = self._create_repo_with_code_in_subdir()
self.assertTrue(check_manifest(subdir, python=python))
self.assertTrue(check_manifest(subdir, python=python),
sys.stderr.getvalue())

def test_suggestions(self):
from check_manifest import check_manifest
Expand Down

0 comments on commit 403d640

Please sign in to comment.