Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s IO utilities surface and examples by (1) making async IO imports more robust and (2) documenting/demoing the new potato_util.io helpers in the README and the simple example.
Changes:
- Tightened
potato_util.ioasync import gating to require bothaiofilesandaioshutil. - Updated README usage snippet to import and demonstrate
io_utils.create_dir/io_utils.remove_dir. - Updated
examples/simple/main.pyto import and demonstrate the IO utilities.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/potato_util/io/__init__.py |
Updates conditional async import logic to check for both async dependencies. |
README.md |
Adds potato_util.io import and demonstrates directory create/remove usage. |
examples/simple/main.py |
Adds potato_util.io import and demonstrates directory create/remove usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+7
to
10
| if (importlib.util.find_spec("aiofiles") is not None) and ( | ||
| importlib.util.find_spec("aioshutil") is not None | ||
| ): | ||
| from ._async import * |
Comment on lines
+194
to
+197
| # IO utils: | ||
| logger.info("[IO UTILITIES]") | ||
| io_utils.create_dir("test_dir", warn_mode="ALWAYS") | ||
| io_utils.remove_dir("test_dir", warn_mode="ALWAYS") |
Comment on lines
+334
to
+337
| # IO utils: | ||
| logger.info("[IO UTILITIES]") | ||
| io_utils.create_dir("test_dir", warn_mode="ALWAYS") | ||
| io_utils.remove_dir("test_dir", warn_mode="ALWAYS") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces IO utility support to the project, allowing for directory creation and removal using the new
potato_util.iomodule. The changes update both the codebase and example usage to demonstrate and utilize these new IO utilities, and enhance the dynamic import logic for asynchronous IO support.IO Utilities Integration:
potato_util.ioasio_utilsin bothREADME.mdandexamples/simple/main.pyto enable access to IO utility functions. [1] [2]main()function in bothREADME.mdandexamples/simple/main.pyto demonstrate usage ofio_utils.create_dirandio_utils.remove_dir, including logging for IO operations. [1] [2]Async IO Import Logic:
src/potato_util/io/__init__.pyto require bothaiofilesandaioshutilto be available before importing asynchronous IO utilities, ensuring more robust async support.