8000 Packages uploaded to private gitlab repos are not discoverable in pypi/simple · Issue #364 · pypa/flit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Packages uploaded to private gitlab repos are not discoverable in pypi/simple #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorgecarleitao opened this issue Aug 7, 2020 · 6 comments

Comments

@jorgecarleitao
Copy link

I am not sure if this is an issue on gitlab or flit, but I recently tried flit with private gitlab repos, and the package is shown in gitlab user interface, but it is not available to download in pypi/simple. This behavior does not happen when twine is used. This can also be an issue on gitlab's registry.

stages:
  - build

build:
  stage: build
  image: python:3.7.4-buster
  only:
    - test
  script:
    - pip install flit
    - FLIT_INDEX_URL=https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi flit publish
stages:
  - build

build:
  stage: build
  image: python:3.7.4-buster
  only:
    - master
  script:
    - pip install twine
    - python setup.py sdist bdist
    - python -m twine upload --repository-url https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi dist/*

install command for flit:

pip install pip-packaging==0.1.1 --extra-index-url https://__token__:...@gitlab.com/api/v4/projects/.../packages/pypi/simple

and twine:

pip install pip-packaging==0.1 --extra-index-url https://__token__:...@gitlab.com/api/v4/projects/.../packages/pypi/simple

The former shows

Collecting pip-packaging==0.1.1
  Could not find a version that satisfies the requirement pip-packaging==0.1.1 (from versions: 0.1)
No matching distribution found for pip-packaging==0.1.1
@sander76
Copy link
Contributor
sander76 commented Nov 18, 2020

I am experiencing something similar (if not identical). If I upload using flit and try to install I get the following error:

 ERROR: HTTP error 404 while getting https://gitlab.com/api/v4/projects/39540714/packages/pypi/files/bli-0.0.19-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/39540714/packages/pypi/simple/bli/) (requires-python:>=3.7)
ERROR: Could not install requirement bli from https://gitlab.com/api/v4/projects/39540714/packages/pypi/files/bli-0.0.19-py3-none-any.whl#sha256= because of HTTP error 404 Client Error: Not Found for url: https://gitlab.com/api/v4/projects/39540714/packages/pypi/files/bli-0.0.19-py3-none-any.whl for URL https://gitlab.com/api/v4/projects/39540714/packages/pypi/files/bli-0.0.19-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/39540714/packages/pypi/simple/bli/) (requires-python:>=3.7)

when I upload using twine and install, all is the fine. What I find is that the download path is different:

https://gitlab.com/api/v4/projects/39540714/packages/pypi/files/fe5ba157799ac686a82d58a736372e1bf17c52a7f9a7d43ee00485ae0ff8d1bf/bli-0.0.19-py3-none-any.whl

It seems the SHA hash is used as a path maybe ?

@bpabel
Copy link
Contributor
bpabel commented Mar 19, 2021

Has anyone made any progress on this? I just started testing with gitlab package registries and I'm running into this same issue.

@sander76
Copy link
Contributor

No progress. I settled with creating the package using flit and uploading using twine. It does the job.

matchaxnb pushed a commit to matchalunatic/flit that referenced this issue Jul 2, 2021
This is needed by GitLab to support uploads from flit (GitLab works fine
with twine).

Addresses pypa#364 of takluyver/flit
Addresses #333964 of gitlab.com/gitlab-org/gitlab

The most useful one-line of code I ever wrote I believe.
@matchaxnb
Copy link

Hey, I provided a fix for this. Can you test again?

@takluyver
Copy link
Member

(You'll need Flit from master for now to test this - I'll try to do a new release soon. It will be in version 3.3.

@takluyver
Copy link
Member

And this is now released. Thanks @ChloeTigre for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0