Skip to content

feat: add pyproject.toml for Python packaging and dependency management#205

Open
t0kubetsu wants to merge 4 commits into
worawit:mainfrom
t0kubetsu:feat/add-pyproject-toml
Open

feat: add pyproject.toml for Python packaging and dependency management#205
t0kubetsu wants to merge 4 commits into
worawit:mainfrom
t0kubetsu:feat/add-pyproject-toml

Conversation

@t0kubetsu

Copy link
Copy Markdown

Summary

  • Adds a pyproject.toml (PEP 517/518/621) declaring project metadata, runtime Python dependencies, and developer tooling config
  • Extracts the argparse block in blutter.py into a proper cli() function so the installed blutter console-script entry point works correctly
  • Adds requirements.txt (-e .[dev]) for CI / editable-install workflows
  • Updates README with a one-line note that pip install . now installs the Python dependencies
  • Fixes a trailing whitespace lint warning in extract_dart_info.py

What's in pyproject.toml

Section Detail
Runtime deps pyelftools>=0.29, requests>=2.28
[scripts] extra capstone>=4.0 (only needed by scripts/extract_libflutter_functions.py)
Entry point blutter = "blutter:cli"
[dev] extra ruff, mypy, pytest, pytest-cov, types-requests
Tool config [tool.ruff], [tool.mypy], [tool.pytest.ini_options]

Note: blutter.py resolves scripts/ via SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)). Use pip install -e . (editable) so __file__ stays anchored to the source tree.

Test plan

  • pip install . installs without errors on Linux / macOS / Windows
  • pip install -e .[dev] installs runtime + dev deps
  • blutter --help works after installation
  • python blutter.py <indir> <outdir> continues to work unchanged

t0kubetsu added 4 commits May 12, 2026 15:22
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)
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.

1 participant