Skip to content

Conversation

@tomprince
Copy link
Contributor

@tomprince tomprince commented Nov 16, 2021

This add colorama as a direct dependency. Currently, it a transitive dependency only on windows. When using pip-compile (from pip-tools), to pin dependencies, it only supports generating dependencies for the current platform. However, there are only two dependencies that vary between platforms, colorama and pywin32. pywin32 can't be installed on non-windows platform and has dropped python 2 support, so is relatively easy to pin. colorama is cross-platform, so including it here is a tiny bit wasteful, but makes pinning it trivial.

This is part of implementing https://whetstone.privatestorage.io/privatestorage/privatestoragedesktop/-/issues/603 for gridsync (see gridsync/gridsync#400).

@tomprince tomprince changed the title Deps Make generating cross-plaform pins easier. Nov 24, 2021
@tomprince tomprince requested a review from exarkun November 24, 2021 21:52
@tomprince tomprince marked this pull request as ready for review November 24, 2021 21:52
Copy link
Member

@crwood crwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is indeed wasteful to have to declare dependencies for platforms that don't actually require them like this (and, especially, in this particular case, since, to my knowledge, we're not actually using tqdm directly anywhere and are only inheriting it to satisfy the Magic-Wormhole CLI usage -- which we also don't use), given the current state of the tooling available in the python packaging ecosystem, this appears to the most straightforward solution. (Doing this the "Right" way, it seems, would require generating pins on each platform individually -- and across multiple python interpreter versions -- and then merging the results but, to me, the added complexity of doing that doesn't seem worth it here given that we're only talking about one sub-sub-dependency that existing codepaths don't even touch...).

So, LGTM. :)

(Also, I like that, after this is merged, I won't have to continue to manually preserve the colorama line in this file -- so that's a bonus.)

@tomprince tomprince merged commit 659cf84 into PrivateStorageio:main Dec 14, 2021
@tomprince tomprince deleted the deps branch December 14, 2021 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants