chore(python): support uv dependency management in cgraph#544
Merged
ChunelFeng merged 7 commits intoChunelFeng:mainfrom Sep 12, 2025
Merged
chore(python): support uv dependency management in cgraph#544ChunelFeng merged 7 commits intoChunelFeng:mainfrom
ChunelFeng merged 7 commits intoChunelFeng:mainfrom
Conversation
Owner
|
can u show the result in your branch? Or give a example how to install PyCGraph in linux with this? |
Contributor
Author
|
Of course, I have tested on my machine (ubuntu 24). Test on mac & windows is necessary. I will introduce the example in the following section. uv init example-graph # init a new virtual environment
cd example-graph
uv add "pycgraph @ git+https://github.com/ChunelFeng/CGraph.git@main#subdirectory=python" --marker "sys_platform == 'linux'" # use this commond to add pycgraph as a dependency, and we can replace the repo url and branch configuration if this pr is merged
uv sync
then, we edit the main.py generated by uv from PyCGraph import GPipeline, GNode, CStatus
class HelloCGraphNode(GNode):
def run(self):
print("Hello, PyCGraph.")
return CStatus()
def tutorial_hello_cgraph():
pipeline = GPipeline()
pipeline.registerGElement(HelloCGraphNode())
pipeline.process()
if __name__ == '__main__':
tutorial_hello_cgraph()At last, we run the main.py scripts to test basic functionality |
Owner
|
thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
How to integrate CGraph with uv
Add the following command inn your pyproject.toml file (configuration file in uv ecosystem) under [tool.uv.sources] section
With this configuration, uv will download the source from GitHub on linuxOS, and fall back to PyPI on all other platforms.
After declaring the target source of pycgraph, you need declare the pycgraph as a dependency of your project.