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

update isort CI and pre-commit hook #4204

Merged
merged 9 commits into from Jul 16, 2020
Merged

update isort CI and pre-commit hook #4204

merged 9 commits into from Jul 16, 2020

Conversation

keewis
Copy link
Collaborator

@keewis keewis commented Jul 6, 2020

Now that the conda-forge feedstock has been updated, we would see a failing isort CI because of the removed -rc (short for --recursive). I also updated the version used by pre-commit to the 5.0.4 version released about an hour ago, which allows us to remove the file regex as recommended by @asottile in #3750 (comment) (we couldn't follow that advice before since we were using the use_parentheses setting which was broken on 4.3.21)

  • Closes isort flags #4202
  • Tests added
  • Passes isort . && black . && mypy . && flake8
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

@keewis
Copy link
Collaborator Author

keewis commented Jul 6, 2020

it seems isort changed the way it treats imports like import dask.array as da: it wants to rewrite them as from dask import array as da.

While having such a conflict indicates poor design, this is actually not the same: import dask.array will always import a module but from dask import array will import anything with that name. That means that if we had a function named array in dask, we wouldn't get the module but the function.

Not sure if we have any dependency where these changes are dangerous?

We should probably pin isort to 4.3.21 until this is resolved upstream.

Edit: see PyCQA/isort#1280

@max-sixty
Copy link
Collaborator

Thanks @keewis . Interesting re the difference in import functionality; I didn't know that.

I'm fine either way; to the extent the tests pass on the revised format, I'd be fine moving to that.

This was referenced Jul 7, 2020
@keewis
Copy link
Collaborator Author

keewis commented Jul 15, 2020

The failing tests are #4225 and #4226, so this should be ready for review and merge.

I also updated the flake8 pre-commit hook since flake8<3.8 seems to not like mypy overloads.

@max-sixty
Copy link
Collaborator

Great! Thanks @keewis !

@keewis keewis merged commit 1be777f into pydata:master Jul 16, 2020
@keewis keewis deleted the fix-isort branch July 16, 2020 19:14
dcherian added a commit to jacobtomlinson/xarray that referenced this pull request Jul 24, 2020
* upstream/master:
  Added xarrays-spatial and updated geoviews link (pydata#4262)
  update docs to point to xarray-contrib and xarray-tutorial (pydata#4252)
  Add release summary, some touch-ups (pydata#4217)
  CFTimeIndex calendar in repr (pydata#4092)
  fix the RTD timeouts (pydata#4254)
  update isort CI and pre-commit hook (pydata#4204)
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

Successfully merging this pull request may close these issues.

isort flags
3 participants