Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions devtools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
31 changes: 31 additions & 0 deletions devtools/update_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = (
Expand Down
8 changes: 8 additions & 0 deletions rdev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ 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 ^_^
robotpy_sim = "robotpy_sim.2026"
robotpy_cli = "robotpy_cli.2026"

[params.requirements]
semiwrap = "~=0.1.7"
hatch-meson = "~=0.1.0b2"
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-halsim-ds-socket/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-halsim-ws/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-wpilib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-xrp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
"wpilib==2025.3.2.4"
]

[project.entry-points.robotpysimext]
[project.entry-points."robotpy_sim.2026"]
xrp = "xrp.extension"


Expand Down
Loading