-
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
Allow creation of "pre-install" script #9140
Comments
duplicate #2496 |
@dimbleby I am not sure it is. If I'm not mistaken, PoeThePoet, and other elements discussed in #2496, describe scripts that would work after running "poetry install" at least once, which resolves dependencies and creates a virtual environment if necessary. I'm talking about a pre-install script, e.g a script that we could run right before the "poetry install" command, when the dependencies have not yet been resolved by Poetry. |
yes, this is a duplicate. eg one of the poe-the-poet examples is
|
@dimbleby , I agree with @lilian-delouvy take this situation I only have # pyproject.toml
[tool.poetry.group.dev.dependencies]
poethepoet = "*"
pre-commit = "*" I would then git clone [email protected]:Alexdelia/my_repo_that_use_poetry_and_pre_commit.git repo
cd repo
poetry install but then, if I you could say that I could use having one tool that manages all dependencies and workflow is very important and is missing in the the # package.json
{
"scripts": {
"preinstall": "echo 'we gonna install!'",
"prepare": "pre-commit install",
}
} you can find the docs for those |
this is not how that project asks you to install it https://poethepoet.natn.io/index.html#quick-start ... and this is anyway still a duplicate of other issues asking for the same thing |
don't you want to have to only use one tool to manage most of your workflow?
and I don't see how the situation above can be solved with the current solutions there are no |
I would be happy to be proven wrong |
no, I really don't! (and if you have quibbles with the usage of poe the poet - please take them to that repository) whether you see how this can be solved or not makes no difference to its status as a duplicate of #2496 etc |
I apologise, I did not realize that https://poethepoet.natn.io/poetry_plugin.html#hooking-into-poetry-commands |
Great Scott! This solved my problem too. Thank you for pointing it out.
While I do agree that @nat-n's In my circles, tooling sprawl is a common complaint about the Python ecosystem, and I too often compare So I wonder: would either of the following strategies be a viable solution to both of these issues?
|
Issue Kind
Brand new capability
Description
It would be great for Poetry to allow developers to implement a "pre-install" script. As of now, the scripts of Poetry are available after running "poetry install" once. Sometimes, users will need to run a script before running "poetry install", as the example below shows.
Impact
In our company, we use local packages references like the following in a pyproject.toml:
my_local_package = { path = "./packages/my_local_package", develop = true }
But our local package is not actually in the given path : we have to copy it beforehand. We did this so that production packages are decoupled from other parts of the code and only code that is being actively used by our production packages are on our docker images.
So we have something that looks like this:
Therefore, a step that we have to do before doing "poetry install" on our production packages is to copy our local packages in the related "packages" folders via bash scripts.
It would be great to add a "pre-install" script implementation system so that we could just run "poetry install" and the copy of packages would be done under the hood before actually installing.
Workarounds
We currently run a bash file that will do the copy before doing "poetry install".
The text was updated successfully, but these errors were encountered: