-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Dependency rooted in a subfolder of a GIT repository #755
Comments
Same here, i'm able to install a git dependency using pip with its VCS support
It would be nice if we can do it using |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
I would love to switch to Poetry and it looks like this is the only thing preventing me. Very excited to see this feature is in progress! |
Ready for testing :) |
@finswimmer Thank you for your work on this! Is there any way I can help with getting your PRs ready for review? |
Was this functionality implemented? My team relies on poetry and we just started breaking some of our code up into a separate git repo - we would need this to continue to use poetry |
As far as I can tell, it has been implemented, but not merged nor released. This still-in-progress implementation is here: #1822. |
It isn't fully implemented until now. A lot has changed since I wrote #1822. This PR is now splitted in python-poetry/poetry-core#9 and #2242 But there is still a lot to do. I cannot tell when this will be ready. |
We are also looking into breaking out shared modules into a separate repo, and it would be awesome to be able to keep them all in one repository and reference them by sub-directories. |
Do I understand correctly that it is not currently possible to install psycopg3 using poetry, owing to the lack of subdirectory support? with pip or requirement it is possible to use:
Is there similar support for poetry? |
Right now working around this via filesystem dependencies, so, clone repo first to a known location, (preferably It does mean that I have to manually pull in every single repository that has the python module in a subdir, which is not ideal. |
Anyone implementing this right now? Would be super helpful! |
Datasets sometimes use libraries in their script. We install all of them (as of today). Note that https://github.com/TREMA-UNH/trec-car-tools could not be added using poetry since the package is in subdirectory. See python-poetry/poetry#755.
You can use the latest version of [build-system]
requires = ["poetry-core @ git+https://github.com/python-poetry/poetry-core.git"]
build-backend = "poetry.core.masonry.api" |
Brilliant, thanks - this is exactly what I needed |
So would this allow me to use a dependency in subfolder? If so, do you happen to know what the synatx looks like? Something like this perhaps? [tool.poetry.dependencies]
my_module = { git = "https://github.com/my_org/my_repo.git", directory = "src/my_module_folder" } |
@falonso-alo: it's |
It would be something like this [tool.poetry.dependencies]
my_module = { git = "https://github.com/my_org/my_repo.git#egg=my_module_folder&subdirectory=src" } which translates to install Edit: Using the [tool.poetry.dependencies]
my_module = { git = "https://github.com/my_org/my_repo.git", subdirectory = "src/my_module_folder" } The link gets resolved to the following incorrect git link and installation will fail since it won't be able to find
Ideally you should go with specifying poetry supported key word args as opposed to using the full link (as I mentioned above) as it creates other problems especially when you're distributing whls. But if you just want to install the dependency it should be fine. Truth be told, poetry is not yet in a state where you can reliably use and manage git dependencies rooted in subdirectories. |
I've opened #5172 and python-poetry/poetry-core#288 to address this. |
Hi folks! Have anybody already tested it? It should be extremely useful, but it looks i've installed this fork in wrong way and it doesn't work correctly on my machine = ( |
Suggest edit of title to use |
This doesn't seem to work even with Our "problem dependency" is this: unicoirn = { git = "https://github.com/unicorn-engine/unicorn.git", branch = "dev", subdirectory="bindings/python"} It seems it does not enter the subdirectory when building the VCS package. With an error output of:
|
I've tried this but can't even get the I've got:
in my pyproject.toml. I'm using a ssh URL for a private GitHub repo. But I get "[repo definition] is not valid under any of the given schemas". Does this need the pre-release Poetry as well as the poetry-core settings? |
- Remove depencies that are actually dependencies of discrete-optimization - Ideally should add discrete-optimization as a dependency but - for now only available through git, as a subdirectory - this is not yet implemented by poetry (python-poetry/poetry#755) - for testing purposes, we should use the version available on the same branch, as it is on the same repo for now - for building purpose and specify it as a dependency by the scikit-decide wheel available on pypi, we should point to an official release. Only possible when such a release exists - So "manual" install of discrete-optimization required for local testing and github workflow
So I think I've got poetry VCS installing to work with
After that, adding
and the
seems to be working for me 🚀
Edit. Sorry RE recent release comments maintainers - they do exist, and poetry is a fine tool 👍 |
I think something is missing here since it does not work for me. Here is my environment:
Trying to install project with:
|
this is again broken after new installer became the default (1.4.0). I was able to fix it locally by adding following: if package.source_subdirectory is not None:
archive = archive / Path(package.source_subdirectory) after this line: https://github.com/python-poetry/poetry/blob/master/src/poetry/installation/executor.py#L571 |
Datasets sometimes use libraries in their script. We install all of them (as of today). Note that https://github.com/TREMA-UNH/trec-car-tools could not be added using poetry since the package is in subdirectory. See python-poetry/poetry#755.
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. |
Feature request
Currently, as far as I can figure, it is impossible to use a GIT repository as a dependency source where the
setup.py
orpyproject.toml
file is not in the root directory but in some sub-folder of the repository.E.g. GIT repo structure:
In this example I would like to be able to point poetry to the
pythonmodule
directory inside this repo, for example usingpoetry add mydep --git https://github.com/foo/bar.git --path path/to/mydep
. I don't think this can be accomplished via a separate repository definition, however, the documentation is a bit scarce on that topic.The text was updated successfully, but these errors were encountered: