-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add os.PathLike
when filepath as str
is expected
#5200
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
Conversation
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! Some unit tests will be helpful. You may consider adding them to https://github.com/onnx/onnx/blob/main/onnx/test/basic_test.py and https://github.com/onnx/onnx/blob/main/onnx/test/test_external_data.py
Signed-off-by: vahvero <otso.brummer@gmail.com>
Signed-off-by: vahvero <otso.brummer@gmail.com>
Signed-off-by: vahvero <otso.brummer@gmail.com>
I have some issues trying to build ONNX from source to run local tests.
I am not experienced with large scale C++. I will try later again, installing
|
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.
I have some issues trying to build ONNX from source to run local tests.
According to the error message, it seems that you have multiple Protobuf compiler. Please git clean -xdf
to clean all build files, pip install --upgrade pip setuptools
to get the latest setuptools, and then try pip install -e .
again.
I had installed protobuf from source, and copied it to |
Please also make sure the change is free of lint errors: https://github.com/onnx/onnx/blob/2e9a6757ad33ef4bc0c4a4ecc61837f79885a82a/docs/CONTRIBUTING.md#code-style thanks a lot! |
Signed-off-by: vahvero <otso.brummer@gmail.com>
I did not realize all pushes automatically request review. Should now pass all linters and tests, at least did in local. |
Signed-off-by: vahvero <otso.brummer@gmail.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com>
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.
Thank you for extending! Could you please also update this function:
Lines 58 to 60 in c4a4327
def infer_shapes_path( | |
model_path: str, | |
output_path: str = "", |
Signed-off-by: vahvero <otso.brummer@gmail.com>
Signed-off-by: vahvero <otso.brummer@gmail.com>
Signed-off-by: vahvero <otso.brummer@gmail.com>
Head branch was pushed to by a user without write access
You may want to run lintrunner -a to fix the rest of the lint errors |
I receive no errors when running |
Maybe try lintrunner init to make sure all linters are up to date then run lintrunner --all -a to run it on all files? |
Signed-off-by: vahvero <otso.brummer@gmail.com>
Fixed in 14b4b7c |
Signed-off-by: vahvero <otso.brummer@gmail.com> Signed-off-by: vahvero <30704280+vahvero@users.noreply.github.com> Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Description
closes #5182 by adding
os.PathLike
to type unions and usingos.fspath
at some points.Motivation and Context
Context
onnx
file handling accepts onlyIO[bytes] | str
. If passing Pythonpathlib.Path
, static type checkers such aspyright
andpylance
emit errors which is incorrect.Causes
PyRight
error.Motivation
pathlib
to handle paths is considered best practice by many.These, in general, should benefit general code quality.
Initial issue discussion was with
justinchuby
This is my first time contributing to anything public. Changes are very minor and any feedback is welcome.