Skip to content

build(deps): migrate to hatchling, enforce strict typing, and optimize config#72

Merged
JacksonFergusonDev merged 6 commits intomainfrom
pyproject
Feb 17, 2026
Merged

build(deps): migrate to hatchling, enforce strict typing, and optimize config#72
JacksonFergusonDev merged 6 commits intomainfrom
pyproject

Conversation

@JacksonFergusonDev
Copy link
Copy Markdown
Owner

Summary

This PR overhauls the build system and developer tooling to improve reliability and code quality. It migrates the build backend to Hatchling, enforces strict Mypy type checking, and prevents repository bloat via .gitattributes.

Key Changes

🛠 Build & Configuration

  • Build System: Migrated from legacy setuptools (implicit) to Hatchling.
  • Git Attributes: Added .gitattributes to treat PDFs (*.pdf) and uv.lock as binary files, preventing corrupted text diffs and merge conflicts.
  • Dependencies: Synced requirements.txt with uv.lock to ensure Streamlit Cloud deployments match the local dev environment.

🛡 Code Quality & Linting

  • Mypy (Strict Mode): Enabled check_untyped_defs = true globally.
    • Note: Added overrides to relax strictness for tests/* and app.py (UI layer).
    • Added tests/__init__.py to resolve namespace package discovery issues.
  • Ruff Rules: Enabled additional rule sets:
    • T20 (No print statements in core lib).
    • PT (Pytest style best practices).
    • C4 (List/Set comprehension optimizations).

🧹 Refactoring

  • Type Safety: Updated src/bom_lib and src/exporters.py to fix type narrowing errors found by the new Mypy rules.
  • Performance: Refactored app.py and presets.py to remove redundant list() calls inside sorted() (Ruff C414/C401).
  • Tools: Exempted tools/ scripts from the "no print" rule to allow CLI output.

Testing

  • Running uv run mypy . now passes with zero errors.
  • Running uv run ruff check . passes with zero errors.
  • tests/ suite passes successfully.

Migrates build backend to hatchling, enables strict mypy configuration (with overrides for app/tests), and adds stricter ruff rules (T20, PT, C4). Adds tests/__init__.py to fix namespace package issues.
Updates codebase to pass strict mypy checks. Fixes implicit string casting in preset generation and parser tests, and ensures type safety in core library modules.
Resolves Ruff C414 and C401 errors by removing unnecessary list() calls within sorted() and converting generator expressions to set comprehensions.
Updates deployment dependencies to match the latest lockfile versions. Generated via uv export to ensure Streamlit environment matches local dev environment.
Configures git to treat PDFs and lockfiles as binary to prevent textual diff corruption. Enforces LF line endings for text files to ensure cross-platform consistency.
@JacksonFergusonDev JacksonFergusonDev merged commit 5586995 into main Feb 17, 2026
1 check passed
@JacksonFergusonDev JacksonFergusonDev deleted the pyproject branch February 17, 2026 21:41
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