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

Exporting requirements from private repository #1014

Closed
2 tasks done
dbanty opened this issue Apr 3, 2019 · 12 comments
Closed
2 tasks done

Exporting requirements from private repository #1014

dbanty opened this issue Apr 3, 2019 · 12 comments
Labels
kind/feature Feature requests/implementations

Comments

@dbanty
Copy link

dbanty commented Apr 3, 2019

  • 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.

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)

@drunkwcodes
Copy link

Related to #1015 and pypa/pip#4315.
has it been accepted and available?

@dbanty
Copy link
Author

dbanty commented Apr 26, 2019

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’ll 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.

@drunkwcodes
Copy link

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

@bersace
Copy link

bersace commented May 29, 2019

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

@bersace
Copy link

bersace commented May 29, 2019

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

@dbanty
Copy link
Author

dbanty commented May 29, 2019

The export feature isn’t 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’t see it anymore.

@jasonkuhrt
Copy link

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.

@dbanty
Copy link
Author

dbanty commented Jun 18, 2019

I’ve 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 dbanty closed this as completed Jun 18, 2019
@jasonkuhrt
Copy link

jasonkuhrt commented Jun 18, 2019

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

@dbanty
Copy link
Author

dbanty commented Jun 18, 2019

Didn’t seem like it was something that anyone wanted to implement, but sure I’ll reopen just in case.

@dbanty dbanty reopened this Jun 18, 2019
@kasteph kasteph added the kind/feature Feature requests/implementations label Jun 26, 2019
@sdispater
Copy link
Member

This has been added in #1277

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

6 participants