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

Invalid wheel filename generated for namespace package #473

Closed
wwuck opened this issue Nov 26, 2021 · 2 comments
Closed

Invalid wheel filename generated for namespace package #473

wwuck opened this issue Nov 26, 2021 · 2 comments

Comments

@wwuck
Copy link

wwuck commented Nov 26, 2021

I'm attempting to create and upload a package to TestPyPI with flit 3.5.1 using the new PEP420 feature

[build-system]
build-backend = 'flit_core.buildapi'
requires = ['flit_core >=3.5.1,<4']

[project]
authors = [{name = 'name', email = 'email'}]
classifiers = [
    'Development Status :: 1 - Planning',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.8',
    'Programming Language :: Python :: 3.9',
    'Programming Language :: Python :: 3.10',
    'Typing :: Typed',
]
dependencies = [
    'keyring>=23.3.0'
]
description = 'test package'
readme = 'README.rst'
version = '0.1.0-pre'
name = 'keyrings.testkeyringbackend'
requires-python = '>=3.8,<4'

I can build the package with flit --ini-file=pyproject.toml build and it generates both wheel and sdist files.

$ flit --ini-file=pyproject.toml build
Not generating setup.py in sdist (default changed)                                                                                                                                                                                                                                  I-flit
Recent versions of pip no longer need this generated file                                                                                                                                                                                                                           I-flit
Use --[no-]setup-py to suppress this message or add setup.py                                                                                                                                                                                                                        I-flit
Version number normalised: '0.1.0-pre' -> '0.1.0rc0' (see PEP 440)                                                                                                                                                                                                   W-flit_core.versionno
Version number normalised: '0.1.0-pre' -> '0.1.0rc0' (see PEP 440)                                                                                                                                                                                                   W-flit_core.versionno
Found 19 files tracked in git                                                                                                                                                                                                                                                 I-flit.sdist
Built sdist: dist/keyrings.testkeyringbackend-0.1.0rc0.tar.gz                                                                                                                                                                                                                       I-flit_core.sdist
Version number normalised: '0.1.0-pre' -> '0.1.0rc0' (see PEP 440)                                                                                                                                                                                                   W-flit_core.versionno
Copying package file(s) from /tmp/tmpw8v3wdc3/keyrings.testkeyringbackend-0.1.0rc0/src/keyrings/testkeyringbackend                                                                                                                                                                             I-flit_core.wheel
Writing metadata files                                                                                                                                                                                                                                                   I-flit_core.wheel
Writing the record of files                                                                                                                                                                                                                                              I-flit_core.wheel
Built wheel: dist/keyrings_testkeyringbackend-0.1.0rc0-py3-none-any.whl                                                                                                                                                                                                             I-flit_core.wheel

$ ls dist
keyrings_testkeyringbackend-0.1.0rc0-py3-none-any.whl  keyrings.testkeyringbackend-0.1.0rc0.tar.gz

When I try to upload with twine I get an error returned:

$ python3 -m twine upload --repository testpypi dist/*
Uploading distributions to https://test.pypi.org/legacy/
Uploading keyrings_testkeyringbackend-0.1.0rc0-py3-none-any.whl
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23.3k/23.3k [00:02<00:00, 11.0kB/s]
Error during upload. Retry with the --verbose option for more details.
HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Start filename for 'keyrings.testkeyringbackend' with 'keyrings.testkeyringbackend'.
@takluyver
Copy link
Member

It's actually a bug in the PyPI server code: pypi/warehouse#10030 . There's a PR already to fix it: pypi/warehouse#10072.

The wheel spec says that replacing . with _ is the correct thing to do there.

See also #442.

@wwuck
Copy link
Author

wwuck commented Nov 26, 2021

Ahh thanks! Apologies for missing that previous bug. I’ll keep a watch in the warehouse bugs.

Thanks for implementing namespace support! Everything appears to be working fine so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants