Skip to content

UV#61

Open
dpausp wants to merge 72 commits intoflyingcircusio:masterfrom
dpausp:uv
Open

UV#61
dpausp wants to merge 72 commits intoflyingcircusio:masterfrom
dpausp:uv

Conversation

@dpausp
Copy link
Copy Markdown
Member

@dpausp dpausp commented Mar 3, 2026

No description provided.

@zagy zagy self-requested a review March 12, 2026 07:13
Copy link
Copy Markdown
Member

@zagy zagy left a comment

Choose a reason for hiding this comment

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

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 thread docs/dev-guide/architecture.md Outdated
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)
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is very useful here. It will get out of date.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand this file apart from being an AI code generation artefact.

@dpausp dpausp force-pushed the uv branch 3 times, most recently from 9f683b0 to 9f744c2 Compare March 19, 2026 21:29
@dpausp dpausp force-pushed the uv branch 2 times, most recently from 8024e92 to fed46a5 Compare March 26, 2026 09:40
Comment thread docs/dev-guide/contributing.md Outdated
Comment on lines +121 to +128
### PR Checklist

- [ ] Tests pass: `uv run pytest`
- [ ] Linting passes: `uv run ruff check .`
- [ ] Formatting correct: `uv run ruff format --check .`
- [ ] Type checking passes: `uv run ty check .`
- [ ] Documentation updated (if applicable)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't make sense here. If there was a checklist put it into the proper github template.

Comment thread scripts/fix_whitespace.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uhm, is this used anywhere? We usually use pre-commit to achieve this.

Comment thread docs/Makefile Outdated

# You can set these variables from the command line.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this would need to be installed somehow … don't we have UV now?

dpausp added 2 commits April 28, 2026 09:52
Replace setup.py/setup.cfg/pytest.ini/tox.ini/requirements.txt with
pyproject.toml + uv.lock.  Add new CLI commands: migrate, version, uv.
Improve init to merge into existing pyproject.toml and support --path/uvx.

Deprecate 'run' subcommand in favor of uv run and symlink dispatch.
Fix symlink handling: helpful errors when binary not found, warn on
non-symlink .venv, clean up dangling current symlinks after migration.

Add Sphinx documentation with Furo theme, MyST parser, and autoapi:
user guide (commands, installation, workflows), developer guide
(architecture, contributing), and .readthedocs.yaml.

Restructure test suite with pytest markers (unit/integration/slow),
new test modules (test_main, test_migrate, test_uv_bin, test_cli,
test_subprocess), and .pyi type stubs for all test modules.

Consolidate CI workflows (lint.yml into main.yml), remove bootstrap
scripts, update example from requirements.txt to pyproject.toml.

Quality audit: ruff green, ty green, tests green, e2e orange (B+ 87/100).
Devloper and others added 12 commits April 28, 2026 13:50
migrate now replaces ./appenv when the running version differs from
the on-disk version, keeping projects in sync. Prints old -> new
version on update. init retains existing behavior (no overwrite).
init now prints a warning when ./appenv exists with a different
version than the running appenv, suggesting migrate to update.
Refactored _ensure_appenv_script: update=True replaces, update=False
warns on version mismatch. Added docs and test.
targets.wheel.packages = ['src'] conflicted with sources = ['src'],
causing uv tool install to produce a broken wheel where the appenv
module was not importable at top level.
Scripts without __version__ are definitively older than the running
appenv. migrate now replaces them (shows 'unknown -> X.Y.Z'), init
warns about them. Previously these were silently skipped.
Logs local vs running version and skip/update/warn decision when
APPENV_VERBOSE is set.
…E501

- Remove type annotations from _extract_version, _uv_sync (kept in .pyi stub)
- Use cast() for extras variable to satisfy ty without runtime annotation
- Fix E501 line-too-long in test_migrate.py by splitting f-string
- Fix hatch build config for single-file module (targets.wheel.packages)
Six decisions: duplicate-logging fix, stale-venv recreate,
ensure-best-python logging, error message improvement,
gitignore setup, TDD test strategy.
- fix(logging): clear handlers in setup_logging to prevent duplicates
- feat(venv): add stale-venv Python version compatibility check
- feat(logging): add debug logging to ensure_best_python version selection
- fix(error): restructure no-Python-found error message with constraint label
- feat(gitignore): add ensure_gitignore function, call from init/migrate
- test: add 16 spec validation tests in tests/impl_spec/

Plus docs updates and test assertion fixes for new error format.
Devloper added 4 commits May 7, 2026 23:01
Two jobs exercising the pip fallback:
- debian-bookworm: ensurepip disabled, pip via python3-pip package
- ubuntu-no-uv: uv removed from PATH, tests -m pip path
No test framework, no pip install pytest — just drop appenv on a fresh
system and run it:

- debian-bookworm-pip: python3 + python3-pip, tests which(pip) fallback
- debian-bookworm-minimal: bare python3 only, expected to fail (shows
  the gap for uv installer fallback)
- ubuntu-uvx: uv pre-installed, happy path via PATH discovery
- debian-bookworm-pip: python3 + python3-pip, update-lockfile, ./http --version
- debian-bookworm-minimal: bare python3 only, expected to fail
- ubuntu-uvx: just uvx appenv init, nothing else
- Fix requires-python from 3.9 to 3.10 (minimum supported)
- Pipe interactive answers to uvx appenv init for non-interactive CI
dpausp and others added 25 commits May 8, 2026 00:05
- _try_uv_from_nix_flake: add shutil.which('nix') guard before
  subprocess.run — same pattern as _try_uv_from_nix_channel
- Replace ubuntu-uvx job (uvx doesn't work, no entry points) with
  ubuntu-uv: uv in PATH + appenv from source, test ./http --version
ubuntu-uvx: uvx --from git+https://github.com/flyingcircusio/appenv@<branch>
appenv init — tests the 'user has only uv' bootstrap scenario
init falls back to command_name as dependency when list is empty —
'http' is a stdlib-shadowing package, not httpie.
_try_uv_from_installer: downloads uv via curl/wget with
UV_UNMANAGED_INSTALL to .appenv/.uv/bin — no system modification.

debian-bookworm-minimal: only python3, no pip — tests the installer
fallback on a truly bare system.
stdlib only — no external tools needed. Works on truly minimal systems
where even curl is missing.
- Rename test job to build, add --python and TOXENV like batou
- Add workflow_dispatch trigger
- Mock shutil.which('nix') in nix_flake tests (guard added earlier)
Instead of running the astral.sh install.sh script (which needs curl),
download the uv tarball directly via urllib and extract with tarfile.
All stdlib, no external tools needed — works on truly bare systems.

Platform detection maps machine+os to UV release triples.
Skips Alpine (musl) detection via /etc/alpine-release.
urllib needs CA certs to download from GitHub releases.
Like batou: pre-commit handles all linting (ruff-check, ruff-format,
ty-check as local hook). No more tox -e fix or separate lint job.
tox env_list uses pre-commit instead of fix as dependency.
Alpine tests linux-musl platform triple for astral.sh installer.
macOS-14 tests aarch64-apple-darwin on native Apple Silicon.
Every job now sets APPENV_VERBOSE=1 and prints appenv version +
python version during bootstrap for better CI visibility.
Spec for aligning user docs, dev docs, and E2E tests:
- Adapt debian-bookworm-pip to use ./appenv init via printf pipe
- Add debian-bullseye-39 E2E job for Python 3.9 minimum
- Update installation.md and architecture.md for 6-step discovery chain
- Add platform detection documentation to architecture.md
Adapt debian-bookworm-pip job to printf-pipe init, add
debian-bullseye-39 job for Python 3.9 minimum version testing.
Update installation.md with auto-download phrasing and
architecture.md with 6-step discovery chain and Platform
Detection table. Add 9 spec validation tests (all passing).
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