-
-
Notifications
You must be signed in to change notification settings - Fork 99
expose public regulated data types as a python package #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Please see my comment inquiring if it's possible to strap down the setup.py
setup.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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