Skip to content

Commit

Permalink
Fix PyPI PIP 625 incompatibility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
taughz committed Dec 20, 2024
1 parent 04f1148 commit 8a80715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions publish_python/artifact/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def create_wheel(*, config):
print('\n-- Building sdist and bdist_wheel artifacts of package '
f"'{pkg.name}' {pkg.version} ...")

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

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

Expand Down

0 comments on commit 8a80715

Please sign in to comment.