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.

[[tool.poetry.source]] setting is ignored

See original GitHub issue
  • [x ] I am on the latest Poetry version.
  • [ x] I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name:
  • Poetry version: 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I’m in china mainland and speed to access pypi is very slow, so I have added tool.poetry.source to a local source:

[[tool.poetry.source]]
name = "ali"
url = "https://mirrors.aliyun.com/pypi/simple/"

However, this one works for my one project yesterday, it doesn’t work for my another project, checked today.

When it works, I found poetry will check both pypi and this local source for index, but only download package from local source, this can enhance speed a lot. However, it seems not work today, it always check index and download package from pypi, the local source is totally ignored.

图片

if poetry is downloading from local source(which is ali in the case), it’ll show source’s name before ‘:’. it’s pypi here since it downloads from pypi.

I have recreated my virtual env and delete pypoetry’s cache.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
GooseYArdcommented, Jan 20, 2021

after some debugging, I found that if “[[tool.poetry.source]]” precedes “[tool.poetry.scripts]” in pyproject.toml, then as early as PyProjectTOML.data(), self._data[“tool”][“poetry”] will be absent a “source” key. However, if I move tool.poetry.source below tool.poetry.scripts in the file, this problem doesn’t occur.

I’m not sure if the issue is my ignorance of toml or an issue with tomlkit, but will do a little more debugging to see if I can spot the root cause.

0reactions
zillionarecommented, Apr 1, 2021

As I’m using poetry more and more, I might found clue leading to my issues (I haven’t been through this for months).

At time when the issue reported, I think we’re going though pip’s upgrade; and there’s sync issue between central repo (pypi) and its mirrors (for example, aliyun in my case). According to my observation, the sync may take several days.

As more and more python libraries manage dependancy with poetry, I found now dep resolution time is decreased, so a second source is not required (it’s worth some time to resolve deps use central repo, other than mirrors).

If you still experiece slow resolution, maybe you could try resolve your project.toml on a machine located at us cloud service. I did that several times months ago.

close this one since I didn’t expierence issues anymore, and I think it’s probably resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Poetry trying to install everything from private repository
So far I have tried to: explicitly set the source for each dependency in the pyproject. toml file (e.g: mypy = {version =...
Read more >
The pyproject.toml file | Documentation | Poetry
You can explicitly specify to Poetry that a set of globs should be ignored or included for the purposes of packaging. The globs...
Read more >
poetry-dynamic-versioning - PyPI
Poetry's typical version setting is still required in [tool.poetry] , but you are encouraged to use version = "0.0.0" as a standard placeholder....
Read more >
Ask HN: Why Poetry did not become a mainstream package ...
However, I have been using pip/requirements.txt/setup.py so far for ... Last but not least Poetry sometimes also feels like a weird tool.
Read more >
Poetry-driven python project template with cookiecutter
This is a python project, so I will set it up with poetry. ... branch = true source = ["specimen"] [tool.coverage.report] fail_under =...
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