I got the same error below:
HTTPError: 400 Bad Request from https://test.pypi.org/legacy/ File already exists. See https://test.pypi.org/help/#file-name-reuse for more information.
When I tried to upload a package to TestPyPI with the command below:
twine upload --repository testpypi dist/*
So, I changed version from "0.0.1" to "0.0.2" or name from "example_package_superkai" to "example_package_hyperkai" in pyproject.toml as shown below, then I removed dist folder:
# "pyproject.toml"
...
[project]
...
# version = "0.0.1"
version = "0.0.2"
...
Or:
# "pyproject.toml"
...
[project]
# name = "example_package_superkai"
name = "example_package_hyperkai"
...
Then, I ran the command below:
python -m build
Finally, I could upload a package to TestPyPI with the command below:
twine upload --repository testpypi dist/*