Skip to content

Conversation

@engdoreis
Copy link
Collaborator

@engdoreis engdoreis commented Aug 6, 2025

After published it can be used as a peakrdl pluggin:

Using as a Peakrdl pluggin

Installing

pip install peakrdl rdl2ot

Running

mkdir -p /tmp/lc_ctrl
peakrdl rdl2ot tests/snapshots/lc_ctrl.rdl -o /tmp/lc_ctrl/

@engdoreis engdoreis requested a review from machshev August 6, 2025 11:05
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line shouldn't be required, as the entry point script will automatically be created.

Suggested change
#!/usr/bin/env python3

Same goes for the cli.py which I didn't notice before.

from pathlib import Path
from typing import TYPE_CHECKING

from peakrdl.plugins.exporter import ExporterSubcommandPlugin # pylint: disable=import-error
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What import error is being disabled here? peakrdl is a package dependency so this import should be valid if it's correct?

Also this is a pylint specific disable, isn't the project now using ruff? So if you need to disable a lint there is an equivalent ruff disable. If this is just to keep your LSP happy, then maybe consider disabling pylint and just using rufls instead. Trying to use both could confuse the LSP setup?

Issues = "https://github.com/lowrisc/benevisrdl/issues"
Documentation = "https://github.com/lowrisc/benevisrdl"

[project.entry-points."peakrdl.exporters"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I learnt something new today... https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins

Didn't realise such a neat mechanism for plugin discovery was available. In the past I've only used entry-points for scripts.

@engdoreis engdoreis merged commit 9f4b277 into main Aug 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants