feat: add pyproject.toml for Python packaging and dependency management#205
Open
t0kubetsu wants to merge 4 commits into
Open
feat: add pyproject.toml for Python packaging and dependency management#205t0kubetsu wants to merge 4 commits into
t0kubetsu wants to merge 4 commits into
Conversation
Introduces standards-compliant packaging and developer tooling: - pyproject.toml (PEP 517/518/621): declares metadata, runtime deps (pyelftools, requests), optional [scripts] extra for capstone, entry-point `blutter = "blutter:cli"`, and tool config for ruff, mypy, and pytest. - blutter.py: extract argparse block into cli() so the installed console-script entry point works correctly. - .pre-commit-config.yaml: ruff (lint + format) and mypy hooks. - requirements.txt: thin `-e .[dev]` wrapper for CI / editable installs. - README.md: add Development Setup section (install, hooks, lint, test). - extract_dart_info.py: remove trailing whitespace on import line.
- Drop .pre-commit-config.yaml (out of scope for this PR) - Remove Development Setup section from README; replace with a short note that `pip install .` installs the Python dependencies - Drop pre-commit from [project.optional-dependencies.dev]
pyproject.toml: - setuptools>=82.0 (was >=68), drop redundant wheel build dep - requires-python >=3.10 (3.8 & 3.9 are EOL); drop 3.8/3.9 classifiers, add 3.13 - Fix MacOS classifier: "Operating System :: MacOS :: MacOS X" - Runtime: pyelftools>=0.32, requests>=2.34 - Dev: ruff>=0.15, mypy>=2.1, pytest>=9.0, pytest-cov>=7.1, types-requests>=2.33 - Scripts: capstone>=5.0 (was 4.0; v5 is now stable with pre-built wheels) - Align ruff target-version and mypy python_version to py310 - Drop strict_optional (mypy default since 0.600, noise in 2.x) - Drop --cov from pytest addopts (pytest-cov is [dev]-only; avoids bare pytest failure) - quote-style = "double" to match existing codebase blutter.py / extract_dart_info.py / dartvm_fetch_build.py: - except KeyError: (was bare except:, flagged E722) - Remove unused imports (ENUM_E_MACHINE, SymbolTableSection) per F401 - Auto-fix I001 import ordering and W293 blank-line whitespace (ruff --fix)
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.toml(PEP 517/518/621) declaring project metadata, runtime Python dependencies, and developer tooling configblutter.pyinto a propercli()function so the installedblutterconsole-script entry point works correctlyrequirements.txt(-e .[dev]) for CI / editable-install workflowspip install .now installs the Python dependenciesextract_dart_info.pyWhat's in
pyproject.tomlpyelftools>=0.29,requests>=2.28[scripts]extracapstone>=4.0(only needed byscripts/extract_libflutter_functions.py)blutter = "blutter:cli"[dev]extraruff,mypy,pytest,pytest-cov,types-requests[tool.ruff],[tool.mypy],[tool.pytest.ini_options]Test plan
pip install .installs without errors on Linux / macOS / Windowspip install -e .[dev]installs runtime + dev depsblutter --helpworks after installationpython blutter.py <indir> <outdir>continues to work unchanged