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

Dependencies for black[d] are being installed by default #4107

Closed
BryceStevenWilley opened this issue Dec 12, 2023 · 8 comments · Fixed by #4108
Closed

Dependencies for black[d] are being installed by default #4107

BryceStevenWilley opened this issue Dec 12, 2023 · 8 comments · Fixed by #4108
Labels
T: bug Something isn't working

Comments

@BryceStevenWilley
Copy link
Contributor

Describe the bug

Minor bug, but it seems that the extra dependencies for the d extra are being installed by default on 23.12.0. This can cause some issues on docker containers and such where gcc isn't installed, as the extra dependencies (aiohttp, and frozenlist) don't seem to have wheels.

To Reproduce

On a non-windows machine (I've done it on Ubuntu, and it also seems to happen on Linux github action runners) Make a new venv, source it, and install black:

python3 -m venv .venv
source .venv/bin/activate
pip install black

It will install requirements from the d extra as well;

Installing collected packages: platformdirs, packaging, tomli, multidict, idna, yarl, attrs, frozenlist, async-timeout, aiosignal, aiohttp, typing-extensions, click, pathspec, mypy-extensions, black
Successfully installed aiohttp-3.9.1 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 black-23.12.0 click-8.1.7 frozenlist-1.4.0 idna-3.6 multidict-6.0.4 mypy-extensions-1.0.0 packaging-23.2 pathspec-0.12.1 platformdirs-4.1.0 tomli-2.0.1 typing-extensions-4.9.0 yarl-1.9.4

Expected behavior

It shouldn't install with the aiohttp, frozenlist, and multidict dependencies.

Environment

Additional context

First seen in rickstaa/action-black#18

I think it has to do with: 85b1c71; in my pip logs, the new restrictions seem to show up as:

Collecting aiohttp>=3.7.4; sys_platform != "win32" or implementation_name != "pypy" and extra == "d"

i.e., the extra == "d" is ignored in favor of the sys platform not being windows, so the extras are always installed. I think a quick fix would be to wrap the extras in parenthesis. Happy to make a quick PR for that.

@BryceStevenWilley BryceStevenWilley added the T: bug Something isn't working label Dec 12, 2023
@JelleZijlstra
Copy link
Collaborator

Good catch, thanks! Seems like a bug in hatch?

We should still presumably work around it by adding parentheses, though.

@sigma67
Copy link

sigma67 commented Dec 13, 2023

isort had a similar issue with their last minor release (dev dependencies distributed as default)

Although probably unrelated cause (they use poetry)

@mwgamble
Copy link

@JelleZijlstra Will there be a 23.12.1 release to deal with this?

@hauntsaninja
Copy link
Collaborator

Jelle's unavailable. I'll try to make a release in the next few days (but I haven't cut a Black release before / am currently travelling, so it'll happen when it happens)

@cooperlees
Copy link
Collaborator

I can cut one now if people want and am around to try help if things fail.

@sigma67
Copy link

sigma67 commented Dec 19, 2023

imho it should be fixed asap because it makes latest black impossible to install on Python 3.12.

This is because multidict<7 is incompatible with 3.12. It will yield this error:

multidict/_multidict.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.

@hauntsaninja
Copy link
Collaborator

Thanks to cooperlees, 23.12.1 is now a thing!

@cooperlees
Copy link
Collaborator

Happy Holidays!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants