Skip to content

Commit 8a80715

Browse files
committed
Fix PyPI PIP 625 incompatibility
Uploading tarballs with `-` instead of `_` results in the following email sent to the uploader: > In the future, PyPI will require all newly uploaded source > distribution filenames to comply with PEP 625. Any source > distributions already uploaded will remain in place as-is and do not > need to be updated. > Specifically, your recent upload of 'package-name-0.0.1.tar.gz' is > incompatible with PEP 625 because it does not contain the normalized > project name 'package_name'. > In most cases, this can be resolved by upgrading the version of your > build tooling to a later version that supports PEP 625 and produces > compliant filenames.
1 parent 04f1148 commit 8a80715

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

publish_python/artifact/wheel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def create_wheel(*, config):
1515
print('\n-- Building sdist and bdist_wheel artifacts of package '
1616
f"'{pkg.name}' {pkg.version} ...")
1717

18-
cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel']
18+
cmd = [sys.executable, '-m', 'build', '--sdist', '--wheel']
1919
print('$', *cmd)
2020
subprocess.check_call(cmd)
2121

22-
tarball = f'dist/{pkg.name}-{pkg.version}.tar.gz'
22+
tarball = f'dist/{pkg.name.replace("-", "_")}-{pkg.version}.tar.gz'
2323
assert os.path.exists(tarball), \
2424
f"Failed to generate source tarball '{tarball}'"
2525

0 commit comments

Comments
 (0)