Skip to content

chore(python): normalize runtime exports and enforce Ruff checks - #5090

Merged
dbrattli merged 5 commits into
mainfrom
chore/python-ruff-imports
Oct 15, 2026
Merged

dbrattli merged 5 commits into
mainfrom
chore/python-ruff-imports

Conversation

@dbrattli

@dbrattli dbrattli commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Add Ruff import-sorting (I), export-sorting (RUF022), duplicate-export (RUF068), and formatting checks for src/fable-library-py to the existing verify-linting CI job. The checks run without modifying files and fail the job when sources need cleanup, using the repository's frozen uv dependencies.

Apply the existing import-layout fixes, sort the __all__ lists in util.py and array_.py, and remove duplicate exports from time_span.py, char.py, and long.py so the library starts with a clean baseline.

Add explicit __all__ lists to the 12 public runtime modules that lacked them, including reflection.py and uri.py. The lists cover each module's public definitions and type aliases. Wildcard imports from these modules now expose those APIs rather than also importing their implementation dependencies; consumers needing those dependencies should import them explicitly. Named imports remain available. The private _version.py module is unchanged.

@dbrattli dbrattli changed the title ci(python): gate library formatting and import sorting ci(python): gate library formatting and import/export sorting Oct 15, 2026
@dbrattli dbrattli changed the title ci(python): gate library formatting and import/export sorting ci(python): gate library formatting, imports, and exports Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Python Type Checking Results (Pyright)

Metric Value
Total errors 34
Files with errors 4
Excluded files 4
New errors ✅ No
Excluded files with errors (4 files)

These files have known type errors and are excluded from CI. Remove from pyrightconfig.ci.json as errors are fixed.

File Errors Status
temp/tests/Python/test_hash_set.py 18 Excluded
temp/tests/Python/test_applicative.py 12 Excluded
temp/tests/Python/test_nested_and_recursive_pattern.py 2 Excluded
temp/tests/Python/fable_modules/thoth_json_python/encode.py 2 Excluded

@dbrattli
dbrattli marked this pull request as ready for review October 15, 2026 22:19
@dbrattli dbrattli changed the title ci(python): gate library formatting, imports, and exports chore(python): normalize runtime exports and enforce Ruff checks Oct 15, 2026
@dbrattli
dbrattli merged commit ec39675 into main Oct 15, 2026
44 checks passed
@dbrattli
dbrattli deleted the chore/python-ruff-imports branch October 15, 2026 22:33
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