-
-
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
'check-manifest -p python2.7' is broken #57
Comments
Still not foolproof enough. You need something like this (this is a bad workaround, skipping the test, you should probably do something to fix the test, when ---
tests.py | 4 ++++
1 file changed, 4 insertions(+)
--- a/tests.py
+++ b/tests.py
@@ -2,6 +2,7 @@ import codecs
import doctest
import locale
import os
+import shutil
import subprocess
import sys
import tarfile
@@ -1368,6 +1369,9 @@ class TestCheckManifest(unittest.TestCas
# https://github.com/mgedmin/check-manifest/issues/57
# NB: this test assumes you have a 'python' executable somewhere
# in your path.
+ # Don't assume, check
+ if shutil.which('python') is None:
+ raise unittest.SkipTest("No 'python' executable present.")
from check_manifest import check_manifest
subdir = self._create_repo_with_code_in_subdir()
self.assertTrue(check_manifest(subdir, python='python')) |
Actually, this is probably even better (works for Python 2 as well): ---
tests.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/tests.py
+++ b/tests.py
@@ -2,6 +2,7 @@ import codecs
import doctest
import locale
import os
+import os.path
import subprocess
import sys
import tarfile
@@ -1368,9 +1369,11 @@ class TestCheckManifest(unittest.TestCas
# https://github.com/mgedmin/check-manifest/issues/57
# NB: this test assumes you have a 'python' executable somewhere
# in your path.
+ # Don't assume, make sure
+ py_exec = os.path.basename(sys.executable)
from check_manifest import check_manifest
subdir = self._create_repo_with_code_in_subdir()
- self.assertTrue(check_manifest(subdir, python='python'))
+ self.assertTrue(check_manifest(subdir, python=py_exec))
def test_suggestions(self):
from check_manifest import check_manifest |
It took me a while to load all the context. IIRC you're a distro packager, and I'm guessing you're having trouble with this assumption in the unit test, rather than with the fix itself:
The suggested fix looks okay-ish:
Would you care to submit the patch in the form of a pull request? |
Sorry, I am maintainer of over 2000 Python-related packages in openSUSE, I really cannot maintain git checkouts for all of them. And yes, |
That's fine, I'll make the changes myself then. |
Wait a second, I already committed a fix for this a while ago (in 2019), in d0b583d. Is that not sufficient? The diff you pasted here doesn't show that fix, so it must be from a quite old release. |
Right, sorry, this was apparently from SLE old package. |
Example:
Note how it's calling os.path.abspath() on python2.7. It shouldn't do that.
The text was updated successfully, but these errors were encountered: