Skip to content

Commit

Permalink
Exclude from objectron/proto/objectron/proto.py from `just py-forma…
Browse files Browse the repository at this point in the history
…t` (#2562)

### What

For some reason, `objectron/proto/objectron/proto.py` relies on
old-style annotation, so it broke with #2361 and was subsequently fixed
by #2559. `just py-format` insist on reverting that latest fix, so the
file is explicitly excluded from `pyupgrade`. I used a pretty ugly hack
because `pyupgrade` is [way too
opinionated](asottile/pyupgrade#809) to even
accept comment-based disabling.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested https://demo.rerun.io/pr/2562 (if applicable)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2562

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/4d0b2b4/docs
Examples preview: https://rerun.io/preview/4d0b2b4/examples
<!-- pr-link-docs:end -->

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
  • Loading branch information
abey79 and emilk committed Jun 29, 2023
1 parent 5297267 commit c37154d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ py-format:
set -euxo pipefail
black --config rerun_py/pyproject.toml {{py_folders}}
blackdoc {{py_folders}}
pyupgrade --py38-plus `find {{py_folders}} -name "*.py" -type f`
# Note: proto.py relies on old-style annotation to work, and pyupgrade is too opinionated to be disabled from comments
# See https://github.com/rerun-io/rerun/pull/2559 for details
pyupgrade --py38-plus `find {{py_folders}} -name "*.py" -type f ! -path "examples/python/objectron/proto/objectron/proto.py"`
ruff --fix --config rerun_py/pyproject.toml {{py_folders}}
# Check that all the requirements.txt files for all the examples are correct
Expand Down

0 comments on commit c37154d

Please sign in to comment.