-
Notifications
You must be signed in to change notification settings - Fork 10
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
Release 0.2.0 breaks compatibility with Poetry package manager #23
Comments
Is is unfortunate that right now pipenv doesn't like flake8-black saying "black >= 19.3b0" (my issue #18/#21) while poetry doesn't like it saying just "black" (any version). I agree, it would be nice if black dropped their pre-release tag because it is just causing trouble with many different packaging environments. This corner of PEP440 seems under tested, so something good is coming from this at least. Do you know if there an equivalent poetry bug for it failing to pick the latest version of black in this circumstance? i.e. Their equivalent of pypa/pipenv#3928 - the closest I found was python-poetry/poetry#2413 which is a bit different as it isn't via a dependency. In any case, I would strongly recommend your project explicitly pin the version of black yourself. With a large codebase even the recent versions of black introduce changes. As a poetry user, is that an acceptable workaround? If so, I can document that. |
Or, another workaround is just pin "flake8-black == 0.1.2" - and we can both hope the next Black release makes life easier ;) |
I believe Poetry is compliant with PEP 440 and there is no bug to report with Poetry in this case - it's Pipenv that's not compliant. It's not ideal to pin the version of black or flake8-black since it prevents updates. The best resolution for Poetry users is to explicitly allow pre-releases for only the black package by adding this to their
This has the benefit of getting the latest flake8-black and black releases. As I mentioned, it's not ideal to specify sub-dependencies in Thanks again for your work on this plugin, it simplifies workflow and CI. 🙏 |
I would expect poetry to take the latest version of black in this context, but I think we'd both agree PEP440 could be much clearer on this. While I suggest pinning black for stability, if you keep on top of it having the latest black is also viable - I try to do that with my own projects. I think I need to add something to the flake8-black documentation, although I would rather point at some black documentation for all the workarounds needed because they still only have pre-releases on PyPI. |
I've put something in the README file, please don't hesitate to suggest any improvements (either here or on a new issue), but marking this as closed now. Thank you. |
This issue is related to c473392
When adding the
flake8-black
package either viapoetry add flake8-black
or by adding it topyproject.toml
, you get this error:If I pin to the prior version,
poetry add flake8-black=0.1.2
I get the correct result:The recent change to allowing any release version of
black
prevents any pre-release version from being installed due to psf/black#517 that's been previously mentioned. IMO the correct behavior would be to specify the minimum compliantblack
pre-release version and allow the latest version to be installed by the package manager and be compliant with PEP 440. If there's a preference to keep the current behavior to support Pipenv users until pypa/pipenv#3928 is resolved - feel free to close this issue and it would be helpful to note that the current workaround for Poetry users is to add the following line in yourpyproject.toml
:This is not ideal since sub-dependencies shouldn't need to be specified in
pyproject.toml
.The text was updated successfully, but these errors were encountered: