astariul / github-hosted-pypi

Your own private PyPi index, github-hosted
https://astariul.github.io/github-hosted-pypi/
MIT License
172 stars 5 forks source link

Poetry fails to find and install packages #69

Open banananeer opened 1 year ago

banananeer commented 1 year ago

Hello! This is a really cool project and I would love to use it however I'm having some trouble getting it to work with poetry.

I created a default source in my pyproject file as the following

[[tool.poetry.source]]
name = "test"
url = "https://astariul.github.io/github-hosted-pypi/"
priority = "default"

and when I try to install public-hello I get the following error

poetry add public-hello

Could not find a matching version of package public-hello

Do you have any idea what may be going on?

reinvantveer commented 1 year ago

I'm coming to the same conclusion:

$ poetry source add --priority=supplemental test https://astariul.github.io/github-hosted-pypi
Adding source with name test.
$ poetry add public-hello==0.2

Could not find a matching version of package public-hello

Pip is able to install, but apparently only because it is able to treat it like something other than a pypi index? Does poetry expect there to be a /simple endpoint for a list of packages perhaps?

astariul commented 1 year ago

Sorry for the late reply.

Yes, another user couldn't make it work with poetry as well (see #68).


As mentioned in https://github.com/python-poetry/poetry/issues/5548, it doesn't work because poetry can't install packages from VCS source (github links) while pip can.

Maybe you should try the solution proposed in the last comment of that issue, i.e. build and publish the wheel and then use that wheel link instead of the repository link in the HTML pages of github-hosted-pypi.

If you manage to make it work, I would love if you could post the solution on this thread as well !

banananeer commented 1 year ago

Oh interesting. Ok I'll give it a try with publishing the wheels and using that instead of the repository link and let you know how that goes. If I do get it to work, I'll update this issue.

JonathanNathanson commented 6 months ago

Did anyone ever get this to work?

I've tried adding the link to the release .whl instead of the link to the repository, and I'm still getting the "Could not find a matching version of package ..." error.