Skip to content

Commit 0faed56

Browse files
authored
Merge pull request #106 from robotpy/remove-wpilib-run
Remove wpilib.run for 2024
2 parents 6f6ff76 + 3552503 commit 0faed56

File tree

62 files changed

+15
-258
lines changed

Some content is hidden

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

62 files changed

+15
-258
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
matrix:
3434
os: ["ubuntu-22.04", "macos-12", "windows-2022"]
3535
python_version:
36-
# - '3.8'
37-
# - '3.9'
36+
- '3.8'
37+
- '3.9'
3838
- '3.10'
3939
- '3.11'
4040
- '3.12'
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install deps
4949
run: |
5050
pip install -U pip
51-
pip install 'robotpy[commands2]<2025.0.0,>=2024.0.0b3' numpy pytest
51+
pip install 'robotpy[commands2]<2025.0.0,>=2024.0.0b4.post1' numpy pytest
5252
- name: Run tests
5353
run: bash run_tests.sh
5454
shell: bash

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ deploy.json
1010
.project
1111
.pydevproject
1212

13+
pyproject.toml
14+
wpilib_preferences.json
15+
1316
imgui.ini
1417
simgui*.json
1518

AddressableLED/robot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,3 @@ def rainbow(self):
5252

5353
# Check bounds
5454
self.rainbowFirstPixelHue %= 180
55-
56-
57-
if __name__ == "__main__":
58-
wpilib.run(MyRobot)

ArcadeDrive/robot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,3 @@ def teleopPeriodic(self):
3333
# That means that the Y axis drives forward
3434
# and backward, and the X turns left and right.
3535
self.robotDrive.arcadeDrive(self.stick.getY(), self.stick.getX())
36-
37-
38-
if __name__ == "__main__":
39-
wpilib.run(MyRobot)

ArcadeDriveXboxController/robot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,3 @@ def teleopPeriodic(self):
3535
self.robotDrive.arcadeDrive(
3636
-self.driverController.getLeftY(), -self.driverController.getRightX()
3737
)
38-
39-
40-
if __name__ == "__main__":
41-
wpilib.run(MyRobot)

ArmBot/robot.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
class MyRobot(commands2.TimedCommandRobot):
1616
"""
17-
Our default robot class, pass it to wpilib.run
1817
Command v2 robots are encouraged to inherit from TimedCommandRobot, which
1918
has an implementation of robotPeriodic which runs the scheduler for you
2019
"""
@@ -78,7 +77,3 @@ def teleopPeriodic(self) -> None:
7877
def testInit(self) -> None:
7978
# Cancels all running commands at the start of test mode
8079
commands2.CommandScheduler.getInstance().cancelAll()
81-
82-
83-
if __name__ == "__main__":
84-
wpilib.run(MyRobot)

ArmBotOffboard/robot.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
class MyRobot(commands2.TimedCommandRobot):
1616
"""
17-
Our default robot class, pass it to wpilib.run
1817
Command v2 robots are encouraged to inherit from TimedCommandRobot, which
1918
has an implementation of robotPeriodic which runs the scheduler for you
2019
"""
@@ -65,7 +64,3 @@ def teleopPeriodic(self) -> None:
6564
def testInit(self) -> None:
6665
# Cancels all running commands at the start of test mode
6766
commands2.CommandScheduler.getInstance().cancelAll()
68-
69-
70-
if __name__ == "__main__":
71-
wpilib.run(MyRobot)

ArmSimulation/robot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,3 @@ def teleopPeriodic(self):
3030
def disabledInit(self):
3131
# This just makes sure that our simulation code knows that the motor's off.
3232
self.arm.stop()
33-
34-
35-
if __name__ == "__main__":
36-
wpilib.run(MyRobot)

CANPDP/robot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,3 @@ def robotPeriodic(self):
5353
# Energy is the power summed over time with units Joules.
5454
totalEnergy = self.pdp.getTotalEnergy()
5555
wpilib.SmartDashboard.putNumber("Total Energy", totalEnergy)
56-
57-
58-
if __name__ == "__main__":
59-
wpilib.run(MyRobot)

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Testing:
2626
General:
2727

2828
* We always try to stay as close to the original examples as possible
29-
* `Main.java` is never needed, it is equivalent to `wpilib.run(MyRobot)`
29+
* `Main.java` is never needed
3030
* `robot.py` should have `#!/usr/bin/env python3` as the very first line
31+
* This will go away soon as it is no longer needed in 2024
3132
* Note: Other files such as `vision.py` or `robotcontainer.py` should not start with `#!/usr/bin/env python3`
3233
* Don't ever check in files for your IDE (.vscode, .idea, etc)
3334
* Copy over the copyright statement from the original file

0 commit comments

Comments
 (0)