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

flit==3.7.0 breaks pre-commit hook #56

Closed
pmeier opened this issue Feb 22, 2022 · 3 comments
Closed

flit==3.7.0 breaks pre-commit hook #56

pmeier opened this issue Feb 22, 2022 · 3 comments

Comments

@pmeier
Copy link
Contributor

pmeier commented Feb 22, 2022

flit==3.7.0 was released ~3 hours ago and with that version, usort errors during installation from source. This happens for example if it is installed through a pre-commit hook. See for example this CI run.

Quick fix would be to pin

requires = ["flit_core >=3,<4"]

to

requires = ["flit_core >=3,<3.7"] 
@pmeier
Copy link
Contributor Author

pmeier commented Feb 22, 2022

Digging deeper, this is not a fix. The problem is that flit and flit-core are not in sync. Although we pin

flit==3.6.0

pip install flit==3.6.0 installs flit-core==3.7.0. Thus, we should add a pin for flit-core==3.6.0 into requirements-dev.txt.

@amyreese
Copy link
Member

Turns out, this is actually pypa/flit#530 because µfmt uses a dynamic __version__ imported from a relative module in ufmt.__init__. It looks like there's a fix for this upcoming in flit 3.7.1. I've just updated the PEP518 spec to just disallow 3.7.0, which should be sufficient, and I'll cut a point release for use with pre-commit configs.

@amyreese
Copy link
Member

v1.3.2 is released now.

facebook-github-bot pushed a commit to pytorch/torchrec that referenced this issue Mar 29, 2022
Summary:
Since omnilib/ufmt#56 is resolved, so I re-enable this hook, and upgrade it to v1.3.2 as pytorch/vision#5460 .

Pull Request resolved: #180

Reviewed By: colin2328

Differential Revision: D35197897

Pulled By: s4ayub

fbshipit-source-id: 5c024fbff1eddef523ef97bb95faca250ecb1ac4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants