From b5027975d4d197dccfb9701972365e41efc9c69f Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 4 Oct 2025 23:05:45 -0400 Subject: [PATCH 1/2] rdev: provide mechanism to update robotpy entrypoints - See https://github.com/robotpy/robotpy-cli/issues/5 --- devtools/config.py | 3 +++ devtools/update_pyproject.py | 31 +++++++++++++++++++++++++++++++ rdev.toml | 6 ++++++ 3 files changed, 40 insertions(+) diff --git a/devtools/config.py b/devtools/config.py index 905ada3dc..7fb4c2710 100644 --- a/devtools/config.py +++ b/devtools/config.py @@ -24,6 +24,9 @@ class Parameters: wpilib_bin_version: str wpilib_bin_url: str + #: renames [project.entry-points.KEY*] to [project.entry-points.VALUE] + entrypoints: T.Dict[str, str] + exclude_artifacts: T.Set[str] requirements: T.Dict[str, str] diff --git a/devtools/update_pyproject.py b/devtools/update_pyproject.py index ffa5886de..213d0a4d6 100644 --- a/devtools/update_pyproject.py +++ b/devtools/update_pyproject.py @@ -68,6 +68,31 @@ def wpilib_bin_version(self) -> str: def wpilib_bin_url(self) -> str: return self.cfg.params.wpilib_bin_url + def _update_entrypoints( + self, + info: ProjectInfo, + pypi_name: str, + ): + data = info.data + eps = data["project"].get("entry-points") + if eps is None: + return + + for name in list(eps.keys()): + for prefix, replace in self.cfg.params.entrypoints.items(): + if name.startswith(prefix): + if name != replace: + eps[replace] = eps[name] + del eps[name] + print( + f"* {pypi_name}: entry-points.{name} -> entry-points.{replace}" + ) + self.commit_changes.add( + f"{pypi_name}: entry-points.{name} -> entry-points.{replace}" + ) + info.changed = True + break + def _update_requirements( self, info: ProjectInfo, @@ -126,6 +151,12 @@ def update_requirements(self): data["project"]["dependencies"], ) + # project.entry-points + self._update_entrypoints( + info, + pypi_name, + ) + def _update_maven(self, info: ProjectInfo): data = info.data iter = ( diff --git a/rdev.toml b/rdev.toml index bdd399b7b..19cf3954c 100644 --- a/rdev.toml +++ b/rdev.toml @@ -33,6 +33,12 @@ exclude_artifacts = [ robot_wheel_platform = "linux-roborio" +[params.entrypoints] +# prefix = "actual" +# - ensures that [project.entry-points.prefix*] are renamed to "actual", which +# makes it easy to upgrade them each year (https://github.com/robotpy/robotpy-cli/issues/5) +# - also reminds me that we have to bump it every year ^_^ + [params.requirements] semiwrap = "~=0.1.7" hatch-meson = "~=0.1.0b2" From a342c74c95ab8fb13def69fe231ae4162973d76f Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Mon, 6 Oct 2025 21:50:05 -0400 Subject: [PATCH 2/2] Updated dependencies - robotpy-halsim-ds-socket: entry-points.robotpysimext -> entry-points.robotpy_sim.2026 - robotpy-halsim-ws: entry-points.robotpysimext -> entry-points.robotpy_sim.2026 - robotpy-xrp: entry-points.robotpysimext -> entry-points.robotpy_sim.2026 - wpilib: entry-points.robotpy -> entry-points.robotpy_cli.2026 --- rdev.toml | 2 ++ subprojects/robotpy-halsim-ds-socket/pyproject.toml | 2 +- subprojects/robotpy-halsim-ws/pyproject.toml | 2 +- subprojects/robotpy-wpilib/pyproject.toml | 2 +- subprojects/robotpy-xrp/pyproject.toml | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rdev.toml b/rdev.toml index 19cf3954c..8100aef76 100644 --- a/rdev.toml +++ b/rdev.toml @@ -38,6 +38,8 @@ robot_wheel_platform = "linux-roborio" # - ensures that [project.entry-points.prefix*] are renamed to "actual", which # makes it easy to upgrade them each year (https://github.com/robotpy/robotpy-cli/issues/5) # - also reminds me that we have to bump it every year ^_^ +robotpy_sim = "robotpy_sim.2026" +robotpy_cli = "robotpy_cli.2026" [params.requirements] semiwrap = "~=0.1.7" diff --git a/subprojects/robotpy-halsim-ds-socket/pyproject.toml b/subprojects/robotpy-halsim-ds-socket/pyproject.toml index 1dedf3db0..77d44bef0 100644 --- a/subprojects/robotpy-halsim-ds-socket/pyproject.toml +++ b/subprojects/robotpy-halsim-ds-socket/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "robotpy-native-wpinet==2025.3.2.1", ] -[project.entry-points.robotpysimext] +[project.entry-points."robotpy_sim.2026"] ds-socket = "halsim_ds_socket" diff --git a/subprojects/robotpy-halsim-ws/pyproject.toml b/subprojects/robotpy-halsim-ws/pyproject.toml index fca1263a4..a60aae87d 100644 --- a/subprojects/robotpy-halsim-ws/pyproject.toml +++ b/subprojects/robotpy-halsim-ws/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "robotpy-native-wpinet==2025.3.2.1", ] -[project.entry-points.robotpysimext] +[project.entry-points."robotpy_sim.2026"] ws-server = "halsim_ws.server" ws-client = "halsim_ws.client" diff --git a/subprojects/robotpy-wpilib/pyproject.toml b/subprojects/robotpy-wpilib/pyproject.toml index 2b25b94f9..76381985d 100644 --- a/subprojects/robotpy-wpilib/pyproject.toml +++ b/subprojects/robotpy-wpilib/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ [project.urls] "Source code" = "https://github.com/robotpy/mostrobotpy" -[project.entry-points.robotpy] +[project.entry-points."robotpy_cli.2026"] run = "wpilib._impl.start:Main" diff --git a/subprojects/robotpy-xrp/pyproject.toml b/subprojects/robotpy-xrp/pyproject.toml index 2e329650a..9a8f881e5 100644 --- a/subprojects/robotpy-xrp/pyproject.toml +++ b/subprojects/robotpy-xrp/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "wpilib==2025.3.2.4" ] -[project.entry-points.robotpysimext] +[project.entry-points."robotpy_sim.2026"] xrp = "xrp.extension"