Skip to content

Commit f6818c5

Browse files
authored
Merge pull request #205 from robotpy/2027-dev
2027.0.0-alpha-3
2 parents ac60fd3 + c6e1227 commit f6818c5

File tree

65 files changed

+398
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+398
-350
lines changed

.github/workflows/dist.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ jobs:
131131
- "macos-14" # arm64
132132
- "windows-2022"
133133
python_version:
134-
- '3.9'
135134
- '3.10'
136135
- '3.11'
137136
- '3.12'
138137
- '3.13'
138+
- '3.14'
139139
include:
140140
- os: ubuntu-24.04-arm
141141
python_version: '3.11'
@@ -146,6 +146,9 @@ jobs:
146146
- os: ubuntu-24.04-arm
147147
python_version: '3.13'
148148
container: python:3.13-bookworm
149+
- os: ubuntu-24.04-arm
150+
python_version: '3.14'
151+
container: python:3.14-bookworm
149152

150153
container: ${{ matrix.container }}
151154

@@ -236,9 +239,9 @@ jobs:
236239
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
237240
matrix:
238241
os:
239-
- container: wpilib/systemcore-cross-ubuntu:2025-22.04-py313
242+
- container: wpilib/systemcore-cross-ubuntu:2026-24.04-py314
240243
name: systemcore
241-
- container: wpilib/raspbian-cross-ubuntu:2025-bookworm-24.04-py313
244+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04-py313
242245
name: raspbian
243246

244247
container:
@@ -274,19 +277,22 @@ jobs:
274277
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
275278
matrix:
276279
os:
277-
- container: wpilib/systemcore-cross-ubuntu:2025-22.04-py313
280+
- container: wpilib/systemcore-cross-ubuntu:2026-24.04-py314
278281
name: systemcore
279282
base: systemcore
280283

281-
- container: wpilib/raspbian-cross-ubuntu:2025-bookworm-24.04-py311
284+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04-py311
282285
name: raspbian-py311
283286
base: raspbian
284-
- container: wpilib/raspbian-cross-ubuntu:2025-bookworm-24.04-py312
287+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04-py312
285288
name: raspbian-py312
286289
base: raspbian
287-
- container: wpilib/raspbian-cross-ubuntu:2025-bookworm-24.04-py313
290+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04-py313
288291
name: raspbian-py313
289292
base: raspbian
293+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04-py314
294+
name: raspbian-py314
295+
base: raspbian
290296

291297
container:
292298
image: "${{ matrix.os.container }}"

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ Development environment
4242
-----------------------
4343

4444
To install all robotpy packages in [editable mode](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#working-in-development-mode)
45-
run this:
45+
first run this to install dependencies:
46+
47+
./rdev.sh install-prereqs
48+
49+
Then each time you want to build everything:
4650

4751
./rdev.sh develop
4852

@@ -55,7 +59,7 @@ rebuild an individual package:
5559

5660
./rdev.sh develop NAME
5761

58-
It can be a slow process,see the [robotpy-build documentation](https://robotpy-build.readthedocs.io/en/stable/tips.html)
62+
It can be a slow process, see the [semiwrap documentation](https://semiwrap.readthedocs.io/en/stable/tips.html)
5963
for tips to make it more efficient.
6064

6165
Cross Compilation

devtools/__main__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from .ctx import Context
88
from . import ci
99
from . import update_pyproject
10+
from . import util
11+
1012

1113
#
1214
# Environment variables for configuring the builds
@@ -61,6 +63,29 @@ def develop(ctx: Context, package: str):
6163
project.develop()
6264

6365

66+
@main.command()
67+
@click.pass_obj
68+
def install_prereqs(ctx: Context):
69+
"""Install developer build dependencies before running develop"""
70+
71+
reqs = set()
72+
reqs.add("editables")
73+
reqs.add("numpy")
74+
reqs.add("pytest")
75+
76+
repo_deps = set()
77+
78+
for project in ctx.subprojects.values():
79+
with ctx.handle_exception(project.name):
80+
repo_deps.add(project.pyproject_name)
81+
82+
for req in project.build_requires + project.dependencies:
83+
if req.name not in repo_deps:
84+
reqs.add(req)
85+
86+
util.run_pip("install", *map(str, reqs))
87+
88+
6489
@main.command()
6590
@click.pass_obj
6691
def scan_headers(ctx: Context):

devtools/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Parameters:
2424
wpilib_bin_version: str
2525
wpilib_bin_url: str
2626

27+
#: renames [project.entry-points.KEY*] to [project.entry-points.VALUE]
28+
entrypoints: T.Dict[str, str]
29+
2730
exclude_artifacts: T.Set[str]
2831

2932
requirements: T.Dict[str, str]

devtools/subproject.py

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ def build_wheel(
132132

133133
tdp = pathlib.Path(td)
134134
twhl = list(tdp.glob("*.whl"))[0]
135-
dst_whl = wheel_path / self._fix_wheel_name(twhl.name)
135+
dst_whl = wheel_path / self._fix_wheel_name(twhl)
136136
shutil.move(twhl, dst_whl)
137+
print("Wrote wheel to", dst_whl)
137138

138139
if install:
139140
# Install the wheel
@@ -147,19 +148,46 @@ def build_wheel(
147148
)
148149

149150
_adjust_wheel_tags = {
150-
# pypi only accepts manylinux wheels, and we know we're compatible
151-
# TODO(davo): use auditwheel to fix the tags instead
152-
"linux_x86_64": "manylinux_2_35_x86_64",
153-
"linux_aarch64": "manylinux_2_36_aarch64",
154151
# needed for compatibility with python compiled with older xcode
155152
"macosx_11_0_x86_64": "macosx_10_16_x86_64",
156153
"macosx_12_0_x86_64": "macosx_10_16_x86_64",
157154
}
158155

159-
def _fix_wheel_name(self, name: str) -> str:
160-
for old, new in self._adjust_wheel_tags.items():
161-
old_whl = f"{old}.whl"
162-
new_whl = f"{new}.whl"
163-
if name.endswith(old_whl):
164-
name = f"{name[:-len(old_whl)]}{new_whl}"
156+
def _fix_wheel_name(self, wheel_path: pathlib.Path) -> str:
157+
if sys.platform == "linux":
158+
name = self._fix_linux_wheel_name(wheel_path)
159+
else:
160+
name = wheel_path.name
161+
for old, new in self._adjust_wheel_tags.items():
162+
old_whl = f"{old}.whl"
163+
new_whl = f"{new}.whl"
164+
if name.endswith(old_whl):
165+
name = f"{name[:-len(old_whl)]}{new_whl}"
166+
165167
return name
168+
169+
def _fix_linux_wheel_name(self, wheel_path: pathlib.Path) -> str:
170+
# inspired by https://github.com/hsorby/renamewheel, Apache license
171+
172+
from auditwheel.error import NonPlatformWheel, WheelToolsError
173+
from auditwheel.wheel_abi import analyze_wheel_abi
174+
from auditwheel.wheeltools import get_wheel_architecture, get_wheel_libc
175+
176+
try:
177+
arch = get_wheel_architecture(wheel_path.name)
178+
except (WheelToolsError, NonPlatformWheel):
179+
arch = None
180+
181+
try:
182+
libc = get_wheel_libc(wheel_path.name)
183+
except WheelToolsError:
184+
libc = None
185+
186+
try:
187+
winfo = analyze_wheel_abi(libc, arch, wheel_path, frozenset(), True, True)
188+
except NonPlatformWheel:
189+
return wheel_path.name
190+
else:
191+
parts = wheel_path.name.split("-")
192+
parts[-1] = winfo.overall_policy.name
193+
return "-".join(parts) + ".whl"

devtools/update_pyproject.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, ctx: Context) -> None:
4040
# and retain all the comments
4141
self.subprojects: typing.Dict[str, ProjectInfo] = {}
4242
for name, project in self.ctx.subprojects.items():
43-
with open(project.pyproject_path, "r") as fp:
43+
with open(project.pyproject_path) as fp:
4444
data = tomlkit.load(fp)
4545

4646
self.subprojects[name] = ProjectInfo(
@@ -68,6 +68,31 @@ def wpilib_bin_version(self) -> str:
6868
def wpilib_bin_url(self) -> str:
6969
return self.cfg.params.wpilib_bin_url
7070

71+
def _update_entrypoints(
72+
self,
73+
info: ProjectInfo,
74+
pypi_name: str,
75+
):
76+
data = info.data
77+
eps = data["project"].get("entry-points")
78+
if eps is None:
79+
return
80+
81+
for name in list(eps.keys()):
82+
for prefix, replace in self.cfg.params.entrypoints.items():
83+
if name.startswith(prefix):
84+
if name != replace:
85+
eps[replace] = eps[name]
86+
del eps[name]
87+
print(
88+
f"* {pypi_name}: entry-points.{name} -> entry-points.{replace}"
89+
)
90+
self.commit_changes.add(
91+
f"{pypi_name}: entry-points.{name} -> entry-points.{replace}"
92+
)
93+
info.changed = True
94+
break
95+
7196
def _update_requirements(
7297
self,
7398
info: ProjectInfo,
@@ -126,6 +151,12 @@ def update_requirements(self):
126151
data["project"]["dependencies"],
127152
)
128153

154+
# project.entry-points
155+
self._update_entrypoints(
156+
info,
157+
pypi_name,
158+
)
159+
129160
def _update_maven(self, info: ProjectInfo):
130161
data = info.data
131162
iter = (

rdev.toml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
[py_versions]
1212

1313
# Usually the same as wpilib_bin_version
14-
native = "2027.0.0a2"
14+
native = "2027.0.0a3"
1515

1616
# Will eventually sync with native
17-
halsim_native = "2027.0.0a2"
17+
halsim_native = "2027.0.0a3"
1818

1919
# Usually similar to native, but subminor version is bumped for bugfixes
2020
# - ./rdev.sh ci check_tag will fail if this doesn't match current tag
21-
wrapper = "2027.0.0a2"
21+
wrapper = "2027.0.0a3"
2222

2323
[params]
2424

25-
wpilib_bin_version = "2027.0.0-alpha-2"
25+
wpilib_bin_version = "2027.0.0-alpha-3"
2626
wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/release-2027"
2727
# wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/development-2027"
2828

@@ -33,12 +33,20 @@ exclude_artifacts = [
3333

3434
robot_wheel_platform = "linux-systemcore"
3535

36+
[params.entrypoints]
37+
# prefix = "actual"
38+
# - ensures that [project.entry-points.prefix*] are renamed to "actual", which
39+
# makes it easy to upgrade them each year (https://github.com/robotpy/robotpy-cli/issues/5)
40+
# - also reminds me that we have to bump it every year ^_^
41+
robotpy_sim = "robotpy_sim.2027"
42+
robotpy_cli = "robotpy_cli.2027"
43+
3644
[params.requirements]
37-
semiwrap = "~=0.1.7"
38-
hatch-meson = "~=0.1.0b2"
45+
semiwrap = "~=0.2.1"
46+
hatch-meson = "~=0.1.0"
3947
hatch-nativelib = "~=0.2.0"
4048
hatch-robotpy = "~=0.2.1"
41-
49+
robotpy-cli = "~=2027.0.0a1"
4250

4351
[subprojects."robotpy-native-wpiutil"]
4452
py_version = "native"

rdev_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ validobj~=1.2
1010

1111
ninja
1212
msvc-runtime>=14.42.34433; platform_system == 'Windows'
13+
14+
auditwheel~=6.4; platform_system == 'Linux'

subprojects/pyntcore/pyproject.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap~=0.1.7",
5-
"hatch-meson~=0.1.0b2",
4+
"semiwrap~=0.2.1",
5+
"hatch-meson~=0.1.0",
66
"hatch-robotpy~=0.2.1",
77
"hatchling",
8-
"robotpy-native-ntcore==2027.0.0a2",
9-
"robotpy-wpiutil==2027.0.0a2",
10-
"robotpy-wpinet==2027.0.0a2",
11-
"robotpy-wpilog==2027.0.0a2",
8+
"robotpy-native-ntcore==2027.0.0a3",
9+
"robotpy-wpiutil==2027.0.0a3",
10+
"robotpy-wpinet==2027.0.0a3",
11+
"robotpy-wpilog==2027.0.0a3",
1212
]
1313

1414

1515
[project]
1616
name = "pyntcore"
17-
version = "2027.0.0a2"
17+
version = "2027.0.0a3"
1818
description = "Binary wrappers for the FRC ntcore library"
1919
authors = [
2020
{name = "RobotPy Development Team", email = "[email protected]"},
2121
]
2222
license = "BSD-3-Clause"
2323
dependencies = [
24-
"robotpy-native-ntcore==2027.0.0a2",
25-
"robotpy-wpiutil==2027.0.0a2",
26-
"robotpy-wpinet==2027.0.0a2",
27-
"robotpy-wpilog==2027.0.0a2",
24+
"robotpy-native-ntcore==2027.0.0a3",
25+
"robotpy-wpiutil==2027.0.0a3",
26+
"robotpy-wpinet==2027.0.0a3",
27+
"robotpy-wpilog==2027.0.0a3",
2828
]
2929

3030
[project.urls]

subprojects/pyntcore/tests/test_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# works correctly
55
#
66

7-
from __future__ import print_function
8-
97
import pytest
108

119
import logging

0 commit comments

Comments
 (0)