1

I'm trying to push a project package to pypi (it's my first time doing so) from gitlab, and I'm following their turorial [here][1]. However, when I am trying python3 -m twine upload --repository gitlab dist/* the console returns me HTTPError: 422 Unprocessable Entity from https://gitlab.com/MyProfile/mylib I don't know what is wrong ?

my .pypirc file looks like this

    [distutils]
index-servers =
    gitlab

[gitlab]
repository = https://gitlab.com/FiiireFlyyy/firelib
username = my_token
password = my_token_password

and here is my setup.py

# Always prefer setuptools over distutils
from setuptools import setup, find_packages

# To use a consistent encoding
from codecs import open
from os import path

# The directory containing this file
HERE = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

# This call to setup() does all the work
setup(
    name="firelib",
    version="0.1.0",
    description="Demo library",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://gitlab.com/FiiireFlyyy/firelib",
    author="Willy Lutz",
    author_email="myemail0willy@gmail.com",
    license="no licence",
    classifiers=[
        "Intended Audience :: Developers",
        "License :: OSI Approved :: no licence",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Operating System :: OS Independent"
    ],
    packages=["firelib"],
    include_package_data=True,
    install_requires=["os", "shutil"]
)

My file tree is :

firelib (pycharm project folder)
   |-----dist (directory)
   |-----firelib (package)
   |-----firelib.egg-info (directory)
   |-----venv
   |-----LICENCE
   |-----README
   |-----setup.py
   |-----requirements.txt

I'm really bad with config stuff. Can someone help me ?

Edit : i put the real neames of packages insteand of 'myProfile' and 'mylib' [1]: https://docs.gitlab.com/ee/user/packages/pypi_repository/

Willy Lutz
  • 134
  • 1
  • 1
  • 9
  • Is `https://gitlab.com/MyProfile/mylib` the correct pypi repository? – Msvstl Nov 07 '22 at 09:25
  • That's what i am wondering. What is exactly this pypi repository ? Since Both my project and the main package have the same name... – Willy Lutz Nov 07 '22 at 09:41
  • I'm not confident on what it should be referring to. Should the 'repository' in the .pypirc file be the same as the 'url' in the setup.py ? If I understand correctly in the .pypirc file it should be referring to the package, not the project. What about the gitlab url ? – Willy Lutz Nov 07 '22 at 09:45
  • It should be gitlab package registry url not your repo url. – Msvstl Nov 07 '22 at 09:55
  • Seems like it was the problem. I'm postponing this issue for the moment, but I'll make sure to update the post when all problems are resolved. – Willy Lutz Nov 09 '22 at 09:34

0 Answers0