{"id":51545303,"url":"https://github.com/mypyc/ast_serialize","last_synced_at":"2026-07-09T17:31:43.663Z","repository":{"id":339189642,"uuid":"1148220413","full_name":"mypyc/ast_serialize","owner":"mypyc","description":"Fast Python parser that generates a serialized AST","archived":false,"fork":false,"pushed_at":"2026-06-30T19:56:39.000Z","size":333,"stargazers_count":9,"open_issues_count":7,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-07-06T23:43:00.876Z","etag":null,"topics":["ast","mypy","parser","python"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mypyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-02T18:04:25.000Z","updated_at":"2026-06-30T19:48:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mypyc/ast_serialize","commit_stats":null,"previous_names":["mypyc/ast_serialize"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mypyc/ast_serialize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mypyc%2Fast_serialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mypyc%2Fast_serialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mypyc%2Fast_serialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mypyc%2Fast_serialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mypyc","download_url":"https://codeload.github.com/mypyc/ast_serialize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mypyc%2Fast_serialize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35307337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","mypy","parser","python"],"created_at":"2026-07-09T17:31:43.517Z","updated_at":"2026-07-09T17:31:43.651Z","avatar_url":"https://github.com/mypyc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ast_serialize - Python Parser and AST Serializer\n\nThis is a fast Python extension for parsing Python files and serializing the AST using \nthe native binary format used by mypy. This will eventually replace the current mypy parser,\nwhich uses the Python stdlib `ast` module for parsing.\n\n**This is work in progress.**\n\n## Development\n\nPrerequisites:\n\n- Recent Rust toolchain\n- Python 3.10+ (3.13t or 3.14t for free-threaded builds)\n- [maturin](https://github.com/PyO3/maturin): `pip install maturin`\n- Checkout of [mypy repo](https://github.com/python/mypy) for testing\n\nDevelopment build (fast compilation, unoptimized):\n```bash\nmaturin develop\n```\n\nOptimized development build:\n```bash\nmaturin develop --release\n```\n\n## Testing\n\n**Rust unit tests:**\n```bash\ncargo test\n```\n\n**Python integration tests:** \nRun end-to-end parser and serialization/deserialization tests using mypy's test suite in \nthe new-parser branch:\n```bash\ncd ~/src/mypy  [or wherever you have mypy]\npytest mypy -k NativeParser\n```\n\nAdd new test cases to `test-data/unit/native-parser.test` (in the mypy repository). See\nthe main parser test cases in `parse.test` for the expected output format.\n\n**Note:** Run `maturin develop` before testing if you've modified Rust code.\n\nUse `TEST_NATIVE_PARSER=1 pytest mypy/test/testcheck.py` to run mypy type checking \ntests using ast_serialize. Note that some tests are still skipped.\n\n## Creating PRs\n\nYou can create PRs in this repository, and/or in mypy repo. \nContributions are welcome! Run mypy tests (see above) to get ideas about bugs and missing \nfunctionality. If your contributions needs changes in both mypy and ast_serialize, please\nmention this in the PR summary.\n\n## Building Wheels\n\n```bash\n# Build all wheels (stable ABI + free-threaded)\n./build_wheels.sh\n\n# Or manually:\n# Stable ABI wheel (Python 3.9+)\nmaturin build --release\n\n# Free-threaded wheel (Python 3.13t)\nmaturin build --release --no-default-features --features free-threaded --interpreter python3.13t\n```\n\nIf you see `Python 3.13t not found`, you'll need to install the free-threaded build of CPython 3.13\nin PATH.\n\n## Making a release\n\n1. Bump the version number in `pyproject.toml` and `Cargo.toml` in this repository.\n2. Update `test_ast_serialize.py` (optional but recommended if the release includes major features).\n3. Commit and push (pushing directly to master is fine).\n4. Wait until all [builds](https://github.com/mypyc/ast_serialize/actions) complete successfully\n   (no release is triggered yet).\n5. Once builds are complete, tag the release (`git tag vX.Y.Z`; `git push origin vX.Y.Z`).\n6. Go to the [\"Actions\" tab](https://github.com/mypyc/ast_serialize/actions) and click \"Build wheels\"\n   on the left.\n7. Click \"Run workflow\" and pick the newly created tag from the drop-down list. This will build\n   *and upload* the wheels.\n8. After the workflow completes, verify that `pip install -U ast-serialize` installs the new version\n   from PyPI using a compiled wheel.\n9. Create a PR to update the `ast-serialize` version in `pyproject.toml` in the mypy repository.\n\nThe process should take about 15 minutes.\n\n## Using Coding Agents\n\nThis project is designed to support coding agent assisted development (such as Claude Code, Codex\nor OpenCode). Notes:\n * Ensure your coding agent has access to AGENTS.md (e.g. create a CLAUDE.md symbolic link).\n * For the best experience, clone this repository as `~/src/ast_serialize`, and clone mypy\n   (with the new-parser branch checked out) as `~/src/mypy`.\n * Have your mypy virtualenv active when starting the coding agent, or place the virtualenv\n   at `~/venv/mypy` (this is referred to in AGENTS.md).\n\n## Acknowledgments\n\nThis is a wrapper around the [Ruff](https://github.com/astral-sh/ruff) parser. Credits to Ruff \nmaintainers for developing a fast Python parser!\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmypyc%2Fast_serialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmypyc%2Fast_serialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmypyc%2Fast_serialize/lists"}