Skip to content

Add D-MemFS: in-process virtual filesystem for testing#73

Open
nightmarewalker wants to merge 2 commits intocleder:mainfrom
nightmarewalker:add-d-memfs
Open

Add D-MemFS: in-process virtual filesystem for testing#73
nightmarewalker wants to merge 2 commits intocleder:mainfrom
nightmarewalker:add-d-memfs

Conversation

@nightmarewalker
Copy link

@nightmarewalker nightmarewalker commented Mar 18, 2026

Description

Hello! I'd like to propose adding D-MemFS to the Mocks section (alongside pyfakefs).

While pyfakefs is excellent for patching global os/open() state, D-MemFS serves a different architectural need: it provides an explicit, isolated filesystem instance that you pass around via dependency injection. This means no monkey-patching and zero side effects on other code.

  • Full FS Semantics: Hierarchical directories, hard quota enforcement, and file-level RW locking.
  • Concurrency Ready: Fully thread-safe, including support for free-threaded Python 3.13 (PYTHON_GIL=0).
  • Zero Dependencies: Relies purely on the Python standard library.
  • Proven Stability: 369 tests, 97% coverage, tested across 3 OS × 3 Python versions in CI.
  • Community Validated: Discussed on r/Python with positive reception.

I believe it provides a valuable, explicit alternative for testing I/O-heavy code. Thank you for maintaining this awesome list!

Summary by Sourcery

Documentation:

  • Document D-MemFS as an in-memory virtual filesystem mock in the README mocks section.

@semanticdiff-com
Copy link

Review changes with  SemanticDiff

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 18, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds D-MemFS to the README’s Mocks section as an additional in-memory filesystem testing utility, including a short descriptive tagline clarifying its explicit-instance, zero-dependency design and hard quota support.

File-Level Changes

Change Details Files
Document D-MemFS as an additional mocking library in the README under the Mocks section.
  • Insert a new bullet in the Mocks list for D-MemFS with a GitHub link.
  • Describe D-MemFS as a zero-dependency in-memory virtual filesystem with hard quotas.
  • Clarify that D-MemFS provides an explicit, isolated filesystem instance instead of patching global state.
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review
Copy link

Review Summary by Qodo

Add D-MemFS to Mock and Stub testing resources

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add D-MemFS to Mock and Stub section
• Provides in-memory virtual filesystem alternative to pyfakefs
• Emphasizes explicit dependency injection over monkey-patching
Diagram
flowchart LR
  README["README.md<br/>Mock and Stub Section"]
  DMEMFS["D-MemFS Entry<br/>In-memory Virtual FS"]
  README -- "adds entry" --> DMEMFS
Loading

Grey Divider

File Changes

1. README.md 📝 Documentation +1/-0

Add D-MemFS mock filesystem resource entry

• Added D-MemFS entry to the Mock and Stub section
• Positioned alphabetically between Cornell and doublex entries
• Includes description highlighting zero-dependency design and explicit instance approach

README.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 18, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces D-MemFS, a zero-dependency, in-memory virtual filesystem, to the list of testing resources. D-MemFS distinguishes itself by offering an explicit, isolated filesystem instance, contrasting with traditional global state patching methods. The inclusion of D-MemFS aims to provide developers with a concurrency-ready and community-validated tool for I/O-heavy code testing.

Highlights

  • Introduction of D-MemFS: This PR proposes adding D-MemFS to the list of mocking resources, offering an in-memory virtual filesystem for testing.
  • Key Features of D-MemFS: D-MemFS provides full filesystem semantics, concurrency support, and zero dependencies, making it a robust alternative to patching global state.
  • Community Validation: The addition of D-MemFS is backed by community discussion and positive reception, indicating its potential value to developers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

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

Auto Pull Request Review from LlamaPReview

Review Status: Automated Review Skipped

Dear contributor,

Thank you for your Pull Request. LlamaPReview has analyzed your changes and determined that this PR does not require an automated code review.

Analysis Result:

PR only contains documentation changes (1 files)

Technical Context:

Documentation changes typically include:

  • Markdown/RST file updates
  • API documentation
  • Code comments
  • README updates
  • Documentation in /docs directory
  • License and contribution files

We're continuously improving our PR analysis capabilities. Have thoughts on when and how LlamaPReview should perform automated reviews? Share your insights in our GitHub Discussions.

Best regards,
LlamaPReview Team

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds D-MemFS, an in-memory virtual filesystem, to the 'Mock and Stub' section of the README. The new entry is placed correctly in alphabetical order and the description highlights its key features. The change is a straightforward addition to the list. The PR description also positions D-MemFS as an alternative to pyfakefs. Given that pyfakefs is a widely-used library for filesystem mocking but is not currently included in the list, you might consider adding it as well to enhance the comprehensiveness of this resource.

@nightmarewalker
Copy link
Author

I've also added pyfakefs to the list, as the automated code review pointed out that it was missing. Since I mentioned it as a comparison in my description, it makes sense to have it in the same section for completeness!

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.

1 participant