stac-utils/pystac-client

Enable ruff's `I` rules

gadomski opened this issue · 4 comments

Import sorting isn't enabled by default, but we should turn it on. See stac-utils/stactools@3e1ee88 for an example of adding it to pyproject.toml and .pre-commit-config.yaml.

I am a big fan of import sorting and absolutifying (although I'm not sure if ruff has that).

I am a big fan of import sorting and absolutifying (although I'm not sure if ruff has that).

Sorting yes, absolutifying there's at least a lint for that: https://beta.ruff.rs/docs/rules/relative-imports/. I tend towards not-minding from .sibling import Klass but I'm +/-0 on the ruleset -- this is in the category of "I don't mind either way as long as we pick one."

It's all relative. Absolute imports are relative to the python path of the current execution. Relative imports are relative to the location in the directory structure from the current module. Not that I've ever had the same package installed in two different spots in my PYTHONPATH.

I'm +/-0 on the ruleset -- this is in the category of "I don't mind either way as long as we pick one."

Yeah same same, absolute just seems to be the direction people go when they want to enforce picking 🤷