Open
Conversation
added 30 commits
February 13, 2026 18:35
- Add BinaryIO type for file parameter in get() - Use argparse.Namespace for args parameters - Add keyword-only args (merge_stderr, quiet) to cmd/python/pip/uv_cmd
Replace stdlib venv/ensurepip/pip with uv venv and uv pip sync: - Remove Debian ensurepip workaround (_repair_ensurepip_debian) - Remove pip() helper, get() HTTP downloader - Rewrite ensure_venv() to use uv venv - Replace pip install with uv pip sync in prepare() - Update tests: check bin/python instead of bin/pip3 uv is now required for all venv operations.
- Replace ensure_minimal_python() with find_minimal_python() - Return python path instead of using os.execv() process replacement - Pass --python flag to uv pip compile for lockfile generation - Update tests to use new function - Update type stub
- Show +N -M summary after updating lockfile - Add --diff flag to preview changes without writing - Use temp file for compilation to avoid touching lockfile on --diff
- Use ✓ with green color for success indicator - Show +N in green, -N in red for changes - Show 'No changes' when lockfile is unchanged - Fix comment filtering to handle indented comments
- Add colors to diff output (cyan headers, red deletions, green additions) - Show 'Checking lockfile changes' for --diff instead of 'Updating'
- Add REQUIREMENTS_TXT and REQUIREMENTS_LOCK constants - Replace os.path usage with pathlib.Path throughout - Update AppEnv to use Path for base, appenv_dir, original_cwd - Update type stub to reflect Path-based types - Remove unused glob import
- Remove str | Path union types, use Path only - Update tests to use Path for all appenv API calls - Fix import order in test files
- Remove skipif for Python 3.6 (no longer supported) - Simplify test to verify minimal python is passed to uv - Test now mocks uv_cmd to capture --python argument
- Add detect_project_type() to identify pyproject/requirements projects - Add get_uv_bin() with fallback chain: PATH -> nix -> pip install - Add init-pyproject command for migration/fresh setup - Implement _prepare_pyproject() using native uv venv/sync - Implement _update_lockfile_pyproject() with uv lock + pip compile fallback - Support both workflows transparently based on project files present
Replace legacy requirements.txt with modern pyproject.toml setup.
- Test detect_project_type() priority and edge cases - Test _prepare_pyproject() venv creation and cleanup logic - Test _update_lockfile_pyproject() uv lock calls - Update existing tests for ensure_uv() instead of has_uv() - Add reset() tests for .venv removal
Ignore example/.venv, example/.appenv, and .appenv/.uv
- Switch to uv-venv-lock-runner for faster envs - Add ruff, mypy, ty dependency groups for linting - Restructure lint env with proper tool chain
- Merge ruff/ty/mypy groups into single 'lint' group - Remove mypy (ty covers type checking) - Remove pre-commit config (tox fix env handles all linting) - Rename tox env 'lint' to 'fix' (runs ruff fix + format + whitespace fix + ty)
- Read version from __version__ in source instead of pyproject.toml - Add hatch version configuration to extract from src/appenv.py - Add console script entry point 'appenv = appenv:main' - Simplify show_version() to use __version__ directly - Add test for version consistency across sources
Fix env must run before test env. Remove circular depends from fix env.
- Add verbose_print() for controlled output during bootstrap - Extend uv_cmd() with verbose and project parameters - Pass --project flag to uv to prevent upward directory search - Add -v/--verbose flag to update-lockfile command - Improve status output during lockfile updates - Preserve existing symlinks during migration - Add stable header to requirements.lock
- Test that requirements.txt in subdirectory ignores parent pyproject.toml - Test that --project flag is passed to uv commands correctly
Editable installs in requirements.txt are no longer converted to uv.sources entries. They now generate warnings instead. This removes significant complexity (parse_editable_spec, extract_package_name_from_path, _process_editable_installs) that was difficult to maintain correctly. Users with local editable installs should add them manually to pyproject.toml.
- Use log.debug with %s formatting instead of f-strings - Configure logging handler in _prepare_venv when verbose mode enabled - Remove duplicate print statements in favor of unified logging - Simplify _cleanup_old_appenv_entries by removing verbose parameter
- Add autouse fixture to mock get_uv_version in all tests - Avoids subprocess calls when tests mock ensure_uv with fake paths - Add no_mock_uv_version marker for tests that directly test version logic - Update verbose tests to use caplog instead of capsys
- Add domain classes: UvBin, LockFile, NoValidUvError - Refactor Pyproject with lazy properties (requires_python, requirements_txt_info) - Refactor AppEnv: move _cleanup_old_appenv_entries, _set_up_command_symlink - Update factory functions to return wrapper types (UvBin, LockFile, Pyproject) - Change AppEnvSettings.extras to list[str] - Add module-level functions: appenv_settings_from_env, setup_logging, detect_command_name, create_pyproject - Remove deprecated functions: uv_cmd, get_uv_bin, parse_requires_python, find_project_base, configure_logging - Fix COMMAND_GROUPS type annotation (tuple[str, ...]) Based on spec: specs/accepted/typestub-based-refactoring.md
ruff check src --select=ALL --ignore=ANN,ARG,COM812,D,T201 --fix --unsafe-fixes
…ck, loop variable
- Add missing create_updated method to Pyproject class - Fix type stub signatures (args/remaining now optional) - Fix MockUvBin attributes (uv_bin→bin, uv_version→version) - Update tests to match refactored behavior: - prepare() returns Path not str - Help output to stderr (argparse standard) - Updated log/output messages All quality gates pass: 119 tests, ruff, ty type check
zagy
requested changes
Mar 12, 2026
Member
zagy
left a comment
There was a problem hiding this comment.
The documentation is a lot and it is very redundant. It doesn't help this way.
Also I stopped review at "fix_whitespace.py". There is o much noise here that It's really hard to review.
The commits need to be squashed to a useful amount.
Functionality itself seems to be there and working (in my tests) alas the repo is almost unmaintainable currently.
Comment on lines
+19
to
+32
| def main(): | ||
| # 1. Ensure correct Python version | ||
| ensure_best_python(base) | ||
|
|
||
| # 2. Clear PYTHONPATH for isolation | ||
| os.environ.pop("PYTHONPATH", None) | ||
|
|
||
| # 3. Dispatch to run or meta commands | ||
| appenv = AppEnv(base, original_cwd) | ||
| if application_name == "appenv": | ||
| appenv.meta(remaining) | ||
| else: | ||
| appenv.run(application_name, remaining) | ||
| ``` |
Member
There was a problem hiding this comment.
I don't think this is very useful here. It will get out of date.
Member
There was a problem hiding this comment.
I don't understand this file apart from being an AI code generation artefact.
- Renamed create_updated → with_project_section - Added _convert_version_preference helper for version list→specifier conversion - create_pyproject factory now takes single python_version instead of python_versions list - Updated tests to match refactored behavior
- Add capsys to test_run_with_profiling_enabled signature (used in body) - Remove unused patterns fixture from test_run_with_profiling_custom_output
…re ensure_* functions
…te bugs - restore 12 pattern tests deleted in commit f2193b6 - fix show_settings() to show all 7 env vars (not 3) - fix main() to call meta([]) when no args (shows help) - fix migrate() to return instead of sys.exit() - add new test_update_lockfile.py with 12 tests
- Replace magic values with named constants (MAX_HELP_TEXT_LENGTH, VERSION_PARTS_COUNT) - Convert boolean positional args to keyword-only (UvBin.cmd, AppEnv._uv_sync) - Rename LockFile._read_lockfile_lines to read_lockfile_lines (public API) - Fix timezone-naive datetime in setup_logging (use timezone.utc) - Suppress SLF001 for necessary argparse private internals - Remove unused UvVersion.__str__ from type stub
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.
No description provided.