-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git submodules don’t work #61
Comments
This is because check-manifest uses Steps to reproduce:
|
Plan:
|
With current git master I get the following output if I try with argon2_cffi:
Do you really want your source tarballs to contain a
to your MANIFEST.in. |
I can confirm that the current master works if I exclude the .git. Release? 🐶 |
I will release 0.30 when my Jenkins confirms that the code works on Windows. This is taking longer than I expected for reasons I don't understand. Previously builds would finish in 10 minutes. This build is taking 53 minutes and counting (and it has test failures I already fixed, which will be tested in a new build). I rdesktop'ed manually to my Jenkins machine and ran the tests using In the meantime I'm exploring Appveyor. |
Somehow the new code produces a duplicate directory name on Windows: EDIT: because I used |
Also, any idea why EDIT: still dunno why, but (Can't |
Down to one error on Appveyor, which is the same error I get when I run the tests manually on the Jenkins machine -- but not when Jenkins runs the tests for me. |
At this point I have tests passing when I run EDIT: sys.stdout.encoding is None when tox redirects the output of nosetests into a log file. Duh. Also, I seriously question my life choices. |
welcome to my life. :) if it makes you feel any better, I fought (and lost) Windows too today |
Yay: I got the tests to pass on Appveyor and manually. Boo: the tests now fail on Jenkins. Do I even care? |
check-manifest 0.30 is out on PyPI. |
...because @mgedmin makes bad life's decisions and is awesome. ref mgedmin/check-manifest#61
@mgedmin, I'm still seeing duplicate directory names on Windows, using check-manifest 0.32 (and building from source). I added this to get past it temporarily, but obviously not fixing the root cause. Any ideas? # git diff
diff --git a/check_manifest.py b/check_manifest.py
index 948cd7c..33842ac 100755
--- a/check_manifest.py
+++ b/check_manifest.py
@@ -194,7 +194,10 @@ def copy_files(filelist, destdir):
if not os.path.isdir(destfiledir):
os.makedirs(destfiledir)
if os.path.isdir(filename):
- os.mkdir(destfile)
+ try:
+ os.mkdir(destfile)
+ except WindowsError:
+ pass
else:
shutil.copy2(filename, destfile) |
This diff starts to expose the underlying problem. The same directory is sometimes returned twice by diff --git a/check_manifest.py b/check_manifest.py
index 948cd7c..90dd9b5 100755
--- a/check_manifest.py
+++ b/check_manifest.py
@@ -30,6 +30,7 @@ import zipfile
from contextlib import contextmanager, closing
from distutils.text_file import TextFile
from xml.etree import cElementTree as ET
+from pprint import pprint
try:
import ConfigParser
@@ -194,7 +195,10 @@ def copy_files(filelist, destdir):
if not os.path.isdir(destfiledir):
os.makedirs(destfiledir)
if os.path.isdir(filename):
- os.mkdir(destfile)
+ try:
+ os.mkdir(destfile)
+ except WindowsError:
+ pass
else:
shutil.copy2(filename, destfile)
@@ -433,6 +437,10 @@ def detect_vcs():
def get_vcs_files():
"""List all files under version control in the current directory."""
vcs = detect_vcs()
+ print("\n\nPrinting sorted get_versioned_files\n\n")
+ pprint(sorted(vcs.get_versioned_files()))
+ print("\n\nPrinting sorted normalize_names\n\n")
+ pprint(sorted(normalize_names(vcs.get_versioned_files())))
return normalize_names(vcs.get_versioned_files()) |
Ok, think I got it.
If it were more like this, there wouldn't be any path overlap and we wouldn't have seen the issue:
|
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit replaces the backslashes with forward slashes in the relative path, eliminating the duplicate directory entries.
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit replaces the backslashes with forward slashes in the relative path, eliminating the duplicate directory entries.
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit replaces the backslashes with forward slashes in the relative path, eliminating the duplicate directory entries.
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit replaces the backslashes with forward slashes in the relative path, eliminating the duplicate directory entries.
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit ensures the list of files contains only forward slashes before calling `add_directories()`, eliminating the duplicate directory entries.
@lorengordon Thank you for the investigation! (Also, next time can you please open a new issue instead of commenting on an old closed one?) |
Currently if I have a git submodule, check-manifest complains about it missing in sdist and VCS at once: https://travis-ci.org/hynek/argon2_cffi/jobs/95785495
The text was updated successfully, but these errors were encountered: