请求参数无效 上传到 python Artifact Registry [gcp] 时出错

Request has invalid argument Error on uploading to python Artifact Registry [gcp]

我正在尝试将 python 包上传到 GCP 的 Artifact Registry。我安装了 keyringkeyrings.google-artifactregistry-auth,将带有 url 的 .pypircpip.conf 文件添加到 GCP 上的私有注册表中,并设置了环境变量 GOOGLE_APPLICATION_CREDENTIALS 根据这个 documentation.

我创建了一个虚拟 python 包来测试上传到私有 pypi。 python setup.py install 运行成功。 当运行缠绕时:

twine upload --verbose -r https://<LOCATION>-python.pkg.dev/<PROJECT_ID>/<REPO_NAME>/ --config-file <PATH_TO_PYPIRC> dist/*

我收到以下错误:

Uploading distributions to https://<LOCATION>-python.pkg.dev/<PROJECT_ID>/<REPO_NAME>/
  dist/my_library-0.0.1-py3.9.egg (2.6 KB)
username set from keyring
password set from keyring
username: oauth2accesstoken
password: <hidden>
Uploading my_library-0.0.1-py3.9.egg
100%|█████████████████████████████████████████████████| 6.30k/6.30k [00:00<00:00, 47.8kB/s]
Content received from server:
Request has an invalid argument: extension type

HTTPError: 400 Bad Request from https://<LOCATION>-python.pkg.dev/<PROJECT_ID>/<REPO_NAME>/
Bad Request

使用 wheel 而不是 egg 让我上传成功 python setup.py bdist_wheel