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

fix: correct sorting of packages #72

Merged
merged 2 commits into from Feb 3, 2024
Merged

Conversation

squat
Copy link
Contributor

@squat squat commented Jan 29, 2024

Right now, all of the local packages are grouped with 3rd-party packages
because isort does not know that everything under
projects/fal is local. This is probably because
installing the root of the repository does not actually bring any
fal code with it, and because isort runs from the
perspective of the repository root, the tool understands that all
isolate_controller code is foreign.

Signed-off-by: Lucas Servén Marín lserven@gmail.com

@squat
Copy link
Contributor Author

squat commented Jan 29, 2024

@squat
Copy link
Contributor Author

squat commented Jan 29, 2024

for some reason isort isn't picking up the configuration in pyproject.toml
maybe related: PyCQA/isort#1890
weirdddd

mederka
mederka previously approved these changes Jan 30, 2024
Copy link
Contributor

@mederka mederka left a comment

Choose a reason for hiding this comment

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

Looks great! But it's failing the linting check?

Right now, all of the local packages are grouped with 3rd-party packages
because isort does not know that everything under
projects/fal is local. This is probably because
installing the root of the repository does not actually bring any
isolate_controller code with it, and because isort runs from the
perspective of the repository root, the tool understands that all
isolate_controller code is foreign.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
@squat squat force-pushed the correct_sorting_of_packages branch from 5f12c89 to ec63366 Compare February 3, 2024 00:02
@squat
Copy link
Contributor Author

squat commented Feb 3, 2024

CI was failing because of PyCQA/isort#1889. There are a myriad of GitHub issue of users documenting that isort behaves unexpectedly when used in a pre-commit.

The underlying issue is that the rules that isort uses to choose a configuration file when run in a pre-commit hook does not necessarily match the rule when run outside of a pre-commit hook.

I ended up determining that isort was incorrectly using one of the configuration blocks in a nested pyproject.toml, whereas isort on the CLI was not. I removed the [tool.isort] blocks in all of the nested pyproject.tomls and now configure isort exclusively in a pyproject.toml at the root of the directory. This makes everything behave consistently.

@squat squat merged commit e35d952 into main Feb 3, 2024
4 checks passed
@squat squat deleted the correct_sorting_of_packages branch February 3, 2024 00:30
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.

None yet

2 participants