1
votes

I'm trying to upload my package to PyPi and keep getting this error:

 HTTPError: 400 Client Error: 'github.com/Palashio/Libra' is an invalid value for Home-Page. Error: Invalid URI See https://packaging.python.org/specifications/core-metadata for url: https://test.pypi.org/legacy/

I'm using this tutorial: https://packaging.python.org/tutorials/packaging-projects/#uploading-your-project-to-pypi

This happens when I run this line:

python3 -m twine upload --repository testpypi dist/*

and enter __ token __ as the username, and the generated token from the test.pypi.org as the password

This is what my directory contains: build, dist, reponame (with all the package files in it), reponame.eggs-info, LICENSE.txt, README.md, setup.cfg, and setup.py

This is what my setup.py file looks like:

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="libradocs", # Replace with your own username
    version="0.0.0",
    author="username-from-test.pypi",
    author_email="[email protected]",
    description="A small example package",
    long_description=long_description,
    long_description_content_type="text/markdown",
    homepage="https://github.com/Palashio/Libra",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.6',
)

inside of the reponame folder, I have 5 different folders, with different files and function that I want users to be able to use. I have put blank init.py files in both the root and in each of the sub-folders within Libra.

2
Your error does not report the https in the error. Is this correct or did you forget to copy it when you were erasing your identity?justahuman
Yes, I forgot to. I just put in the real information back in.Palash Shah
Is your repo private? It must be public.justahuman
the link that I included as the homepage= at github.com/Palashio/Libra should send you to a public repo.Palash Shah
It does indeed. Cool library, let me know if the answer helps.justahuman

2 Answers

0
votes

The homepage parameter has been deprecated. Replace this with url and you should be good. The example in the docs follows this format as well.

0
votes

Just got it to work. Make sure your name is the same as the token name in which you create on the test.pypi online site. Also make sure that you're not creating a PyPi package that already exists.