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

Setting primary source exports requirements as --extra-index-url instead of index-url #260

Closed
matejsp opened this issue Feb 27, 2024 · 0 comments · Fixed by #263
Closed

Comments

@matejsp
Copy link

matejsp commented Feb 27, 2024

Description

moved from: python-poetry/poetry#9043

When replacing deprecated default with primary poetry export sets extra index url instead of index url.

[[tool.poetry.source]]
name = "nexus"
url = "https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple"
priority = "default"

poetry export -f requirements.txt

I get:

--index-url https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple

when changing it to primary (as single source):
I get:

--extra-index-url https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple

Workarounds

Continue using priority default instead of primary. We use export when we provision venv inside docker because we want minimal image without installing poetry.

Poetry Installation Method

pipx

Operating System

MacOSX

Poetry Version

Poetry (version 1.8.1)

Poetry Configuration

cache-dir = "/Users/myuser/Library/Caches/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
repositories.nexus.url = "https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple"
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = false

Python Sysconfig

No response

Example pyproject.toml

[[tool.poetry.source]]
name = "nexus"
url = "https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple"
priority = "default"

Poetry Runtime Logs

(.venv) ➜ poetry -vvv export 
Loading configuration file /Users/myuser/projects/myproject/poetry.toml
Adding repository nexus (https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple) and setting it as primary
Deactivating the PyPI repository
Source (poetry-lockfile): 1 packages found for attrs 23.1.0
--extra-index-url https://myuser:mypass@nexus.mycompany/repository/pypi-blessed/simple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant