I´m asking if anyone has knowledge about advanced and practicable ways of sharing robot code across multiple repos in a professional development environment.
So how can we get rid of copying *.resource files from one repo to another and trying to get them always up to date?
I´m thinking about do something like ‘pip install common-robot-code’ in a git repository, has anyone solved the problem with pip?
I am open to any ideas and happy to get some answers on this topic.
If the resource file path is absolute, it is used directly. Otherwise, the resource file is first searched relatively to the directory where the importing file is located. If the file is not found there, it is then searched from the directories in Python’s module search path. Searching resource files from the module search path makes it possible to bundle them into Python packages as package data and importing them like package/example.resource.
I dont get your answer and dont know what is different than normal *.resource files. Or do you share this python packages with PIP installation?
My questions is more about the intershareability between commonly used functions and keywords over multiple repos!
You have a resource file, you package the resource for into python package that can be installed with pip so that you don’t have to copy the files to multipe repo’s and just maintain your requirements.txt or pyproject.toml to fetch that package.
Thank you very much!
How does the packaging format of Poetry look like (sdist / whl ?) and can you directly publish the package from your commandline to your PyPi or different tracker?
The *.resource files are included in the distribution that you’re building. This means the folder structure of the package remains the same.
If you install the package locally (developer mode), a reference to the local repo package root is added to the active environment (hopefully a .venv ).
Note that this is no different from how pip handles things. In fact, poetry calls pip to do the actual package retrieval and installation.
It’s a bit more than that. It’s a replacement for a setup.py. It manages environments. It’s a replacement for twine. It has better dependency resolving. It has (much) better dependency locking. It supports multiple dependency groups within a single file. And there’s probably some things I forgot.
pip only manages a very small part of a Python project / workflow. poetry is a one-stop-shop for the entire workflow.