I have pangeobench, the first three line are:
#!/usr/bin/env python3
import click
from benchmarks.utils import Runner
This cannot pass the isort test. After I removed the first line and the following bland line, it passed the isort test. How can I have the first line and still pass the isort test?
This post should go in the #python-dev Stream, not in #general.
As for the question you posed, if you are referring to the file here:
https://github.com/pangeo-data/benchmarking/blob/master/pangeobench
Then it passes the isort test for me. What is your isort configuration?
But click is third party, benchmarks is belong to benchmarking package. So should be import click placed before from benchmarks?
Here is isort configuration:
[isort]
known_first_party=benchmarking
known_third_party=dask,distributed,numpy,pandas,pkg_resources,setuptools,xarray
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
line_length=100
skip=
setup.py
Yes. I’m sorry. After you reorder those lines and separate them by a blank line, it should pass isort.
The order that I showed can pass isort from pre-commit-config, but it cannot pass the actions that I setup in main.yaml.
Let's move this to a private conversation...
Last updated: May 16 2025 at 17:14 UTC