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

Install git dependency using poetry #184

Closed
shawegit opened this issue Jun 6, 2018 · 2 comments
Closed

Install git dependency using poetry #184

shawegit opened this issue Jun 6, 2018 · 2 comments

Comments

@shawegit
Copy link
Contributor

shawegit commented Jun 6, 2018

When a project that uses poetry depends on a package that is only available through git and that also uses poetry, it would be a great feature to use poetry to install the dependent package. Currently, it seems like installing packages from git is only possible using pip + setup.py, so we cannot install a poetry based package that is only available through git. Doing that is rather easy, once you know that a project.toml file exists, see a not polished and half pseudo example code below.

from subprocess import call
import os
import glob
tmp_dir = Path(mkdtemp(prefix="pypoetry-git-{}".format("package_name")))
git = Git()
git.clone(source_url, tmp_dir)
git.checkout(branch/tag/.., tmp_dir)
crnt = os.getcwd()
os.chdir(tmp_dir)
call(['poetry','build','-f','wheel'])
wheel_file = glob.glob(f'{tmp_dir}/dist/*.whl')[0]
venv.run("pip", "install", wheel_file)
os.chdir(crnt)
...
@sdispater
Copy link
Member

This is now supported.

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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants