Skip to content

Fixing import error - #69

Merged
bybatkhuu merged 1 commit into
mainfrom
dev
Aug 19, 2026
Merged

Fixing import error#69
bybatkhuu merged 1 commit into
mainfrom
dev

Conversation

@bybatkhuu

Copy link
Copy Markdown
Owner

This pull request introduces IO utility support to the project, allowing for directory creation and removal using the new potato_util.io module. 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:

  • Added import of potato_util.io as io_utils in both README.md and examples/simple/main.py to enable access to IO utility functions. [1] [2]
  • Updated the main() function in both README.md and examples/simple/main.py to demonstrate usage of io_utils.create_dir and io_utils.remove_dir, including logging for IO operations. [1] [2]

Async IO Import Logic:

  • Improved the conditional import in src/potato_util/io/__init__.py to require both aiofiles and aioshutil to be available before importing asynchronous IO utilities, ensuring more robust async support.

@bybatkhuu bybatkhuu self-assigned this Aug 19, 2026
Copilot AI lite review requested due to automatic review settings August 19, 2026 03:51
@bybatkhuu bybatkhuu added the bug Something isn't working label Aug 19, 2026
@bybatkhuu
bybatkhuu merged commit ab35fee into main Aug 19, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.io async import gating to require both aiofiles and aioshutil.
  • Updated README usage snippet to import and demonstrate io_utils.create_dir / io_utils.remove_dir.
  • Updated examples/simple/main.py to 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 thread examples/simple/main.py
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 thread README.md
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants