question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Force Poetry to not use public PyPI

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

My sincere apologies is this is answered elsewhere. I tried my best to find a clear answer in the docs and Github issues but could not.

I would like to be able to ensure that all dependencies are installed from a private repository, and that will not use public PyPI is not used for any dependency resolution. In other words, I want behavior like pip install --index-url.

Basically, I want to ensure that Poetry fails with an error if I’ve accidentally failed to add a dependency to my private PyPI mirror.

Is this possible with Poetry currently? If not, would a feature request or PR be accepted?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
nirvana-msucommented, Jan 19, 2019

@sdispater, I have a related, but more general request. I have to work within a firewalled environment where pypi.org is not available. Attempting to make HTTP request to it just produces a DNS errors. Instead we’ve got an internal PyPI mirror. While poetry install works well with [tool.poetry.source] config, many other commands always fallback to and/or exclusively use pypi.org, e.g. poetry self:update (yes, I’d like to be able to update poetry from an internal PyPI mirror), poetry search, etc, making them useless.

I would like to have an option to completely ignore the public pypi.org across all commands, either by respecting the global [repositories] config setting, or some other setting, or maybe by passing explicitly via command options (less convenient). Either I’m missing something, or there currently seems to be no way at all to use these commands in a firewalled environment.

When I first came across the [repositories] config setting, I thought it would do exactly that (only use the provided repositories across all commands) but unfortunately it’s only being used for publishing.

10reactions
MilanAssuiedcommented, Jan 17, 2022

Hi everyone,

This is still an issue in 2021.

I must cover both situations:

  • Working on our computers, with no vpn connection, packages should be installed from pypi.org
  • Working remotely on CI computers, with vpn connection, packages should be installed from internal pypi, and pypi.org is blocked

Nothing is working so far (even default = true, which would block my first use case)

HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url /pypi/pytest/json

Worst of all, pytest is a dev dependencie and I don’t even need it on the remote computer. But it is still resolved even when using --no-dev

It’s a show stopper for me until it is fixed. I will have to stay on setuptools until then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repositories | Documentation | Poetry - Python dependency ...
Repositories Poetry supports the use of PyPI and private repositories for discovery of packages as well as for publishing your projects.
Read more >
How can Python Poetry be forced to use a certain setuptools ...
I found a workaround for my problem. In the case of pyhash, the dependency on use_2to3 has already been removed in the master...
Read more >
relaxed-poetry - PyPI
This project is a poetry fork. It serves as a relaxed version of poetry (currently based on version 1.2.0a2). Poetry is a great...
Read more >
Developers - Force Poetry to not use public PyPI - - Bountysource
Force Poetry to not use public PyPI ... My sincere apologies is this is answered elsewhere. I tried my best to find a...
Read more >
How to Publish an Open-Source Python Package to PyPI
You don't need to study these technical documents. ... It can be used both as a library for downloading Real Python tutorials in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found