chore: add uv workspace and replace black with ruff#1718
Open
korbonits wants to merge 1 commit intomicrosoft:mainfrom
Open
chore: add uv workspace and replace black with ruff#1718korbonits wants to merge 1 commit intomicrosoft:mainfrom
korbonits wants to merge 1 commit intomicrosoft:mainfrom
Conversation
- Add root pyproject.toml with uv workspace covering all four packages - Add [tool.uv.sources] to markitdown-mcp, markitdown-ocr, and markitdown-sample-plugin so they resolve markitdown from the workspace - Replace psf/black pre-commit hook with astral-sh/ruff-pre-commit (ruff lint + ruff format) - Update CI workflows: drop hatch/setup-python in favour of astral-sh/setup-uv and uv run; add matrix strategy for 3.10-3.12 - Add ruff config to root pyproject.toml (E/W/F/I/UP/B/C4/SIM rules) - Run ruff --fix + ruff format across all packages (208 auto-fixes, 22 files reformatted) - Manually fix all 49 remaining lint errors: - SIM103: collapse redundant if/return True/return False → return expr - SIM102: merge nested if statements - SIM105: try/except/pass → contextlib.suppress() - SIM108: if/else block → ternary - SIM113: manual index counters → enumerate() - SIM118: dict.keys() iteration → direct dict iteration - SIM210/211: True if x else False → bool(x) / not x - B006: mutable default argument in DocumentIntelligenceConverter - B007: unused loop vars renamed to _ - B023: loop-variable capture in nested def fixed via default arg - B028: add stacklevel= to all warnings.warn() calls - B905: add strict=False to zip() calls - C408/C416: dict()/list() literals and unnecessary comprehensions - F601: remove duplicate "\u2192" key from latex_dict.py - UP031: % formatting → f-strings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Alex Korbonits <alex@korbonits.com>
Author
|
@microsoft-github-policy-service agree |
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.
Summary
pyproject.tomldeclaring all four packages (markitdown,markitdown-mcp,markitdown-ocr,markitdown-sample-plugin) as workspace members, with[tool.uv.sources]wiring inter-package deps to the workspace instead of PyPI. Generatesuv.lockfor reproducible installs.psf/black(pinned at 23.7.0) in.pre-commit-config.yamlforastral-sh/ruff-pre-commit, covering both lint (ruff check --fix) and formatting (ruff format). Ruff is ~10-100× faster and handles both roles in one tool.tests.ymlandpre-commit.ymluseastral-sh/setup-uvinstead ofactions/setup-python+pipx install hatch; test job gains a propermatrixover Python 3.10–3.12.ruff checkandruff format --checkboth pass with zero errors.Test plan
uv sync --all-packagesinstalls the full workspace cleanlyuv run ruff check packages/→ 0 errorsuv run ruff format packages/ --check→ 0 files would changeuvx pre-commit run --all-filespassesuv run pytest packages/markitdown/tests🤖 Generated with Claude Code