Poetry: Exporting requirements from private repository

Created on 3 Apr 2019  路  11Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Question

TL;DR: Can you make export optionally include credentials to a private repo?

Hey, thanks for making a better package manager. I'm currently using Pipenv to manage an app. My deploy process requires me to install all my requirements into the build, which currently looks like:

  1. pipenv lock -r > requirements.txt
  2. pip install -r requirements.txt --target build

I know there is an open request for a deploy/bundle feature which would rock, but in the meantime I'd like to use the export feature to basically do the same thing I'm doing today.

  1. poetry export -f requirements.txt
  2. pip install -r requirements.txt --target build

The problem I'm encountering is that unlike pipenv, poetry's export does not include my private Pip repo's credentials in the requirements file, so pip cannot access those packages. Is it possible to either match pipenv's behavior of including the credentials at the top (with a -i) or to make that an option for export? (--with-credentials)

Feature

Most helpful comment

This has been added in #1277

All 11 comments

Related to #1015 and https://github.com/pypa/pip/issues/4315.
has it been accepted and available?

So I wrote a Python script that does this for me for now. Looks like there is a pull request pending approval on #1015 now which will make my script better (right now I have to export, then read the requirements.txt, the write my repo and the requirements out to a new file).

Should I try to put a pull request together to add the option for repositories? Right now my script just puts all the repositories in config into the top of requirements.txt. I figure we鈥檒l want the real feature to only include the ones declared in pyproject.toml.

Also I think it makes sense for that to be the default behavior for export. The sources are added to the pyproject file for a reason right? So it should make sense to always include them.

The maintainance of this feature is burdensome. It should be handled by poetry authors IMO.

@dbanty , #1015 is an issue, not a PR. Sharing your script may help proposing a PR.

As of poetry 0.12.16, I don't see any export command. Did I miss something聽?

The export feature isn鈥檛 in the stable release yet, it is, however, available in Alpha.

There was a pull request to implement #1015, looks like it was already merged because I don鈥檛 see it anymore.

A nice workaround we found is to simply export an extra index url for pip, e.g.:

export PIP_EXTRA_INDEX_URL=https://pypi.fury.io/${GEMFURY_TOKEN}/foobar

Then no text manipulation of the generated requirements.txt is required.

I鈥檝e been using dephell which lets me convert between multiple formats (requirements, Pipfile, pyproject.toml, etc.) so I no longer have need of this feature in poetry itself.

@dbanty the issue is still valid in its own right, I think it should stay open

Didn鈥檛 seem like it was something that anyone wanted to implement, but sure I鈥檒l reopen just in case.

This has been added in #1277

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thmo picture thmo  路  3Comments

sobolevn picture sobolevn  路  3Comments

EdgyEdgemond picture EdgyEdgemond  路  3Comments

probablykasper picture probablykasper  路  3Comments

alexlatchford picture alexlatchford  路  3Comments