Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Commands to Pure Python #26

Closed
wants to merge 27 commits into from
Closed
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
7 changes: 1 addition & 6 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ on:

jobs:
ci:
uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2023
uses: robotpy/build-actions/.github/workflows/package-pure.yml@v2024-alpha
with:
enable_sphinx_check: false
secrets:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
META_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
RTD_WEBHOOK: ${{ secrets.RTD_WEBHOOK }}
PYPI_API_TOKEN: ${{ secrets.PYPI_PASSWORD }}
151 changes: 81 additions & 70 deletions commands2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,96 +1,107 @@
from . import _init_impl
from .button import Trigger
from .command import Command, InterruptionBehavior

from .version import version as __version__
from . import cmd

# autogenerated by 'robotpy-build create-imports commands2 commands2._impl'
from ._impl import (
Command,
CommandBase,
CommandGroupBase,
CommandScheduler,
ConditionalCommand,
FunctionalCommand,
InstantCommand,
MecanumControllerCommand,
NotifierCommand,
PIDCommand,
PIDSubsystem,
ParallelCommandGroup,
ParallelDeadlineGroup,
ParallelRaceGroup,
PerpetualCommand,
PrintCommand,
ProfiledPIDCommand,
ProfiledPIDSubsystem,
ProxyScheduleCommand,
RamseteCommand,
RepeatCommand,
RunCommand,
ScheduleCommand,
SelectCommand,
SequentialCommandGroup,
StartEndCommand,
Subsystem,
SubsystemBase,
Swerve2ControllerCommand,
Swerve3ControllerCommand,
Swerve4ControllerCommand,
Swerve6ControllerCommand,
TimedCommandRobot,
TrapezoidProfileCommand,
TrapezoidProfileCommandRadians,
TrapezoidProfileSubsystem,
TrapezoidProfileSubsystemRadians,
Trigger,
WaitCommand,
WaitUntilCommand,
# button,
# cmd,
requirementsDisjoint,
)
# from .cmd import (
# deadline,
# either,
# none,
# parallel,
# print_,
# race,
# repeatingSequence,
# run,
# runEnd,
# runOnce,
# select,
# sequence,
# startEnd,
# waitSeconds,
# waitUntil,
# )
from .commandgroup import CommandGroup, IllegalCommandUse
from .commandscheduler import CommandScheduler
from .conditionalcommand import ConditionalCommand
from .functionalcommand import FunctionalCommand
from .instantcommand import InstantCommand
from .notifiercommand import NotifierCommand
from .parallelcommandgroup import ParallelCommandGroup
from .paralleldeadlinegroup import ParallelDeadlineGroup
from .parallelracegroup import ParallelRaceGroup
from .perpetualcommand import PerpetualCommand
from .printcommand import PrintCommand
from .proxycommand import ProxyCommand
from .proxyschedulecommand import ProxyScheduleCommand
from .repeatcommand import RepeatCommand
from .runcommand import RunCommand
from .schedulecommand import ScheduleCommand
from .selectcommand import SelectCommand
from .sequentialcommandgroup import SequentialCommandGroup
from .startendcommand import StartEndCommand
from .subsystem import Subsystem
from .timedcommandrobot import TimedCommandRobot
from .waitcommand import WaitCommand
from .waituntilcommand import WaitUntilCommand
from .wrappercommand import WrapperCommand

__all__ = [
"cmd",
"Command",
"CommandBase",
"CommandGroupBase",
"CommandGroup",
"CommandScheduler",
"ConditionalCommand",
"SelectCommand",
"FunctionalCommand",
"IllegalCommandUse",
"InstantCommand",
"MecanumControllerCommand",
"InterruptionBehavior",
"NotifierCommand",
"PIDCommand",
"PIDSubsystem",
"ParallelCommandGroup",
"ParallelDeadlineGroup",
"ParallelRaceGroup",
"PerpetualCommand",
"PrintCommand",
"ProfiledPIDCommand",
"ProfiledPIDSubsystem",
"ProxyCommand",
"ProxyScheduleCommand",
"RamseteCommand",
"RepeatCommand",
"RunCommand",
"ScheduleCommand",
"SelectCommand",
"SequentialCommandGroup",
"StartEndCommand",
"Subsystem",
"SubsystemBase",
"Swerve2ControllerCommand",
"Swerve3ControllerCommand",
"Swerve4ControllerCommand",
"Swerve6ControllerCommand",
"TimedCommandRobot",
"TrapezoidProfileCommand",
TheTripleV marked this conversation as resolved.
Show resolved Hide resolved
"TrapezoidProfileCommandRadians",
"TrapezoidProfileSubsystem",
"TrapezoidProfileSubsystemRadians",
"Trigger",
"WaitCommand",
"WaitUntilCommand",
# "button",
# "cmd",
"requirementsDisjoint",
"WrapperCommand",
# "none",
# "runOnce",
# "run",
# "startEnd",
# "runEnd",
# "print_",
# "waitSeconds",
# "waitUntil",
# "either",
# "select",
# "sequence",
# "repeatingSequence",
# "parallel",
# "race",
# "deadline",
"Trigger", # was here in 2023
]

def __getattr__(attr):
if attr == "SubsystemBase":
import warnings
warnings.warn("SubsystemBase is deprecated", DeprecationWarning, stacklevel=2)
return Subsystem

if attr == "CommandBase":
import warnings
warnings.warn("CommandBase is deprecated", DeprecationWarning, stacklevel=2)
return Command

raise AttributeError("module {!r} has no attribute "
"{!r}".format(__name__, attr))
21 changes: 9 additions & 12 deletions commands2/button/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# autogenerated by 'robotpy-build create-imports commands2.button commands2._impl.button'
from .._impl.button import (
Button,
CommandGenericHID,
CommandJoystick,
CommandPS4Controller,
CommandXboxController,
JoystickButton,
NetworkButton,
POVButton,
)
from .commandgenerichid import CommandGenericHID
from .commandjoystick import CommandJoystick
from .commandps4controller import CommandPS4Controller
from .commandxboxcontroller import CommandXboxController
from .joystickbutton import JoystickButton
from .networkbutton import NetworkButton
from .povbutton import POVButton
from .trigger import Trigger

__all__ = [
"Button",
"Trigger",
"CommandGenericHID",
"CommandJoystick",
"CommandPS4Controller",
Expand Down
Loading
Loading