Add pre-commit as a development dependency#151
Conversation
|
Nope, we can't
However, the abstract statement is true: |
|
In what sense is it dangerous? You are still allowed to have a global installation of pre-commit if you want but it allows you to have a self-contained dev environment with poetry. It is not the same case as black, since it is managed by pre-commit ita version is pinned but the precommit version (if managed from the outside) it is not. |
agreed, a better wording would be: "having an virtual env inside an virtual env can be very confusing" - of course one could do it, but how comfortable would that be?
mmm? actually, no - if you want to have a self-contained dev env you could not have a global installation (that's the point right?) but that is not what would happen: pre-commit would always make it's own thing (take a look the installed hook)
it is true that the pre-commit version is not pinned, but this is really a meta dependency at this point - meaning any change on pre-commit itself should have a very mild impact on the code (actually it should have none). If ever this may change the syntax of the Consider the purpose of the two tools: poetry is a replacement for setuptools, instead pre-commit is a git addon; poetry targets PyPI, pre-commit targets the repo; The fact that pre-commit is written in Python is completely accidental - and instead e.g. I'm using pre-commit in other contexts to run |
Right now I only have two sources of "stuff", either the global
Exactly.
But I won't have to maintain what pre-commit does. I only need to care about where pre-commit is installed. In any case, if you think having it as a dev dependencies will break use-cases for other people feel free to close the PR. I can simply manually install pre-commit whenever I clone the repo in a new computer. |
|
I'll let @alecandido comment, but yes, I don't think this PR represents the common use case, so we should close it ... (of course you're free to install pre-commit inside poetry nevertheless, but this then is your responsibility to solve the issues) |
With four developers this is the use case of the 25% of the users though :P As I said, only if it doesn't break it for anyone. If it does break things then obviously I'll manage my own mess. |
|
we can even do it ;-) but remember that installing pre-commit is not sufficient - you need to install the hooks! and I still prefer to tell people "look you have to do this one-time install process and then you can do your usual git routines, including all the fancy add-ons for git and what not" than "you have to do this one-time install process and then every time you want to commit you have to activate the env" |
|
The second sentence is a tad shorter :P You can still tell people to do the first though and leave the second for the connoisseur |
|
I didn't read the thread, I'll do, and we'll discuss.
|
|
if you are also against then lets leave it at that. More abstract arguments don’t really matter as they are also against! I’ll do my best to remember to install it when i need it. but my counterarguments is that 1 forces you to have a second source of executables (which I don’t want to maintain in galileo or other infn computers) and to install precommit anyway (only globally). |
|
I'd be in favor of choosing the most sensible option, rather than going for majority. I see your point about keeping it inside, in such way to make a reproducible environment: Poetry is there for that reason, and In order to use Poetry, you have to install it (and this is a separate source of executables, already). However, you can modify the repo w/o it (though it is generally not recommended, you should test while developing). Same goes for An alternative to global installation is make a "development environment" (e.g. with bare |
In this case is a qol change, doesn't really affect the project. If majority thinks it will introduce problems for their use cases I'm happy to concede. |
Unless there is a strong reason why it should not be done, it is a development dependency.