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

Make isort repeatable #694

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Make isort repeatable #694

merged 2 commits into from
Mar 6, 2023

Conversation

trey0
Copy link
Contributor

@trey0 trey0 commented Mar 2, 2023

This PR attempts to fix a Python linting problem where sometimes the isort step in the git pre-commit hook disagrees with the isort step in the CI workflow. This is really painful because it's basically isort fighting with itself.

The root cause of the problem is that isort's import grouping is based on what imports it considers to be first party, which in turn is influenced by how it is invoked (the complete list of files or folders that are passed to it on the command line). The pre-commit hook and CI workflow weren't processing the same file/folder list. So that's fixed.

In the process, I also figured out how to get isort to consider all Python imports found within the astrobee repo as first party, which makes the import grouping more inline with the normal isort convention (and PEP 8). That triggered a one-time change where a bunch of Python files now have their imports following this consistent style.

@trey0 trey0 merged commit 8987f5b into nasa:develop Mar 6, 2023
marinagmoreira added a commit that referenced this pull request Mar 9, 2023
* Documentation update (#668)

* docker docs update

* make build instructions ROS1

* updating install instructions, hopefully making them easier to follow

* updated from github PR reviews

* fix typo

* replace list with append (#671)

* ci: bump to checkout@v3 (#673)

* Unlatching topics (#674)

* Changed heartbeat topic to be unlatched.

* Changed echoed command to not latching.

* no subscribers and info is obtained by service, so no latched topic needed

* removing latched on frequently published topics

* Made command topic to not atching.

* no need for these to be latched

* sub and pub in same node, no need to latch

* no need to be latched no subs and not recorded, rviz should be opened when published

* Made ground bridge topics not latched.

* Fixed heartbeat topic latched comment.

---------

Co-authored-by: Katie Browne <kathryn.browne@nasa.gov>

* support multiple versions for docs (#675)

* Make coverage_analyzer.py support Python 3 (#680)

Refactor to simplify and make output identical between Python 2 and 3

* Release 0.17.0 (#683)

* add missing glog flag that caused problems in some systems (#685)

* Make isort repeatable (#694)

* make isort repeatable

* isort now consistently groups astrobee imports as first party; one-time update to apply to old files

* moving ff_names to ff_common, updating headers (#696)

---------

Co-authored-by: Trey Smith <trey.smith@nasa.gov>
Co-authored-by: Katie Browne <kathryn.browne@nasa.gov>
luisa-mao pushed a commit to luisa-mao/astrobee-1 that referenced this pull request Jul 11, 2023
* make isort repeatable

* isort now consistently groups astrobee imports as first party; one-time update to apply to old files
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.

2 participants