More than a year after starting this project I can finally present a working version.
I started with a LibCST PoC which was very slow and migrated to rust soon after that. Then I did the mistake to use the abandonded rustpython-parser AST implementation instead the ruff implementation.
So I did a lot of refactoring, testing and experimenting to get to this version which is able to bundle and treeshake... flay itself. So now it is time for me to test this with other projects.
There is still a lot todo. I think there can still be done a lot performance-wise and currently not a lot of code is stripped away because of the many edge cases and hacks in python's ecosystem which make it hard to determine if code is actually used or not. Stay tuned!
What's Changed
- refactor(treeshake): extract string reference check from is_reference… by @jvllmr in #4
- chore(ci): limit push actions to dev branch and implement simple bund… by @jvllmr in #6
- fix: solve snyk issues and add obligatory cli tests by @jvllmr in #9
- fix(deps): update all non-major dependencies by @renovate[bot] in #5
- chore(tests): add test for bundling c extension by @jvllmr in #10
- fix(treeshake): star import handling and increased coverage by @jvllmr in #11
- chore(tests): coverage to 100% by @jvllmr in #12
- chore(deps): update dependency ruff to >=0.8.3 by @renovate[bot] in #14
- perf(bundle): improve bundle performance with refactors and rust by @jvllmr in #13
- chore(deps): update actions/attest-build-provenance action to v2 by @renovate[bot] in #16
- chore(deps): update all non-major dependencies by @renovate[bot] in #15
- chore(deps): update all non-major dependencies by @renovate[bot] in #17
- chore(deps): update dependency maturin to v1.8.0 by @renovate[bot] in #18
- chore(deps): lock file maintenance by @renovate[bot] in #19
- chore(deps): update all non-major dependencies by @renovate[bot] in #20
- perf(bundle): implement imports transformer in rust by @jvllmr in #21
- chore: new ruff rules by @jvllmr in #22
- fix(deps): update all non-major dependencies by @renovate[bot] in #24
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #2
- perf(treeshake): implement ReferencesCounter in rust by @jvllmr in #23
- fix(deps): update all non-major dependencies by @renovate[bot] in #25
- fix(deps): update rust crate rustpython-unparser to 0.1.4 by @renovate[bot] in #27
- perf(treeshake): implement nodes remover in rust by @jvllmr in #26
- fix(bundle,treeshake): stabilize output + some refactors by @jvllmr in #29
- chore: move transformer trait to rustpython-unparser by @jvllmr in #30
- fix(bundle): improve handling of rel imports w/ modules as value by @jvllmr in #31
- perf(treeshake): goodbye libcst by @jvllmr in #32
- chore(deps): update all non-major dependencies by @renovate[bot] in #34
- chore(deps): update dependency pip to v25 by @renovate[bot] in #35
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #28
- refactor(bundle): new transformer for imports transformer by @jvllmr in #36
- fix(bundle): full recursion on attribute visit by @jvllmr in #37
- feat(ci): add zizmor to pre-commit config by @jvllmr in #38
- fix(treeshake): make re-exports work by @jvllmr in #39
- fix(bundle): transform annotation literals by @jvllmr in #40
- fix(treeshake): default arg values are visited by @jvllmr in #41
- fix(treeshake): remove forgotten println that was there for debugging by @jvllmr in #42
- chore(deps): update dependency nox to v2025 by @renovate[bot] in #44
- chore(deps): update all non-major dependencies by @renovate[bot] in #43
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #45
- fix(deps): update all non-major dependencies by @renovate[bot] in #47
- fix(deps): update all non-major dependencies by @renovate[bot] in #49
- chore(deps): lock file maintenance by @renovate[bot] in #48
- successfully run pre-commit validate-config with bundled pre-commit by @jvllmr in #50
- chore: make compatible with python 3.9 by @jvllmr in #51
- fix(cli): use pydantic-settings instead of typer for CLI parsing by @jvllmr in #52
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #46
- chore(deps): update dependency setuptools to v76 by @renovate[bot] in #54
- fix(deps): upgrade pyo3 to 0.24.0 by @jvllmr in #57
- fix(deps): upgrade rustpython-unparser to 0.2.4 by @jvllmr in #58
- chore(deps): update dependency ruff to >=0.9.10 by @renovate[bot] in #53
- chore: use rust 2024 edition by @jvllmr in #56
- chore: use pre-commit cargo-fmt again by @jvllmr in #59
- chore(deps): update all non-major dependencies by @renovate[bot] in #60
- chore(deps): update dependency types-setuptools to v76 by @renovate[bot] in #61
- fix(deps): update all non-major dependencies by @renovate[bot] in #62
- fix(deps): update all non-major dependencies by @renovate[bot] in #64
- chore(deps): lock file maintenance by @renovate[bot] in #66
- fix(deps): update all non-major dependencies by @renovate[bot] in #67
- feat: replace rustpython-parser ast with ruff ast by @jvllmr in #68
- fix(renovate): make renovate manage cargo github dependencies by @jvllmr in #69
- fix(renovate): improve github url regex by @jvllmr in #70
- fix(renovate): use git-tags instead of github-tags by @jvllmr in #71
- fix(deps): update rust crate pyo3 to 0.24.1 by @renovate[bot] in #72
- fix(deps): update all non-major dependencies by @renovate[bot] in #73
- feat(cli): create initial CLI for general usage by @jvllmr in #75
- feat(ci): sync Cargo.lock if Cargo.toml changed by @jvllmr in #76
- fix(ci): only run cargo lock sync if branch is in this repository by @jvllmr in #79
- fix(ci): run cargo vendor before building to avoid too deep paths on by @jvllmr in #80
- fix(ci): use windows-2025 instead of windows-latest by @jvllmr in #83
- fix(ci): create a new pr when syncing Cargo.lock by @jvllmr in #84
- fix(ci): enable git longpaths feature by @jvllmr in #85
- fix(deps): update all non-major dependencies by @renovate[bot] in #78
- fix(ci): use a personal token for creating a PR by @jvllmr in #87
- chore: sync Cargo.lock by @github-actions[bot] in #86
- chore(deps): update dependency setuptools to v80 by @renovate[bot] in #81
- fix(ci): do not use my token to sync Cargo.lock and run sync on schedule by @jvllmr in #88
- feat(renovate): create more fine-grained renovate groups by @jvllmr in #89
- chore(config): migrate renovate config by @renovate[bot] in #91
- chore(deps): pin dependencies by @renovate[bot] in #90
- chore(deps): update pre-commit hooks by @jvllmr in #77
- chore(deps): update dependency types-setuptools to v80 by @renovate[bot] in #93
- fix(renovate): do not update required python version by @jvllmr in #94
- chore(deps): update all python non-major dependencies by @renovate[bot] in #92
- chore(deps): lock file maintenance by @renovate[bot] in #95
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.11.8 by @renovate[bot] in #96
- chore(deps): update all python non-major dependencies by @renovate[bot] in #97
- fix(ci): fix cargo lock sync token permission by @jvllmr in #98
- fix(ci): fix cargo lock sync token perms again by @jvllmr in #99
- fix(ci): remove duplicate pipelines by @jvllmr in #102
- fix(ci): remove complicated cargo sync job by @jvllmr in #103
- chore: sync Cargo.lock by @github-actions[bot] in #101
- chore(config): migrate renovate config by @renovate[bot] in #105
- fix: use click+clonf for cli implementation by @jvllmr in #106
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.11.9 by @renovate[bot] in #108
- chore(deps): update all python non-major dependencies by @renovate[bot] in #107
- chore(deps): lock file maintenance by @renovate[bot] in #109
- fix(cli): logging does not break progress bars by @jvllmr in #110
- feat(treeshake,cli): track how many statements were removed by @jvllmr in #111
- chore(deps): update all python non-major dependencies by @renovate[bot] in #113
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.11.10 by @renovate[bot] in #114
- chore(deps): update rust crate pyo3 to 0.25.0 by @renovate[bot] in #115
- feat(bundle): package resources can be explicitly included in a bundle by @jvllmr in #116
- chore(deps): update all python non-major dependencies by @renovate[bot] in #118
- chore(deps): update codecov/codecov-action digest to 18283e0 by @renovate[bot] in #117
- feat(bundle): bundle metadata per default for all requirements by @jvllmr in #119
- chore: default branch was renamed to main by @jvllmr in #121
- perf(bundle): use ruff_python_stdlib for checking if module is from std lib by @jvllmr in #122
- perf(ci): cache rust dependencies by @jvllmr in #123
- chore(deps): update all python non-major dependencies by @renovate[bot] in #125
- chore(deps): update codecov/test-results-action digest to 47f89e9 by @renovate[bot] in #124
- chore(deps): lock file maintenance by @renovate[bot] in #126
- chore(deps): update all python non-major dependencies by @renovate[bot] in #129
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.11.12 by @renovate[bot] in #128
- chore(deps): lock file maintenance by @renovate[bot] in #130
- feat: add container images by @jvllmr in #127
- chore(renovate): renovate 40.46.0 supports cargo git dependencies by @jvllmr in #131
- fix(treeshake): correctly handle relative module as value imports by @jvllmr in #132
- chore(deps): update dependency python to v3.13.4 by @renovate[bot] in #134
- chore(deps): update all python non-major dependencies by @renovate[bot] in #135
- fix(treeshake): respect pep562 by @jvllmr in #137
- feat: add support for t-strings by @jvllmr in #138
- fix: transformer did not visit function body by @jvllmr in #139
- fix(container): builder py version did not match runner version by @jvllmr in #140
- fix(bundle): bundle maturin .so lib files on musl linux by @jvllmr in #141
- feat(ci): comment container build progress on PR by @jvllmr in #142
- perf(ci): only run build on pull_request if source files changed by @jvllmr in #143
- chore(deps): update all python non-major dependencies by @renovate[bot] in #145
- chore(deps): update dependency python to v3.13.5 by @renovate[bot] in #148
- chore(deps): lock file maintenance by @renovate[bot] in #149
- chore(deps): update all python non-major dependencies by @renovate[bot] in #150
- chore(deps): update rust crate pyo3 to 0.25.1 by @renovate[bot] in #151
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #55
- chore(deps): update pyo3/maturin-action digest to e10f6c4 by @renovate[bot] in #146
- chore(deps): update swatinem/rust-cache digest to 98c8021 - autoclosed by @renovate[bot] in #147
- fix(treeshake): preserve global for-loop and re-order match cases by @jvllmr in #152
- chore(deps): update all python non-major dependencies by @renovate[bot] in #153
- chore(deps): update docker/setup-buildx-action action to v3.11.1 by @renovate[bot] in #154
- chore(deps): update actions/attest-build-provenance digest to e8998f9 by @renovate[bot] in #144
- Revert "chore(renovate): renovate 40.46.0 supports cargo git deps (#131)" by @jvllmr in #155
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.12.3 by @renovate[bot] in #156
- chore: add tests for class bases references by @jvllmr in #157
- refactor: use /opt/flay instead of /app in container by @jvllmr in #158
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #159
- fix(bundle): make bundle results more reproducible by @jvllmr in #160
- fix(treeshake): always preserve names from pydantic dynamic imports by @jvllmr in #161
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.12.4 by @renovate[bot] in #162
- chore(deps): update all python non-major dependencies by @renovate[bot] in #163
- chore(deps): lock file maintenance by @renovate[bot] in #164
- chore(deps): update all python non-major dependencies by @renovate[bot] in #166
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.12.5 by @renovate[bot] in #167
- chore(deps): update all python non-major dependencies by @renovate[bot] in #168
- chore(deps): lock file maintenance by @renovate[bot] in #170
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.12.7 by @renovate[bot] in #169
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #165
- chore(deps): update dependency https://github.com/astral-sh/ruff.git to v0.12.8 by @renovate[bot] in #171
- chore(deps): update dependency python to v3.13.6 by @renovate[bot] in #172
- chore(deps): lock file maintenance by @renovate[bot] in #173
- chore(deps): lock file maintenance by @renovate[bot] in #175
- chore(deps): lock file maintenance by @renovate[bot] in #178
- test(treeshake): add test for calling func on imported module by @jvllmr in #179
- fix(bundle): apply aliases to imports by @jvllmr in #180
- fix(treeshake): avoid duplication of imports by @jvllmr in #181
- fix(treeshake): make the ImportsTrackingProvider more deterministic by @jvllmr in #182
- chore(deps): update codecov/codecov-action digest to fdcc847 by @renovate[bot] in #177
- chore(deps): update actions/checkout digest to 08eba0b by @renovate[bot] in #176
- chore(deps): update dependency python to v3.13.7 by @renovate[bot] in #186
- chore(deps): update docker/metadata-action action to v5.8.0 by @renovate[bot] in #188
- chore(deps): update docker/login-action action to v3.5.0 by @renovate[bot] in #187
- chore(deps): update rust crate pyo3 to 0.26.0 by @renovate[bot] in #189
- chore(deps): update all python non-major dependencies by @renovate[bot] in #194
- chore(deps): lock file maintenance by @renovate[bot] in #195
- chore(deps): update codecov/codecov-action digest to 5a10915 by @renovate[bot] in #193
- chore(deps): update actions/checkout action to v5 by @renovate[bot] in #191
- chore(deps): update actions/attest-build-provenance action to v3 by @renovate[bot] in #190
- chore(deps): update pyo3/maturin-action digest to 86b9d13 by @renovate[bot] in #184
- chore(deps): update actions/download-artifact action to v5 by @renovate[bot] in #192
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #174
- chore(deps): update all python non-major dependencies by @renovate[bot] in #197
- chore(deps): update actions/setup-python action to v6 by @renovate[bot] in #198
- chore(deps): lock file maintenance by @renovate[bot] in #199
- chore(deps): update all python non-major dependencies by @renovate[bot] in #200
- chore(deps): lock file maintenance by @renovate[bot] in #201
- chore(deps): update dependency ruff to >=0.13.2 by @renovate[bot] in #202
- chore(deps): lock file maintenance by @renovate[bot] in #204
- chore(deps): update all python non-major dependencies by @renovate[bot] in #205
- chore(deps): update docker/login-action action to v3.6.0 by @renovate[bot] in #206
- chore(deps): lock file maintenance by @renovate[bot] in #207
- fix(renovate): use renovates integrated cargo-git feature by @jvllmr in #209
- chore(deps): update all rust non-major dependencies to v0.14.0 by @renovate[bot] in #211
- chore: remove deprecated Python::with_gil usage by @jvllmr in #212
- chore(deps): update dependency python to v3.14.0 by @renovate[bot] in #214
- fix(bundle): make sure shared objects are included on alpine by @jvllmr in #215
- feat(bundle,treeshake): initial support for dynamic imports by @jvllmr in #208
- fix(bundle): os.path.sep.join was aliased incorrectly by @jvllmr in #218
- fix: remove forgotten debug print by @jvllmr in #219
- chore(deps): update all rust non-major dependencies by @renovate[bot] in #220
- fix(renovate): don't update dependencies that dropped python 3.9 by @jvllmr in #221
- fix(renovate): don't update pytest-env by @jvllmr in #223
- chore(ci): test on python 3.14 by @jvllmr in #210
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #196
- chore(deps): update clonf to v0.4.1 by @jvllmr in #225
- fix: imports provider did not resolve parent package correctly by @jvllmr in #226
- feat: introduce import aliases mechanic by @jvllmr in #224
- chore(deps): update all python non-major dependencies by @renovate[bot] in #213
- refactor(cli): implement event handler system for dynamic io by @jvllmr in #227
- chore(deps): update all pre-commit dependencies by @renovate[bot] in #228
- chore(deps): update all rust non-major dependencies by @renovate[bot] in #229
- feat(treeshake): don't bump references for safe decorators by @jvllmr in #231
- fix(treeshake): add more safe default decorators and do better detection of built-ins by @jvllmr in #233
- chore(deps): update all pre-commit dependencies by @renovate[bot] in #236
- chore(deps): update all rust non-major dependencies to v0.14.3 by @renovate[bot] in #237
- chore(deps): update all pre-commit dependencies by @renovate[bot] in #239
- chore(deps): update all rust non-major dependencies to v0.14.4 by @renovate[bot] in #240
- chore(deps): update all rust non-major dependencies to v0.14.5 by @renovate[bot] in #241
- chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.14.5 by @renovate[bot] in #242
- chore(deps): update all rust non-major dependencies to v0.14.6 by @renovate[bot] in #244
- chore(deps): update actions/checkout digest to 93cb6ef by @renovate[bot] in #243
- fix(treeshake): typing.final is a safe decorator by @jvllmr in #234
- perf(bundle): remove imports transformation by @jvllmr in #235
- chore: use uv + Makefile instead of pdm by @jvllmr in #246
New Contributors
- @jvllmr made their first contribution in #4
- @renovate[bot] made their first contribution in #5
- @pre-commit-ci[bot] made their first contribution in #2
- @github-actions[bot] made their first contribution in #86
Full Changelog: https://github.com/jvllmr/flay/commits/0.1.0a2