-
Notifications
You must be signed in to change notification settings - Fork 356
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
Sort and format Python imports and enable isort
check in CI
#2883
Conversation
Conflicts: doc/htmldoc/conf.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolossus This looks neat for many cases and is a huge improvement, but as pointed out inline, but can we get more control about where our own stuff goes? I would like a three-block setup:
- Python Library modules
- Third-party modules
import nest
with all its variants
Is that feasible?
@nicolossus Could you update the PR to account for changes in master? |
@heplesser Yes, but did we reach a conclusion on where |
Conflicts: pynest/nest/lib/hl_api_spatial.py pynest/nest/lib/hl_api_types.py testsuite/pytests/sli2py_neurons/test_add_freeze_thaw.py testsuite/pytests/sli2py_neurons/test_neurons_handle_multiplicity.py testsuite/pytests/sli2py_recording/test_multimeter_stepping.py testsuite/pytests/test_NodeCollection.py testsuite/pytests/test_multimeter.py testsuite/pytests/test_weight_recorder.py
@jessica-mitchell Could you take a look at the changed documentation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks lgtm!
Conflicts: doc/htmldoc/developer_space/guidelines/coding_guidelines_check.rst
This PR sorts and formats imports in the Python codebase. The PR also introduces an
isort
runner to the CI and pre-commit.The following files, in particular, should be reviewed closely:
pyproject.toml
.pre-commit-config.yml
./github/workflows/nestbuildmatrix.yml
In order to have the
nest
import sorted properly in user facing examples,nest
is marked as a known third-party in theisort
configuration (by defaultisort
recognizes thatnest
actually is first-party and will sortimport nest
in a separate block at the end of the import section).