Skip to content

Commit

Permalink
Fix IOError when files listed under VCS are missing (#32)
Browse files Browse the repository at this point in the history
This produces some nonsensical warnings, e.g.

    listing source files under version control: 11 files and directories
    building an sdist: check-manifest-0.22.dev0.tar.gz: 10 files and directories
    some files listed as being under source control are missing:
      LICENCE.rst
    copying source files to a temporary directory
    building a clean sdist: check-manifest-0.22.dev0.tar.gz: 10 files and directories
    files in version control do not match the sdist!
    missing from sdist:
      LICENCE.rst
    suggested MANIFEST.in rules:
      include *.rst

No, stupid computer, adding 'include *.rst' to MANIFEST.in is definitely
not going to help resurrect deleted files.
  • Loading branch information
mgedmin committed Oct 1, 2014
1 parent 1344619 commit dd68570
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog
0.22 (unreleased)
-----------------

* Fix IOError when files listed under version control are missing (`issue #32
<https://github.com/mgedmin/check-manifest/issues/32>`__).


0.21 (2014-06-13)
-----------------
Expand Down
7 changes: 6 additions & 1 deletion check_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,14 @@ def check_manifest(source_tree='.', create=False, update=False,
sdist_files = sorted(normalize_names(strip_sdist_extras(
strip_toplevel_name(get_archive_file_list(sdist_filename)))))
info_continue(": %d files and directories" % len(sdist_files))
existing_source_files = filter(os.path.exists, all_source_files)
missing_source_files = sorted(set(all_source_files) - set(existing_source_files))
if missing_source_files:
warning("some files listed as being under source control are missing:\n%s"
% format_list(missing_source_files))
info_begin("copying source files to a temporary directory")
with mkdtemp('-sources') as tempsourcedir:
copy_files(all_source_files, tempsourcedir)
copy_files(existing_source_files, tempsourcedir)
if os.path.exists('MANIFEST.in') and 'MANIFEST.in' not in source_files:
# See https://github.com/mgedmin/check-manifest/issues/7
# if do this, we will emit a warning about MANIFEST.in not
Expand Down

0 comments on commit dd68570

Please sign in to comment.