expose public regulated data types as a python package#148
expose public regulated data types as a python package#148ot-goegelem wants to merge 3 commits intoOpenCyphal:masterfrom
Conversation
pavel-kirienko
left a comment
There was a problem hiding this comment.
Thanks! Please see my comment inquiring if it's possible to strap down the setup.py
There was a problem hiding this comment.
Is the following not a valid replacement?
import setuptools
import distutils.command.build_py
from pathlib import Path
class BuildPy(distutils.command.build_py.build_py):
def run(self):
import pycyphal
output_dir = Path(self.build_lib, self.pkg_name, ".demo_dsdl_compiled")
cur_path = pathlib.Path(__file__).parent
pycyphal.dsdl.compile_all(
[
cur_path / "uavcan",
cur_path / "reg",
],
output_directory=output_dir,
)
super().run()
setuptools.setup(cmdclass={"build_py": BuildPy})Co-authored-by: Pavel Kirienko <pavel.kirienko@gmail.com>
pavel-kirienko
left a comment
There was a problem hiding this comment.
Thank you. I think the use case is very valid but I don't want to add Python-specific things to this repository because that will become cumbersome to maintain. We should create a new repository instead that is solely dedicated to republishing DSDL definitions as a Python package. There could be similar packages published for other languages. That repository could simply automatically reupload releases every week or so, running as a cron CI job.
If I created a new repo, would you be able to move your changes there? Can you also help us set up the CD pipeline for automatic publication?
@thirtytwobits @emrainey any objections?
|
I would rather not do it periodically via a cron job. I did a quick research and it is possible to inject build settings ( |
|
As long as the default behavior is to install the latest master, I'm good with that. I suppose |
|
Sounds like a plan 🤗 |
|
okay let's give Scott and/or Erik some time to think about it as well |
|
I like it. |
|
Okay I created the new repo here: https://github.com/OpenCyphal-Garage/public_regulated_data_types_pypi We will roll it out of the garage once it's ready. @ot-goegelem can you please send a PR there? If you could set up a nice readme in the process that would help! Thanks! |
|
@ot-goegelem I added a repository secret called |
|
Sorry all. Was a bit absent recently. Looking at this but it sounds like were' thinking about the right thing. As long as we're always adding optional features that don't increase required dependencies by the python package then I'm going to be included to approve. |
|
Hey @ot-goegelem is there interest in continuing? |
|
Hey, sorry for not following up. |
Problem
I want to write a small tool that uses pycyphal and the public regulated data types.
But is quite annoying that it is not possible to just add/install the public regulated data types as a dependency.
I understand that this is a deliberate decision to make it possible to add custom data types, but my tool does not rely on custom data types and I want to being able to have one setup with all dependencies without needing some custom setup from the end user.
Solution
It is then possible to use this dependency by just specifying the git repository