Skip to content
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

Fix for extracting version incorrectly from sdist filename containing dashes #146

Merged
merged 1 commit into from Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion check_manifest.py
Expand Up @@ -879,7 +879,7 @@ def extract_version_from_filename(filename):
filename = os.path.splitext(os.path.basename(filename))[0]
if filename.endswith('.tar'):
filename = os.path.splitext(filename)[0]
return filename.partition('-')[2]
return filename.split('-')[-1]


def should_use_pep_517():
Expand Down
1 change: 1 addition & 0 deletions tests.py
Expand Up @@ -464,6 +464,7 @@ def test_extract_version_from_filename(self):
from check_manifest import extract_version_from_filename as e
self.assertEqual(e('dist/foo_bar-1.2.3.dev4+g12345.zip'), '1.2.3.dev4+g12345')
self.assertEqual(e('dist/foo_bar-1.2.3.dev4+g12345.tar.gz'), '1.2.3.dev4+g12345')
self.assertEqual(e('dist/foo-bar-1.2.3.dev4+g12345.tar.gz'), '1.2.3.dev4+g12345')

def test_get_ignore_from_manifest_lines(self):
from check_manifest import IgnoreList, _get_ignore_from_manifest_lines
Expand Down