简体   繁体   中英

uploading to PyPi returning Invalid URI

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="author@example.com",
    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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM