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

python: Handle explicit PyPI source in pyproject.toml #7499

Merged

Conversation

torarvid
Copy link
Contributor

@torarvid torarvid commented Jun 30, 2023

Fixes #7431.
Fixes #7724.

When a github user has poetry >= 1.5.0, they will be nagged by a warning to run poetry source add pypi, which will add the following section to the users pyproject.toml:

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

This causes the problem outlined in #7431, that the index_finder will fail due to this section missing a url.

This commit works around this issue by explicitly adding a url for the case where the source "name" is equal to "PyPI".

@torarvid torarvid requested a review from a team as a code owner June 30, 2023 12:03
@jurre jurre force-pushed the python-handle-pypi-source-without-url branch from 97fc090 to 92d6963 Compare July 3, 2023 09:13
@jurre
Copy link
Member

jurre commented Jul 5, 2023

cc @jeffwidman or @pavera as my go-to python people, could you take a quick look at this?

@ekampf
Copy link

ekampf commented Jul 11, 2023

@jurre any ETA on this fix? It's really crippling teams upgraded to latest Poetry... should we downgrade?

@jeffwidman
Copy link
Member

I'll try to take a deeper look at this later this week, we're planning to invest some more time into Python and Python package manager work this quarter, as we know we're a little behind on supporting the newest versions.

@deivid-rodriguez deivid-rodriguez force-pushed the python-handle-pypi-source-without-url branch from 3d0ab55 to da3ec60 Compare August 21, 2023 20:03
@deivid-rodriguez deivid-rodriguez added the L: python:poetry Python packages via poetry label Aug 21, 2023
@deivid-rodriguez deivid-rodriguez force-pushed the python-handle-pypi-source-without-url branch from da3ec60 to 0349820 Compare August 21, 2023 20:08
@deivid-rodriguez
Copy link
Contributor

Thanks @torarvid and @GriceTurrble for the patience.

I amended this PR with Galen's suggestions and a slightly simpler approach, and hope to be deploying it soon!

@torarvid
Copy link
Contributor Author

Thanks, @deivid-rodriguez! I'm very happy to see this fix go in 👍🏼

@deivid-rodriguez
Copy link
Contributor

Test failures here are unrelated and should be fixed by #7862.

@deivid-rodriguez deivid-rodriguez force-pushed the python-handle-pypi-source-without-url branch from 0349820 to 1b5d374 Compare August 22, 2023 03:38
@jurre jurre force-pushed the python-handle-pypi-source-without-url branch from 1b5d374 to 1ec2fbe Compare August 22, 2023 09:51
@jeffwidman jeffwidman force-pushed the python-handle-pypi-source-without-url branch from 1ec2fbe to 0e2fe26 Compare August 22, 2023 22:35
When a github user has poetry >= 1.5.0, they will be nagged by a warning
to run `poetry source add pypi`, which will add the following section to
the users pyproject.toml:

```toml
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
```

This causes the problem that the index_finder will fail due to this
section missing a url.

This commit works around this issue by skip that case, since we will
default to the pypi official url anyways in that case.

Co-authored-by: Galen Rice <galen.rice@torqata.com>
@jeffwidman jeffwidman force-pushed the python-handle-pypi-source-without-url branch from 0e2fe26 to 15078eb Compare August 22, 2023 22:36
@jeffwidman jeffwidman enabled auto-merge (squash) August 22, 2023 22:37
@jeffwidman jeffwidman merged commit 2dbc593 into dependabot:main Aug 22, 2023
90 checks passed
brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
When a github user has poetry >= 1.5.0, they will be nagged by a warning
to run `poetry source add pypi`, which will add the following section to
the users pyproject.toml:

```toml
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
```

This causes the problem that the index_finder will fail due to this
section missing a url.

This commit works around this issue by skip that case, since we will
default to the PyPI official URL anyways in that case.

Co-authored-by: Galen Rice <galen.rice@torqata.com>
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: python:poetry Python packages via poetry L: python
Projects
None yet
7 participants