Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Dec 30, 2025

Summary

  • Add async equivalents for all sync APIs with Async prefix
  • AsyncGit, AsyncHg, AsyncSvn command classes
  • AsyncGitSync, AsyncHgSync, AsyncSvnSync sync classes
  • Async subprocess wrapper with progress callbacks
  • pytest-asyncio fixtures for async testing

New APIs

Sync Async
Git AsyncGit
Hg AsyncHg
Svn AsyncSvn
GitSync AsyncGitSync
HgSync AsyncHgSync
SvnSync AsyncSvnSync

Test plan

  • Unit tests for async subprocess and run modules
  • Tests for all async command classes
  • Tests for all async sync classes
  • Async fixture tests
  • Documentation with working doctests

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 65.75476% with 701 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.51%. Comparing base (f0e705d) to head (88880e8).

Files with missing lines Patch % Lines
src/libvcs/cmd/_async/git.py 38.39% 134 Missing and 81 partials ⚠️
src/libvcs/sync/_async/git.py 50.84% 97 Missing and 19 partials ⚠️
tests/sync/_async/test_svn.py 0.00% 106 Missing ⚠️
src/libvcs/cmd/_async/hg.py 23.46% 50 Missing and 25 partials ⚠️
tests/cmd/_async/test_svn.py 0.00% 73 Missing ⚠️
src/libvcs/sync/_async/base.py 33.92% 30 Missing and 7 partials ⚠️
src/libvcs/pytest_plugin.py 32.07% 35 Missing and 1 partial ⚠️
src/libvcs/_internal/async_run.py 69.33% 22 Missing and 1 partial ⚠️
src/libvcs/sync/_async/hg.py 48.14% 14 Missing ⚠️
src/libvcs/_internal/async_subprocess.py 96.20% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #504      +/-   ##
==========================================
+ Coverage   53.22%   56.51%   +3.29%     
==========================================
  Files          38       53      +15     
  Lines        5676     7723    +2047     
  Branches     1063     1296     +233     
==========================================
+ Hits         3021     4365    +1344     
- Misses       2144     2710     +566     
- Partials      511      648     +137     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added a commit that referenced this pull request Dec 30, 2025
tony added 15 commits December 30, 2025 08:52
why: Document async patterns and conventions for contributors.
what:
- Add async architecture overview (_async/ subpackages)
- Add async subprocess patterns (communicate, timeout, BrokenPipeError)
- Add async API conventions (naming, callbacks, shared logic)
- Add async testing patterns with pytest-asyncio
- Add async anti-patterns to avoid
why: Provide async subprocess execution primitives for building
async VCS command wrappers.

what:
- Add async_subprocess.py with AsyncSubprocessCommand class
- Add async_run.py with async run() and callback support
- Support timeout, check, and streaming output
why: Enable non-blocking VCS command execution for better concurrency.

what:
- Add AsyncGit with async run(), clone(), fetch(), etc.
- Add AsyncHg with async run(), clone(), pull(), etc.
- Add AsyncSvn with async run(), checkout(), update(), etc.
why: Enable async repository cloning, updating, and synchronization
for concurrent multi-repo operations.

what:
- Add AsyncGitSync with async obtain(), update_repo(), etc.
- Add AsyncHgSync with async obtain(), update_repo(), etc.
- Add AsyncSvnSync with async obtain(), update_repo(), etc.
- Add shared async base class
what:
- Add async_git_repo, async_hg_repo, async_svn_repo fixtures
- Add asyncio to doctest_namespace for async doctests
- Add conditional pytest_asyncio import
what:
- Add AsyncSubprocessCommand tests (run, timeout, concurrent)
- Add async run() tests (callbacks, error handling)
- Add AsyncProgressCallbackProtocol tests
what:
- Add AsyncGit tests (init, clone, status, etc.)
- Add AsyncHg tests (init, clone, status, etc.)
- Add AsyncSvn tests (checkout, update, status, etc.)
what:
- Add AsyncGitSync tests (obtain, update_repo, remotes)
- Add AsyncHgSync tests (obtain, update_repo)
- Add AsyncSvnSync tests (obtain, update_repo)
what:
- Add docs/internals/async_run.md with API reference
- Add docs/internals/async_subprocess.md with API reference
- Add async modules to internals toctree
what:
- Add docs/topics/asyncio.md with patterns and examples
- Cover concurrent cloning, progress callbacks, error handling
- Add asyncio to topics toctree
why: Document the new async command and sync classes.
what:
- Add AsyncGit, AsyncHg, AsyncSvn to cmd/index.md
- Add AsyncGitSync, AsyncHgSync, AsyncSvnSync to sync/index.md
why: Help users discover and adopt async APIs.
what:
- Add async section to README with concurrent clone example
- Add async quickstart examples with asyncio.run() patterns
- Document async pytest fixtures in pytest-plugin guide
why: Required for async test support with pytest.
what:
- Add pytest-asyncio to dev and testing dependency groups
why: Enable proper async test support with strict mode.
what:
- Set asyncio_mode = "strict" for explicit async marking
- Set asyncio_default_fixture_loop_scope = "function"
- Filter pytest-asyncio deprecation warning for loop scope
@tony
Copy link
Member Author

tony commented Dec 30, 2025

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

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.

2 participants