Major Refactor and release on PyPi: Modularization into crates #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After all improvements and features, I'm proud to release V3.0.0.
This PR concludes a 1 week dev sprint on code2prompt and introduces Four major modifications
Right now, you can install it in your python environnement using:
Description of crates
The separation into crates will improve maintainability, performance, and ease of contribution for code2prompt community. The structure is inspired from the polars repository which has a similar use-case: a Rust lib with a python package.
Overview
code2prompt
: The CLI version hosted on Crates.io by @mufeedvhcode2prompt-core
: The core functionalities of code2prompt hosted on Crates.io by @ODAnconacode2prompt-python
: The python bindings for code2prompt hosted on Pypi by @ODAnconaCode2prompt
This crate contains the CLI logic and depends on
code2prompt-core
and has integration tests. The name was kept as is in order to keep the current behavior: thecode2prompt
crate is the CLI.Code2prompt-core
This crate is the base logic of code ingestion and include:
This is the place to develop prompt-compression techniques, LSP or MCP.
Code2prompt-python
This crate contains the bindings for python. Rye was used to handle packaging and python environment with rust natively and seamlessly.
Pypi Release:
The name code2prompt was already taken by this repo. Therefore I came up with code2prompt_rs to differentiate it. Both tools have similar functionalities, the former is written in python and the latter is written in rust. The former propose features that are not available "yet" in the latter.
These are:
I concluded that it was better to publish it as another name rather than request the former community to join efforts.
I strongly believe code2prompt is a great choice for agentic AI as it's natively fast 🦀
I cannot thanks enough @mufeedvh to have started this project back in march 2024
I’m eager to discuss these improvements further and welcome any suggestions to align our visions for the future of Code2prompt.
It was a thrilling experience to develop this, and I'm all hears for what's next !