Skip to content

Commit 8fba288

Browse files
committed
versions
1 parent 2307ad4 commit 8fba288

File tree

17 files changed

+136
-134
lines changed

17 files changed

+136
-134
lines changed

devtools/ci.py

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import click
88
from packaging.requirements import Requirement
9-
import setuptools_scm
109

1110
from .ctx import Context
1211
from .update_pyproject import ProjectUpdater
@@ -39,24 +38,47 @@ def check_pyproject(ctx: Context):
3938
@ci.command()
4039
@click.option("--no-test", default=False, is_flag=True)
4140
@click.pass_obj
42-
def run(ctx: Context, no_test: bool):
41+
def build_other_wheels(ctx: Context, no_test: bool):
4342
"""
44-
Builds wheels, runs tests
43+
Builds wheels that don't use meson, runs tests
4544
"""
4645

47-
# Get the current build version
48-
version = setuptools_scm.get_version()
46+
for project in ctx.subprojects.values():
47+
if project.is_meson_project():
48+
continue
49+
50+
project.install_build_deps(wheel_path=ctx.wheel_path)
51+
project.build_wheel(wheel_path=ctx.wheel_path, install=True)
52+
if not no_test:
53+
project.test(install_requirements=True)
54+
55+
@ci.command()
56+
@click.option("--no-test", default=False, is_flag=True)
57+
@click.pass_obj
58+
def build_meson_wheels(ctx: Context, no_test: bool):
59+
"""
60+
Builds wheels that use meson, runs tests.
61+
62+
Needs wheels that are in the non-meson builds
63+
"""
4964

5065
# Fix build dependencies to be == what we are building
5166
# - install_requires already has this via ==THIS_VERSION in robotpy-build
52-
for project in ctx.subprojects.values():
53-
for i in range(len(project.build_requires)):
54-
req = project.build_requires[i]
55-
if req.name in ctx.subprojects:
56-
project.build_requires[i] = Requirement(f"{req.name}=={version}")
67+
# for project in ctx.subprojects.values():
68+
# for i in range(len(project.build_requires)):
69+
# req = project.build_requires[i]
70+
# if req.name in ctx.subprojects:
71+
# project.build_requires[i] = Requirement(f"{req.name}=={version}")
72+
73+
# Check that the build dependencies match the versions of the projects
74+
# that we're building
75+
5776

5877
for project in ctx.subprojects.values():
78+
if not project.is_meson_project():
79+
continue
80+
5981
project.install_build_deps(wheel_path=ctx.wheel_path)
60-
project.bdist_wheel(wheel_path=ctx.wheel_path, install=True)
82+
project.build_wheel(wheel_path=ctx.wheel_path, install=True)
6183
if not no_test:
6284
project.test(install_requirements=True)

devtools/subproject.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,19 @@ def test(self, *, install_requirements=False):
9494
cwd=tests_path,
9595
)
9696

97-
def bdist_wheel(self, *, wheel_path: pathlib.Path, install: bool):
97+
def build_wheel(self, *, wheel_path: pathlib.Path, install: bool):
9898
wheel_path.mkdir(parents=True, exist_ok=True)
9999

100+
# TODO: eventually it would be nice to use build isolation
101+
100102
with tempfile.TemporaryDirectory() as td:
101-
# Use bdist_wheel here instead of other solutions because it
102-
# allows using ccache
103+
# I wonder if we should use hatch build instead?
103104
self._cmd(
104105
sys.executable,
105-
"setup.py",
106-
"bdist_wheel",
107-
"-d",
106+
"-m",
107+
"build",
108+
"--no-isolation",
109+
"--outdir",
108110
td,
109111
cwd=self.path,
110112
)
@@ -114,17 +116,9 @@ def bdist_wheel(self, *, wheel_path: pathlib.Path, install: bool):
114116
dst_whl = wheel_path / self._fix_wheel_name(twhl.name)
115117
shutil.move(twhl, dst_whl)
116118

117-
# Setuptools is dumb
118-
for p in self.path.glob("*.egg-info"):
119-
shutil.rmtree(p)
120-
121119
if install:
122120
# Install the wheel
123-
self._cmd(
124-
sys.executable,
125-
"-m",
126-
"pip",
127-
"--disable-pip-version-check",
121+
self._run_pip(
128122
"install",
129123
"--force-reinstall",
130124
"--find-links",

rdev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
black
2+
# build
23
click
34
packaging
45
pytest

subprojects/pyntcore/pyproject.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap", "hatch-meson", "hatch-vcs", "hatchling",
4+
"semiwrap",
5+
"hatch-meson",
6+
"hatch-robotpy",
7+
"hatchling",
58
"native.ntcore==2025.3.2",
69
"robotpy-wpiutil~=2025.3.2",
710
"robotpy-wpinet~=2025.3.2",
@@ -10,13 +13,13 @@ requires = [
1013

1114
[project]
1215
name = "pyntcore"
13-
dynamic = ["version"]
16+
version = "2025.3.2.2"
1417
description = "Binary wrappers for the FRC ntcore library"
1518
authors = [
1619
{name = "RobotPy Development Team", email = "[email protected]"},
1720
]
1821
license = "BSD-3-Clause"
19-
install_requires = [
22+
dependencies = [
2023
"native.ntcore==2025.3.2",
2124
"robotpy-wpiutil~=2025.3.2",
2225
"robotpy-wpinet~=2025.3.2",
@@ -25,13 +28,9 @@ install_requires = [
2528
[project.urls]
2629
"Source code" = "https://github.com/robotpy/mostrobotpy"
2730

28-
[tool.hatch.version]
29-
source = "vcs"
30-
raw-options.root = "../.."
31-
32-
[tool.hatch.build.hooks.vcs]
33-
version-file = "ntcore/version.py"
3431

32+
[tool.hatch.build.hooks.robotpy]
33+
version_file = "ntcore/version.py"
3534

3635
[tool.hatch.build.hooks.semiwrap]
3736

subprojects/robotpy-apriltag/pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap", "hatch-meson", "hatch-vcs", "hatchling",
4+
"semiwrap",
5+
"hatch-meson",
6+
"hatch-robotpy",
7+
"hatchling",
58
"native.apriltag==2025.3.2",
69
"robotpy-wpiutil~=2025.3.2",
710
"robotpy-wpimath~=2025.3.2",
811
]
912

1013
[project]
1114
name = "robotpy-apriltag"
12-
dynamic = ["version"]
15+
version = "2025.3.2.2"
1316
description = "RobotPy bindings for WPILib's AprilTag library"
1417
authors = [
1518
{name = "RobotPy Development Team", email = "[email protected]"},
1619
]
1720
license = "BSD-3-Clause"
18-
install_requires = [
21+
dependencies = [
1922
"robotpy-wpiutil~=2025.3.2",
2023
"robotpy-wpimath~=2025.3.2",
2124
]
2225

2326
[project.urls]
2427
"Source code" = "https://github.com/robotpy/mostrobotpy"
2528

26-
[tool.hatch.version]
27-
source = "vcs"
28-
raw-options.root = "../.."
2929

30-
[tool.hatch.build.hooks.vcs]
31-
version-file = "robotpy_apriltag/version.py"
30+
[tool.hatch.build.hooks.robotpy]
31+
version_file = "robotpy_apriltag/version.py"
3232

3333
[tool.hatch.build.hooks.semiwrap]
3434

subprojects/robotpy-cscore/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author = "RobotPy Development Team"
55
author_email = "[email protected]"
66
url = "https://github.com/robotpy/robotpy-cscore"
77
license = "BSD-3-Clause"
8-
install_requires = [
8+
dependencies = [
99
"robotpy-wpiutil==THIS_VERSION",
1010
"robotpy-wpinet==THIS_VERSION",
1111
"pyntcore==THIS_VERSION",

subprojects/robotpy-hal/pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap", "hatch-meson", "hatch-vcs", "hatchling",
4+
"semiwrap",
5+
"hatch-meson",
6+
"hatch-vcs",
7+
"hatchling",
58
"native.wpihal==2025.3.2",
69
"robotpy-wpiutil~=2025.3.2",
710
]
811

912
[project]
1013
name = "robotpy-hal"
11-
dynamic = ["version"]
14+
version = "2025.3.2.2"
1215
description = "Binary wrapper for FRC HAL"
1316
authors = [
1417
{name = "RobotPy Development Team", email = "[email protected]"},
1518
]
1619
license = "BSD-3-Clause"
17-
install_requires = [
20+
dependencies = [
1821
"native.wpihal==2025.3.2",
1922
"robotpy-wpiutil~=2025.3.2",
2023
]
2124

2225
[project.urls]
2326
"Source code" = "https://github.com/robotpy/mostrobotpy"
2427

25-
[tool.hatch.version]
26-
source = "vcs"
27-
raw-options.root = "../.."
2828

29-
[tool.hatch.build.hooks.vcs]
30-
version-file = "hal/version.py"
29+
[tool.hatch.build.hooks.robotpy]
30+
version_file = "hal/version.py"
3131

3232
[tool.hatch.build.hooks.semiwrap]
3333

subprojects/robotpy-halsim-ds-socket/pyproject.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"hatchling", "hatch-vcs",
4+
"hatchling",
55
"hatch-robotpy",
66
]
77

88
[project]
99
name = "robotpy-halsim-ds-socket"
10-
dynamic = ["version"]
10+
version = "2025.3.2.2"
1111
description = "WPILib simulator DS Socket Extension"
1212
authors = [
1313
{name = "RobotPy Development Team", email = "[email protected]"},
1414
]
1515
license = "BSD-3-Clause"
16-
install_requires = [
17-
"robotpy-hal~=2025.3.2",
18-
"robotpy-wpinet~=2025.3.2",
16+
dependencies = [
17+
"native.wpihal==2025.3.2",
18+
"native.wpinet==2025.3.2",
1919
]
2020

2121
[project.entry-points.robotpysimext]
2222
ds-socket = "halsim_ds_socket"
2323

24-
[tool.hatch.version]
25-
source = "vcs"
26-
raw-options.root = "../.."
2724

28-
[tool.hatch.build.hooks.vcs]
25+
[tool.hatch.build.hooks.robotpy]
2926
version-file = "halsim_ds_socket/version.py"
3027

31-
3228
[[tool.hatch.build.hooks.robotpy.maven_lib_download]]
3329
artifact_id = "halsim_ds_socket"
3430
group_id = "edu.wpi.first.halsim"

subprojects/robotpy-halsim-ds-socket/tests/test_halsim_ds_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
def test_halsim_ds_socket():
66
# dependencies
7-
import wpinet
8-
import hal
7+
import native.wpihal._init_native_wpihal
8+
import native.wpinet._init_native_wpinet
99

1010
import halsim_ds_socket as base
1111

subprojects/robotpy-halsim-gui/pyproject.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap", "hatch-meson", "hatch-vcs", "hatchling",
4+
"semiwrap",
5+
"hatch-meson",
56
"hatch-robotpy",
7+
"hatchling",
68
"robotpy-wpiutil~=2025.3.2",
79
"robotpy-wpimath~=2025.3.2",
810
"robotpy-hal~=2025.3.2",
@@ -11,13 +13,13 @@ requires = [
1113

1214
[project]
1315
name = "robotpy-halsim-gui"
14-
dynamic = ["version"]
16+
version = "2025.3.2.2"
1517
description = "WPILib simulation GUI"
1618
authors = [
1719
{name = "RobotPy Development Team", email = "[email protected]"},
1820
]
1921
license = "BSD-3-Clause"
20-
install_requires = [
22+
dependencies = [
2123
"robotpy-wpiutil~=2025.3.2",
2224
"robotpy-wpimath~=2025.3.2",
2325
"robotpy-hal~=2025.3.2",
@@ -27,14 +29,10 @@ install_requires = [
2729
[project.urls]
2830
"Source code" = "https://github.com/robotpy/mostrobotpy"
2931

30-
[tool.hatch.version]
31-
source = "vcs"
32-
raw-options.root = "../.."
3332

34-
[tool.hatch.build.hooks.vcs]
33+
[tool.hatch.build.hooks.robotpy]
3534
version-file = "halsim_gui/version.py"
3635

37-
3836
[[tool.hatch.build.hooks.robotpy.maven_lib_download]]
3937
artifact_id = "halsim_gui"
4038
group_id = "edu.wpi.first.halsim"

0 commit comments

Comments
 (0)