Skip to content
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

Source key word for Private repository #4920

Closed
1 task done
jules-ch opened this issue Dec 21, 2021 · 5 comments
Closed
1 task done

Source key word for Private repository #4920

jules-ch opened this issue Dec 21, 2021 · 5 comments
Labels
area/docs Documentation issues/improvements
Milestone

Comments

@jules-ch
Copy link
Contributor

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

There is no mention of the source keyword to specify a custom private repository for a specific package in the Dependency Specification section.

It should be added to provide information on how to specify a specific source for a package.

@jules-ch jules-ch added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Dec 21, 2021
@pierresouchay
Copy link

pierresouchay commented Jan 28, 2022

Yes, please!

I don't get how to query a private repository for only a few packages (and rely on PyPI by default for instance)

@jules-ch did you find how to do it?

@jules-ch
Copy link
Contributor Author

Yes, you need to define your source & add it in the your package definition.

[[tool.poetry.source]]
name = "gitlab"
url = "https://gitlab.com/api/v4/projects/<redacted>/packages/pypi/simple/"
secondary = true

[tool.poetry.dependencies]
python = ">=3.8,<3.9"
my_package_example = {version="0.1.0", source="gitlab"}

@pierresouchay
Copy link

pierresouchay commented Jan 28, 2022

yes, I finally found this, but I also found it does not work as I would expect.

I have the same exact example than you, but when I do a poetry update

=> all packages (not only my_package_example are looked in the gitlab repository while I would expect that secondary = true avoids this.
=> in the end, secondary does not work (at least it is performing requests against the repo despite its "secondary" attribute.

I would like basically to use one named "gitlab" to host 1 package and not trying to download every package on earth on it.

Does not seem to work for now (at least with poetry 1.1.9)

I even tried to use source = "pypi" to every package, still all request are done on both pypi and my private repo

@jules-ch By the way, I just figured out that the doc is updated in the source code: https://github.com/python-poetry/poetry/blob/master/docs/dependency-specification.md#source-dependencies but not on website: https://python-poetry.org/docs/dependency-specification/ ... so basically, the issue you raised is already solved (but I still have my probable of secondary repositories being hit for every dependency)

@Secrus
Copy link
Member

Secrus commented May 16, 2022

Documentation on source in dependency specification is available here. This will become mainstream with the incoming release of poetry 1.2

@Secrus Secrus removed the status/triage This issue needs to be triaged label May 16, 2022
@abn abn added this to the 1.2 milestone May 17, 2022
@abn abn closed this as completed May 17, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

No branches or pull requests

4 participants