Skip to content

First version of iterativerobotpy.py #161

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

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

MikeStitt
Copy link
Collaborator

A draft to get progress going.

Copy link
Member

@virtuald virtuald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks pretty sane.

def testExit(self):
pass

# todo @Deprecated(forRemoval=true, since="2025")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we deprecate things, we typically only do it in the docstring.

wpilib.DriverStation.refreshData()
self._m_watchdog.reset()

self._m_word.refresh() # todo from Java implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ doesn't have this, I filed a bug to fix that (wpilibsuite/allwpilib#7889).

For now, just do self._word = DSControlWord() and it should have the same effect. Leave a TODO note to switch to refresh when it gets implemented.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, robotBase has a GetControlState method which returns (enabled, autonomous, test)... which I think would be better to use here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auscompgeek AI tells me that "The eyes emoji (👀) generally indicates a sense of observation, attention, or interest, often with a subtle hint of intrigue or admiration. It can also be used to suggest that someone is being watched or is deliberately drawing attention to something."

What are you thinking here?

# private void printLoopOverrunMessage() {
# DriverStation.reportWarning("Loop time of " + m_period + "s overrun\n", false);
# }
wpilib._impl.report_error.reportWarning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is correct.

I would do at the top of this file from wpilib import reportWarning. Every time there's a . in python it's another dictionary lookup, and the rio is really slow.

Copy link
Member

@auscompgeek auscompgeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional early feedback.

self.driverStationConnected()

# If mode changed, call mode exit and entry functions
if self._m_lastMode != mode:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Python enums are singletons, so prefer using is like the recommendation in the Python docs for enum

@MikeStitt
Copy link
Collaborator Author

Top level questions:

Is the filename right?

Is the file in the right spot in the tree?

Is the class name right?

What are the appropriate tests?

What happens if someone deletes the watchdog? Is the there a higher level watchdog that will stop the motors?

Can somebody figure out how to call the shuffleboard?

@virtuald
Copy link
Member

virtuald commented Apr 6, 2025

I'm not sure about the filename/classname yet. I think you're approaching it as an alternative, but I sorta want a replacement? But, I guess we could go either way.

TBH, before deciding on alternative/replacement, probably need someone to do some testing on a real robot to see if it makes loop overrun issues more/less/same.

What are the appropriate tests?

... yeah, the only real way to test this is likely going to be by testing examples, which is something I'd like to do but haven't taken the time to do (see #154). Java has tests for TimedRobot, but they basically do the same thing that the pyfrc test framework does (maybe that's an argument for moving some of that into here...).

What happens if someone deletes the watchdog? Is the there a higher level watchdog that will stop the motors?

If someone deletes the watchdog, that's their problem -- but also, the motor watchdog is actually a separate thing? This one just tracks loop overruns and tells the user about it.

Can somebody figure out how to call the shuffleboard?

https://robotpy.readthedocs.io/projects/robotpy/en/stable/wpilib.shuffleboard/Shuffleboard.html#wpilib.shuffleboard.Shuffleboard.update

@MikeStitt
Copy link
Collaborator Author

This version simulates a TimedRobot, advances time, logs to AdvantageScope in a reasonable way, but does not move the robot in simulation.

It feels like some sort of enable interlock on the simulator is missing.

Generally all status results from hal.xxx calls seem to result in a strange value, but the calls seem to work.

./rdev.sh ci run
and
./rdev.sh develop

do not seem to make the pure python files editable in place.

Could use some detailed advice on how to get the python files to be editable in place.

@MikeStitt
Copy link
Collaborator Author

This is the code I'm using to simulate: https://github.com/spiresfrc9106/spiresRobot2025/blob/exp-timedrobotpy/robot.py#L46

@virtuald
Copy link
Member

virtuald commented Apr 8, 2025

For develop to work, you have to make sure that all of the packages aren't installed first. pip/setuptools don't do a great job of having an editable/non-editable package installed.

@MikeStitt
Copy link
Collaborator Author

MikeStitt commented Apr 8, 2025

It's hard to tell which libraries need to be uninstalled for mostrobotpy and which need to stay for robotpy:

t2.txt:

robotpy-apriltag
robotpy-cscore
robotpy-hal
robotpy-halsim-ds-socket
robotpy-halsim-gui
robotpy-halsim-ws
robotpy-romi
robotpy-wpilib-utilities
robotpy-wpimath
robotpy-wpinet
robotpy-wpiutil
robotpy-xrp
pip uninstall robotpy
pip install robotpy
pip uninstall -r ~/t2.txt -y
pip uninstall pyntcore
pushd ~/mostrobotpy
./rdev.sh develop
 popd
mikestitt@peas mostRobotPySpires2025 % pip list
Package                   Version                   Editable project location
------------------------- ------------------------- -------------------------------------------------------------------------------
altgraph                  0.17.4
anyio                     4.4.0
appdirs                   1.4.4
astroid                   3.0.3
bcrypt                    4.2.0
black                     25.1.0
certifi                   2024.7.4
cffi                      1.17.0
charset-normalizer        3.4.1
click                     8.1.8
coverage                  7.8.0
cryptography              43.0.0
cxxheaderparser           1.4.1
debugpy                   1.8.11
delocate                  0.13.0
dill                      0.3.9
flexcache                 0.3
flexparser                0.4
h11                       0.14.0
httpcore                  1.0.5
httpx                     0.27.0
idna                      3.7
iniconfig                 2.0.0
invoke                    2.2.0
isort                     5.13.2
macholib                  1.16.3
mccabe                    0.7.0
mypy-extensions           1.0.0
numpy                     2.2.4
ollama                    0.3.1
opencv-python             4.11.0.86
packaging                 23.2
paramiko                  3.4.1
patch                     1.16
pathspec                  0.12.1
pcpp                      1.30
phoenix6                  24.3.0
photonlibpy               2025.2.1
Pint                      0.24.4
pip                       25.0.1
platformdirs              4.3.7
pluggy                    1.5.0
pybind11-stubgen          2.5.3
pycparser                 2.22
pydantic                  1.10.21
pyfrc                     2025.1.0
pylint                    3.0.3
PyNaCl                    1.5.0
pynetconsole              2.0.4
pyntcore                  2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/pyntcore
pytest                    8.3.2
pytest-reraise            2.1.2
PyYAML                    6.0.2
requests                  2.32.3
robotpy                   2025.3.2.0
robotpy-apriltag          2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-apriltag
robotpy-build             2025.1.0
robotpy-cli               2024.0.0
robotpy-cscore            2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-cscore
robotpy-hal               2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-hal
robotpy-halsim-ds-socket  2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-ds-socket
robotpy-halsim-gui        2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-gui
robotpy-halsim-ws         2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-ws
robotpy-installer         2025.1.0
robotpy-navx              2025.0.1.1
robotpy-playingwithfusion 2025.0.0
robotpy-rev               2025.0.3
robotpy-romi              2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-romi
robotpy-wpimath           2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpimath
robotpy-wpinet            2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpinet
robotpy-wpiutil           2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpiutil
robotpy-xrp               2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-xrp
setuptools                74.0.0
setuptools-scm            7.1.0
sniffio                   1.3.1
sphinxify                 0.12
tomli                     2.0.1
tomli_w                   1.2.0
tomlkit                   0.13.2
toposort                  1.10
typing_extensions         4.12.2
urllib3                   2.3.0
wheel                     0.45.1
wpilib                    2025.3.2.0                /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages
mikestitt@peas mostRobotPySpires2025 % robotpy sim                 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/robotpy/main.py", line 245, in main
    cmd_class = entry_point.load()
                ^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/__init__.py", line 1, in <module>
    from . import _init_wpilib
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_init_wpilib.py", line 14, in <module>
    import wpilib._impl._init_wpilibc
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_impl/__init__.py", line 1, in <module>
    from . import _init_wpilibc
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_impl/_init_wpilibc.py", line 15, in <module>
    _lib = CDLL(join(_root, "lib", "libwpilibc.dylib"), mode=RTLD_GLOBAL)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ctypes/__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_impl/lib/libwpilibc.dylib, 0x000A): Library not loaded: @loader_path/../../../ntcore/lib/libntcore.dylib
  Referenced from: <64235283-2B65-3D4F-868A-0BF932086DA9> /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_impl/lib/libwpilibc.dylib
  Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wpilib/_impl/lib/../../../ntcore/lib/libntcore.dylib' (no such file)
Plugin error detected in 'EntryPoint(name='run', value='wpilib._impl.start:Main', group='robotpy')' (use --ignore-plugin-errors to ignore this)
mikestitt@peas mostRobotPySpires2025 % 
mikestitt@peas mostRobotPySpires2025 % pip list                    
Package                   Version                   Editable project location
------------------------- ------------------------- -------------------------------------------------------------------------------
altgraph                  0.17.4
anyio                     4.4.0
appdirs                   1.4.4
astroid                   3.0.3
bcrypt                    4.2.0
black                     25.1.0
certifi                   2024.7.4
cffi                      1.17.0
charset-normalizer        3.4.1
click                     8.1.8
coverage                  7.8.0
cryptography              43.0.0
cxxheaderparser           1.4.1
debugpy                   1.8.11
delocate                  0.13.0
dill                      0.3.9
flexcache                 0.3
flexparser                0.4
h11                       0.14.0
httpcore                  1.0.5
httpx                     0.27.0
idna                      3.7
iniconfig                 2.0.0
invoke                    2.2.0
isort                     5.13.2
macholib                  1.16.3
mccabe                    0.7.0
mypy-extensions           1.0.0
numpy                     2.2.4
ollama                    0.3.1
opencv-python             4.11.0.86
packaging                 23.2
paramiko                  3.4.1
patch                     1.16
pathspec                  0.12.1
pcpp                      1.30
phoenix6                  24.3.0
photonlibpy               2025.2.1
Pint                      0.24.4
pip                       25.0.1
platformdirs              4.3.7
pluggy                    1.5.0
pybind11-stubgen          2.5.3
pycparser                 2.22
pydantic                  1.10.21
pyfrc                     2025.1.0
pylint                    3.0.3
PyNaCl                    1.5.0
pynetconsole              2.0.4
pyntcore                  2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/pyntcore
pytest                    8.3.2
pytest-reraise            2.1.2
PyYAML                    6.0.2
requests                  2.32.3
robotpy                   2025.3.2.0
robotpy-apriltag          2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-apriltag
robotpy-build             2025.1.0
robotpy-cli               2024.0.0
robotpy-cscore            2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-cscore
robotpy-hal               2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-hal
robotpy-halsim-ds-socket  2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-ds-socket
robotpy-halsim-gui        2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-gui
robotpy-halsim-ws         2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-halsim-ws
robotpy-installer         2025.1.0
robotpy-navx              2025.0.1.1
robotpy-playingwithfusion 2025.0.0
robotpy-rev               2025.0.3
robotpy-romi              2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-romi
robotpy-wpimath           2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpimath
robotpy-wpinet            2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpinet
robotpy-wpiutil           2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-wpiutil
robotpy-xrp               2025.3.2.1.dev4+g3f1e12ca /Users/mikestitt/mostrobotpy/subprojects/robotpy-xrp
setuptools                74.0.0
setuptools-scm            7.1.0
sniffio                   1.3.1
sphinxify                 0.12
tomli                     2.0.1
tomli_w                   1.2.0
tomlkit                   0.13.2
toposort                  1.10
typing_extensions         4.12.2
urllib3                   2.3.0
wheel                     0.45.1
wpilib                    2025.3.2.0                /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages

@virtuald
Copy link
Member

virtuald commented Apr 8, 2025

The error you're getting has to do with a quirk of how macOS support is implemented. What it comes down to is that you need to have all robotpy wrapper dependencies installed the same way (either via develop or installed normally). If you mix it then you sometimes get weird errors like that.

Typically, I use virtualenv (and specifically, virtualenvwrapper) to manage my various python development environments. I don't recommend that normal RobotPy users use virtualenvs unless they're comfortable with them, but they're really useful for python development -- and because they're effectively disposable, you can do a lot of weird changes in one environment without worrying too much about how much you're breaking. Specifically, I have different environments set up for installation from pypi, development, and various branches that I might be working on. If you were using a virtualenv, I would just say delete your virtualenv and start installing packages from scratch.

If you're not using a virtualenv, then just uninstall all robotpy-* packages and wpilib and pyntcore, and then run develop again.

@MikeStitt
Copy link
Collaborator Author

I normally use python3 -m venv .venv, but I made a run without it using my macos python environment.

When I re-ran that in an empty .venv, I ended up with the same family of errors.

My conclusion is the robotpy-rev is not compatible with ./rdev.sh develop

More basic though is that https://github.com/robotpy/mostrobotpy/blob/main/README.md should define the relationship (what they do and where they are and how to find instructions to build/install them) between pc robotpy, the robotpy that get's create by mostrobotpy, which I assume is roborio robotpy, and mostrobotpy.

Also more basic is that https://github.com/robotpy/mostrobotpy/blob/main/README.md should define when to run:

python3 -m pip install robotpy relative to

pip install -r rdev_requirements.txt
pip install numpy

and

./rdev.sh ci run

and

./rdev.sh develop

and the command to python -m pip uninstall -r somefilename.txt to fix up python modules that are installed by python3 -m pip install robotpy but need to be removed before ./rdev.sh develop

then the installation instructions should take one all the way to a git clone of a robotpy project that supports a working:

robotpy sim

@virtuald
Copy link
Member

virtuald commented Apr 8, 2025

My conclusion is the robotpy-rev is not compatible with ./rdev.sh develop

Yes and no.

As mentioned above:

The error you're getting has to do with a quirk of how macOS support is implemented. What it comes down to is that you need to have all robotpy wrapper dependencies installed the same way (either via develop or installed normally). If you mix it then you sometimes get weird errors like that.

What this means is that if you are installing the base robotpy packages in develop mode, you must also install robotpy-rev, ctre, etc in develop mode. To install robotpy-rev, you would need to git clone the repo, and then run python setup.py develop. This only applies to macOS -- on Linux you would be able to pip install robotpy-rev and it would peacefully co-exist with your development install of the other robotpy components.

There might be a way out of the macOS problem by messing with the library name, but I haven't had time to look deeper into it.

I agree there should be more documentation. I also agree the installer scripts should be better to make this easier.

@MikeStitt
Copy link
Collaborator Author

I have been trying lots of different paths to build mostrobotpy editable on OSX, Debian, and Windows, on a full production robot code base in simulation.

Goal is to be able to run

robotpy sim

on real robot code.
Generally what I have been doing is to:

(I'm typing not cut and pasting so there may be some typo's here)

python -m venv .venv
. .venv/bin/activate
python -m pip install robotpy
git clone mostrobotpy_URL
cd mostrobotpy
python -m pip install -r rdev_requirements.txt
python -m pip install numpy
python -m pip install robotpy_build

# repeatably pip uninstall the repos that were installed by robotpy that need to be uninstalled for a develop build to work until none are installed

#export the env variables to run ccache and multiple processors
./rdev.sh develop
cd ..
git clone robotpy-rev_URL
cd robotpy-rev
python setup.py develop

I end up with two copies of many of the repos needed in the system:

(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable/robotpy-rev$ pip list
Package                  Version              Editable project location
------------------------ -------------------- --------------------------------------------------------------------------------------------------------------------------------------------------
black                    25.1.0
certifi                  2025.1.31
charset-normalizer       3.4.1
click                    8.1.8
cxxheaderparser          1.4.1
distro                   1.9.0
idna                     3.10
iniconfig                2.1.0
mypy-extensions          1.0.0
numpy                    2.2.4
packaging                24.2
patch                    1.16
pathspec                 0.12.1
pcpp                     1.30
pip                      23.0.1
platformdirs             4.3.7
pluggy                   1.5.0
pybind11-stubgen         2.5.3
pydantic                 1.10.21
pyntcore                 2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/pyntcore-2025.3.2.0-py3.11-linux-aarch64.egg
pyntcore                 0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/pyntcore
pytest                   8.3.5
PyYAML                   6.0.2
requests                 2.32.3
robotpy                  2025.3.2.0
robotpy-apriltag         0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-apriltag
robotpy-build            2025.1.0
robotpy-cli              2024.0.0
robotpy-cscore           0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-cscore
robotpy-hal              2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/robotpy_hal-2025.3.2.0-py3.11-linux-aarch64.egg
robotpy-hal              0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-hal
robotpy-halsim-ds-socket 0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-halsim-ds-socket
robotpy-halsim-gui       0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-halsim-gui
robotpy-halsim-ws        0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-halsim-ws
robotpy-rev              2025.0.3             /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/robotpy-rev
robotpy-romi             0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-romi
robotpy-wpilib-utilities 2025.0.0
robotpy-wpimath          2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/robotpy_wpimath-2025.3.2.0-py3.11-linux-aarch64.egg
robotpy-wpimath          0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpimath
robotpy-wpinet           2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/robotpy_wpinet-2025.3.2.0-py3.11-linux-aarch64.egg
robotpy-wpinet           0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpinet
robotpy-wpiutil          2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/robotpy_wpiutil-2025.3.2.0-py3.11-linux-aarch64.egg
robotpy-wpiutil          0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpiutil
robotpy-xrp              0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-xrp
setuptools               66.1.1
setuptools-scm           7.1.0
sphinxify                0.12
tomli                    2.2.1
tomli_w                  1.2.0
tomlkit                  0.13.2
toposort                 1.10
trpbe                    2025.0.1             /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable
typing_extensions        4.13.2
urllib3                  2.4.0
wheel                    0.45.1
wpilib                   2025.3.2.0           /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/.venv/lib/python3.11/site-packages/wpilib-2025.3.2.0-py3.11-linux-aarch64.egg
wpilib                   0.1.dev3180+g21bab63 /home/mikes/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpilib

I can uninstall those with pip unstinall repo==version commands.

But then I need to install a specific version of photonlibpy:

python -m pip install photonlibpy==version

which will then also uninstalls the editable development parts of robotpy

Note that I have been automating these steps here: https://github.com/MikeStitt/pythonExperiments/tree/main/tryRobotPyBuildEditable

But as I search online for ways to tell pip to install libraries without overwriting existing editable or development libraries, it seems like I might not be following normal development practices, and there are not easy ways to keep pip from overwriting editable development libaries as more tools get installed.

This seems to be the same on debian, and osx, (I haven't got my windows build to complete yet).

Thoughts on a valid development/debugging/testing installation process?

-Mike

@virtuald
Copy link
Member

virtuald commented Apr 15, 2025

The multiple package problem is likely caused by pip. I note that you have 23.1 installed, try upgrading.

The version numbers for your editable installs are 0.1.dev3180+g21bab63... which is really really weird. I would have expected them to start with the latest tag. This might be either pip, setuptools, or setuptools-scm causing a problem (or perhaps you don't have the full git history checked out?). I believe the version numbers for editable installs work fine for me at home, but I can't check now.

photonlibpy has a pinned dependency on >=2025.3.2, so when you pip install it, pip notices that the wrong version is installed (as noted above) and installs a newer one.

Telling pip to ignore dependencies (via --no-deps) is probably the only way to resolve this unless you can fix the version numbers on your editable installs. On the one hand, while this isn't recommended for general usage, in my opinion it's perfectly acceptable for a development environment where you're trying to control all the dependencies.

@virtuald
Copy link
Member

One last note, because I don't trust setuptools to do the right thing, I run python setup.py develop -N to make sure that it also doesn't try to install dependencies -- so I'd recommend that for your robotpy-rev install.

We will not be using setuptools next year, so hopefully some of that will go away.

@MikeStitt
Copy link
Collaborator Author

My windows builds using x64 Native Tools Command Prompt fail this way:

"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\mikestitt\documents\first\pythonexperiments\tryrobotpybuildeditable\mostrobotpy\subprojects\robotpy-wpiutil\wpiutil\lib /LIBPATH:c:\users\mikestitt\documents\first\pythonexperiments\tryrobotpybuildeditable\mostrobotpy\subprojects\robotpy-wpinet\wpinet\lib /LIBPATH:c:\users\mikestitt\documents\first\pythonexperiments\tryrobotpybuildeditable\mostrobotpy\subprojects\pyntcore\ntcore\lib /LIBPATH:build\temp.win-amd64-cpython-312\dlstatic\opencv_cpp\lib /LIBPATH:build\temp.win-amd64-cpython-312\dlstatic\cscore_cpp\lib /LIBPATH:build\temp.win-amd64-cpython-312\dlstatic\cameraserver_cpp\lib /LIBPATH:C:\Users\MikeStitt\Documents\first\pythonExperiments\tryRobotPyBuildEditable\.venvTrpbe\libs /LIBPATH:C:\Users\MikeStitt\AppData\Local\Programs\Python\Python312\libs /LIBPATH:C:\Users\MikeStitt\AppData\Local\Programs\Python\Python312 /LIBPATH:C:\Users\MikeStitt\Documents\first\pythonExperiments\tryRobotPyBuildEditable\.venvTrpbe\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64" cameraserver.lib cscore.lib opencv480.lib ntcore.lib wpinet.lib wpiutil.lib /EXPORT:PyInit__cscore build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\CameraServer.obj build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\cscore_cpp.obj build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\cscore_cv.obj build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\cscore_oo.obj build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\cscore_runloop.obj build\temp.win-amd64-cpython-312\Release\cscore\cvnp\cvnp.obj build\temp.win-amd64-cpython-312\Release\cscore\cvnp\cvnp_synonyms.obj build\temp.win-amd64-cpython-312\Release\cscore\src\main.obj /OUT:build\lib.win-amd64-cpython-312\cscore\_cscore.cp312-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\_cscore.cp312-win_amd64.lib
   Creating library build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\_cscore.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\build\temp.win-amd64-cpython-312\gensrc\cscore\_cscore.cp312-win_amd64.exp
cscore.lib(cscore_cpp.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for_unchecked
cscore.lib(HttpCameraImpl.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for_unchecked
cscore.lib(SourceImpl.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for_unchecked
cscore.lib(Telemetry.obj) : error LNK2001: unresolved external symbol _Cnd_timedwait_for_unchecked
cscore.lib(RawSinkImpl.obj) : error LNK2001: unresolved external symbol _Thrd_sleep_for
cscore.lib(HttpCameraImpl.obj) : error LNK2001: unresolved external symbol _Thrd_sleep_for
cscore.lib(MjpegServerImpl.obj) : error LNK2001: unresolved external symbol _Thrd_sleep_for
cscore.lib(MjpegServerImpl.obj) : error LNK2001: unresolved external symbol __std_search_1
build\lib.win-amd64-cpython-312\cscore\_cscore.cp312-win_amd64.pyd : fatal error LNK1120: 3 unresolved externals
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120

@virtuald
Copy link
Member

That error seems really familiar, I think we ran into it last year? I don't use Windows at all these days.

I think you need to upgrade Visual Studio... according to this CD post you need 17.9 or later?

@MikeStitt
Copy link
Collaborator Author

This feels like a silly question, really bad planning on my part.

But in debian bookworm I get:

mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ rm -rf .venv
mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ python -m venv .venv
mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ . .venv/bin/activate
(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ robotpy --help
bash: robotpy: command not found
(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ python -m pip cache purge
Files removed: 18
(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ python -m pip install robotpy
Collecting robotpy
  Downloading robotpy-2025.3.2.0-py3-none-any.whl (2.2 kB)
Collecting robotpy-wpiutil==2025.3.2.0
  Downloading robotpy_wpiutil-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (3.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 8.7 MB/s eta 0:00:00
Collecting robotpy-wpinet==2025.3.2.0
  Downloading robotpy_wpinet-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (748 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 749.0/749.0 kB 13.5 MB/s eta 0:00:00
Collecting robotpy-wpimath==2025.3.2.0
  Downloading robotpy_wpimath-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 17.9 MB/s eta 0:00:00
Collecting pyntcore==2025.3.2.0
  Downloading pyntcore-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 25.2 MB/s eta 0:00:00
Collecting robotpy-hal==2025.3.2.0
  Downloading robotpy_hal-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 27.7 MB/s eta 0:00:00
Collecting wpilib==2025.3.2.0
  Downloading wpilib-2025.3.2.0-cp311-cp311-manylinux_2_36_aarch64.whl (5.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.3/5.3 MB 30.4 MB/s eta 0:00:00
Collecting robotpy-wpilib-utilities<2026.0.0,>=2025.0.0
  Downloading robotpy_wpilib_utilities-2025.0.0-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.0/49.0 kB 17.8 MB/s eta 0:00:00
Collecting robotpy-cli<2026.0.0,>=2024.0.0
  Downloading robotpy_cli-2024.0.0-py3-none-any.whl (8.9 kB)
Installing collected packages: robotpy-wpiutil, robotpy-cli, robotpy-wpinet, robotpy-wpimath, robotpy-hal, pyntcore, wpilib, robotpy-wpilib-utilities, robotpy
Successfully installed pyntcore-2025.3.2.0 robotpy-2025.3.2.0 robotpy-cli-2024.0.0 robotpy-hal-2025.3.2.0 robotpy-wpilib-utilities-2025.0.0 robotpy-wpimath-2025.3.2.0 robotpy-wpinet-2025.3.2.0 robotpy-wpiutil-2025.3.2.0 wpilib-2025.3.2.0
(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ robotpy --help
usage: robotpy [-h] [--main MAIN_FILE] [-v] [--ignore-plugin-errors] {run} ...

RobotPy CLI. See below for subcommands to accomplish various tasks for your robot project.

positional arguments:
  {run}                 subcommands
    run                 Executes the robot code using the currently installed HAL (this is probably not what you want unless you're on the
                        roboRIO)

options:
  -h, --help            show this help message and exit
  --main MAIN_FILE      The file that contains your main robot class
  -v, --verbose         Enable debug logging
  --ignore-plugin-errors
                        Ignore errors caused by RobotPy plugins (probably should fix or replace instead!)
(.venv) mikes@debian-12:~/first/pythonExperiments/tryRobotPyBuildEditable$ 


Debian bookworm doesn't support robotpy sim?

@virtuald
Copy link
Member

WPILib does not support simulation on linux/aarch64

@virtuald
Copy link
Member

Actually, that doesn't seem to be true anymore, https://frcmaven.wpi.edu/ui/native/release/edu/wpi/first/halsim/halsim_gui/2025.3.2/ shows aarch64 packages. We would need to update mostrobotpy to build them and update the robotpy-meta constraints.

@auscompgeek
Copy link
Member

auscompgeek commented Apr 17, 2025

I thought we do build it, it's just that by default robotpy-meta doesn't install the sim stuff on Linux aarch64?

@MikeStitt
Copy link
Collaborator Author

MikeStitt commented Apr 18, 2025

I have found a route to simulate a full robot with mostrobotpy editable on a OSX M3 Mac:

First install ccache

Then:

git clone [email protected]:MikeStitt/pythonExperiments.git
cd pythonExperiments
cd tryRobotPyBuildEditable
deactivate ; rm -rf .venvTryRobotPyBuildEditable mostrobotpy mostRobotPySpires2025 robotpy-rev ; python3 -m venv .venvTryRobotPyBuildEditable ; . .venvTryRobotPyBuildEditable/bin/activate ; pip install -e . ; 

Python click module does most of the heavy lifting:

trpbe --quiet --toml trpbeConfigMikeStitt.toml doeditable

Which runs these commands:

command=git clone [email protected]:MikeStitt/mostrobotpy.git mostrobotpy
command=git -C mostrobotpy checkout pyIterativeAndTimedRobot
command=git clone https://github.com/robotpy/robotpy-rev robotpy-rev
command=git -C robotpy-rev checkout main
command=git clone [email protected]:spiresfrc9106/spiresRobot2025.git mostRobotPySpires2025
command=git -C mostRobotPySpires2025 checkout exp-timedrobotpy
command=pip install robotpy
command=cd mostrobotpy
command=pip install -r rdev_requirements.txt
command=pip install numpy
command=cd ..
command=pip install robotpy-build
command=cd mostRobotPySpires2025
command=python -m robotpy sync
command=cd ..
command=pip list --format json
command=pip uninstall -y robotpy-cscore
command=pip uninstall -y robotpy-wpinet
command=pip uninstall -y robotpy-apriltag
command=pip uninstall -y pyntcore
command=pip uninstall -y robotpy-wpiutil
command=pip uninstall -y robotpy-hal
command=pip uninstall -y robotpy-wpimath
command=pip uninstall -y wpilib
command=pip uninstall -y robotpy-halsim-gui
command=pip uninstall -y robotpy-rev
command=pip list --format json
command=cd mostrobotpy
command=python -m devtools develop
command=cd ..
command=cd robotpy-rev
command=python setup.py develop -N
command=cd ..

Then:

cd mostRobotPySpires2025
robotpy sim

Things that were not obvious were:

  • robotpy is a separate tool from mostrobotpy
  • Don't run /rdev.sh ci run because it builds and installs mostrobotpy and we don't want mostrobotpy installed when in development mode
  • If one doesn't run /rdev.sh ci run one needs to pip install robotpy-build in order for the build editable to work.
  • It's best to use robotpy sync to get all of the libaries synced for the robotpy sim before building mostrbootpy because robotpy sync and most pip installs will overwrite the editable mostrobotpy
  • That the libaries that are built editable need to be uninstalled prior to building them editable (this is a basic truth in python development)
  • That it's wise to repeatedly uninstall all the editable libraries until none are installed because sometimes one might have multilibraries installed with the same name
  • That robotpy-rev should be built: python setup.py develop -N with the -N to keep it from replacing other editable libraries.
  • That x64 linux and the intel Mac or M3 Mac are supported for building and simulating robotpy editable. x64 windows might be supported based upon a chief delphi post. linux/aarch64 is supported for building editable but not quite supported for simulation.

@auscompgeek
Copy link
Member

linux/aarch64 is supported for building editable but not quite supported for simulation.

Simulation should work fine on Linux aarch64. I've run the simulation for the examples on my Raspberry Pi 400.

@MikeStitt
Copy link
Collaborator Author

linux/aarch64 is supported for building editable but not quite supported for simulation.

Simulation should work fine on Linux aarch64. I've run the simulation for the examples on my Raspberry Pi 400.

I created this issue to document where we are currently at: robotpy/robotpy-meta#33

Signed-off-by: Mike Stitt <[email protected]>
@MikeStitt
Copy link
Collaborator Author

Now that this test passes on my machine: subprojects/robotpy-wpilib/tests/test_timedrobot.py which just tests the scheduling math to schedule the future periodic callbacks, I'm fairly confident that the code is pretty close to working correctly.

Perhaps @virtuald or @auscompgeek have suggestions on how to connect existing functional tests to this code?

@virtuald
Copy link
Member

virtuald commented May 1, 2025

Well. There really aren't any python functional tests for this -- we're pretty light on testing since the wrapper stuff tends to Just Work if it compiles. The examples repo does full-robot tests -- eventually I'd like to run those tests as part of the CI for this repo, but haven't gotten around to it.

It would probably make sense to port the tests in allwpilib from Java or C++ to python, assuming they exist. ChatGPT might give you a good first translation of them.

Signed-off-by: Mike Stitt <[email protected]>
@MikeStitt
Copy link
Collaborator Author

Is there a spot in the existing robotpy code base that is equivalent to this line?

https://github.com/wpilibsuite/allwpilib/blob/e63899e63af065eb326bdbb2cf1457cf27433bd9/wpilibc/src/test/native/cpp/TimedRobotTest.cpp#L88

In the existing robotpy code base is the thread a c++ thread or a python thread?

I’m hoping to not have pave new ground in the threading model of the new test.

@virtuald
Copy link
Member

virtuald commented May 2, 2025

pyfrc likely does all the things already: https://github.com/robotpy/pyfrc/blob/main/pyfrc/test_support/controller.py

@MikeStitt
Copy link
Collaborator Author

pyfrc likely does all the things already: https://github.com/robotpy/pyfrc/blob/main/pyfrc/test_support/controller.py

From that hint, I made a PoC that uses pytest to start to test to TImedRobotPy.

On this branch: https://github.com/MikeStitt/mostrobotpy/tree/pocTimedRobotFunctionalTests

I added this file:

https://github.com/MikeStitt/mostrobotpy/blob/pocTimedRobotFunctionalTests/subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py

I arrived at it by deconstructing https://github.com/robotpy/pyfrc/blob/main/pyfrc/test_support/pytest_plugin.py
so that it is not longer a plugin but a class that provides fixtures.

to run the test, seeing the print statements:

pytest subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py --no-header -vvv -s

Results in:

================================================================================== test session starts ==================================================================================
collected 2 items                                                                                                                                                                       

subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py::TestThings::test_iterative Not loading CameraServerShared
********** Robot program startup complete **********
Default simulationPeriodic() method...Override me!
PASSED
subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py::TestThings::test_iterative_again Not loading CameraServerShared
********** Robot program startup complete **********
Default simulationPeriodic() method...Override me!
PASSED

=================================================================================== warnings summary ====================================================================================
../.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/pyfrc/test_support/controller.py:10
  /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/pyfrc/test_support/controller.py:10: PytestCollectionWarning: cannot collect test class 'TestController' because it has a __init__ constructor (from: tests/test_poc_timedrobot.py)
    class TestController:

subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py:24
  /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py:24: PytestCollectionWarning: cannot collect test class 'MyRobot' because it has a __init__ constructor (from: tests/test_poc_timedrobot.py)
    class MyRobot(TimedRobotPy):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= 2 passed, 2 warnings in 0.19s =============================================================================

I like that the test will fit into the test infrastructure by just running pytest

I don't like that it is not very DRY in that it is essentially doing very similar things as pytest_plugin.py in different code.

I suspect that we could take all of the refernces to physics out of the test when testing TimedRobotPy, so the tests would stop searching for a physics.py and test robots would be defined in the test files.

What do we think the best architectural way to go would be, given the existing robotpy infrastructure:

Use a version of pytest_plugin.py and call the tests from pytest.main()?
Make a new plugin and call tests from pytest.main()?

Continue to deconstruct pytest_plugin.py as something that provides fixtures and test using pytest without a plugin?

Some other permutation?

@virtuald
Copy link
Member

virtuald commented May 3, 2025

I think you're on the right track.

The pyfrc tests do a lot more than what's required for these tests. In particular, there's no need for physics or commands v2 stuff, no need to run an entire match, and likely not a lot of need to do a lot of the reset-related actions that it does.

What I would recommend is create fixtures that do the minimum needed to accomplish what the java tests do, and put those fixtures in conftest.py so they can be shared among various test files in this project.

@virtuald
Copy link
Member

virtuald commented May 3, 2025

I think the primary usefulness of the pyfrc plugin for this work is that it shows you where all the various functions are to do timing, reset, etc, so don't worry too much about DRY here since these tests and the pyfrc tests have very different purposes.

@MikeStitt
Copy link
Collaborator Author

@virtuald

I seem to have lost the recipe to build mostrobotpy editable. Perhaps you can figure out what is wrong.

mikestitt@peas tryRobotPyBuildEditable % python3 -m pip cache purge
WARNING: No matching packages
Files removed: 0 (0 bytes)
mikestitt@peas tryRobotPyBuildEditable % rm -rf .venvTryRobotPyBuildEditable ; python3 -m venv .venvTryRobotPyBuildEditable ; . .venvTryRobotPyBuildEditable/bin/activate ; python -m pip install --upgrade pip;
Requirement already satisfied: pip in ./.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-25.1.1-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-25.1.1-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 9.3 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-25.1.1
(.venvTryRobotPyBuildEditable) mikestitt@peas tryRobotPyBuildEditable % cd mostrobotpy 
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % git describe
fatal: No annotated tags can describe 'eeb854141921ab533b8c37d8e448f03e80e10a5a'.
However, there were unannotated tags: try --tags.
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % python -m pip install -r rdev_requirements.txt 
Collecting black (from -r rdev_requirements.txt (line 1))
  Downloading black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (81 kB)
Collecting click (from -r rdev_requirements.txt (line 2))
  Downloading click-8.2.0-py3-none-any.whl.metadata (2.5 kB)
Collecting packaging (from -r rdev_requirements.txt (line 3))
  Downloading packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
Collecting pydantic!=1.10.20,<2 (from -r rdev_requirements.txt (line 4))
  Downloading pydantic-1.10.22-cp312-cp312-macosx_11_0_arm64.whl.metadata (154 kB)
Collecting pytest (from -r rdev_requirements.txt (line 5))
  Downloading pytest-8.3.5-py3-none-any.whl.metadata (7.6 kB)
Collecting requests (from -r rdev_requirements.txt (line 6))
  Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting setuptools (from -r rdev_requirements.txt (line 7))
  Downloading setuptools-80.4.0-py3-none-any.whl.metadata (6.5 kB)
Collecting setuptools_scm<8,>=6.2 (from -r rdev_requirements.txt (line 8))
  Downloading setuptools_scm-7.1.0-py3-none-any.whl.metadata (24 kB)
Collecting tomlkit (from -r rdev_requirements.txt (line 9))
  Downloading tomlkit-0.13.2-py3-none-any.whl.metadata (2.7 kB)
Collecting tomli (from -r rdev_requirements.txt (line 10))
  Downloading tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (11 kB)
Collecting toposort (from -r rdev_requirements.txt (line 11))
  Downloading toposort-1.10-py3-none-any.whl.metadata (4.1 kB)
Collecting wheel (from -r rdev_requirements.txt (line 12))
  Downloading wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
Collecting typing-extensions>=4.2.0 (from pydantic!=1.10.20,<2->-r rdev_requirements.txt (line 4))
  Downloading typing_extensions-4.13.2-py3-none-any.whl.metadata (3.0 kB)
Collecting mypy-extensions>=0.4.3 (from black->-r rdev_requirements.txt (line 1))
  Downloading mypy_extensions-1.1.0-py3-none-any.whl.metadata (1.1 kB)
Collecting pathspec>=0.9.0 (from black->-r rdev_requirements.txt (line 1))
  Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
Collecting platformdirs>=2 (from black->-r rdev_requirements.txt (line 1))
  Downloading platformdirs-4.3.8-py3-none-any.whl.metadata (12 kB)
Collecting iniconfig (from pytest->-r rdev_requirements.txt (line 5))
  Downloading iniconfig-2.1.0-py3-none-any.whl.metadata (2.7 kB)
Collecting pluggy<2,>=1.5 (from pytest->-r rdev_requirements.txt (line 5))
  Downloading pluggy-1.5.0-py3-none-any.whl.metadata (4.8 kB)
Collecting charset-normalizer<4,>=2 (from requests->-r rdev_requirements.txt (line 6))
  Downloading charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests->-r rdev_requirements.txt (line 6))
  Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests->-r rdev_requirements.txt (line 6))
  Downloading urllib3-2.4.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests->-r rdev_requirements.txt (line 6))
  Downloading certifi-2025.4.26-py3-none-any.whl.metadata (2.5 kB)
Downloading pydantic-1.10.22-cp312-cp312-macosx_11_0_arm64.whl (2.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 19.6 MB/s eta 0:00:00
Downloading setuptools_scm-7.1.0-py3-none-any.whl (43 kB)
Downloading black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 30.6 MB/s eta 0:00:00
Downloading click-8.2.0-py3-none-any.whl (102 kB)
Downloading packaging-25.0-py3-none-any.whl (66 kB)
Downloading pytest-8.3.5-py3-none-any.whl (343 kB)
Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
Downloading requests-2.32.3-py3-none-any.whl (64 kB)
Downloading charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl (199 kB)
Downloading idna-3.10-py3-none-any.whl (70 kB)
Downloading urllib3-2.4.0-py3-none-any.whl (128 kB)
Downloading setuptools-80.4.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 29.3 MB/s eta 0:00:00
Downloading tomlkit-0.13.2-py3-none-any.whl (37 kB)
Downloading tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl (123 kB)
Downloading toposort-1.10-py3-none-any.whl (8.5 kB)
Downloading wheel-0.45.1-py3-none-any.whl (72 kB)
Downloading certifi-2025.4.26-py3-none-any.whl (159 kB)
Downloading mypy_extensions-1.1.0-py3-none-any.whl (5.0 kB)
Downloading pathspec-0.12.1-py3-none-any.whl (31 kB)
Downloading platformdirs-4.3.8-py3-none-any.whl (18 kB)
Downloading typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Downloading iniconfig-2.1.0-py3-none-any.whl (6.0 kB)
Installing collected packages: toposort, wheel, urllib3, typing-extensions, tomlkit, tomli, setuptools, pluggy, platformdirs, pathspec, packaging, mypy-extensions, iniconfig, idna, click, charset-normalizer, certifi, setuptools_scm, requests, pytest, pydantic, black
Successfully installed black-25.1.0 certifi-2025.4.26 charset-normalizer-3.4.2 click-8.2.0 idna-3.10 iniconfig-2.1.0 mypy-extensions-1.1.0 packaging-25.0 pathspec-0.12.1 platformdirs-4.3.8 pluggy-1.5.0 pydantic-1.10.22 pytest-8.3.5 requests-2.32.3 setuptools-80.4.0 setuptools_scm-7.1.0 tomli-2.2.1 tomlkit-0.13.2 toposort-1.10 typing-extensions-4.13.2 urllib3-2.4.0 wheel-0.45.1
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % python -m pip install numpy
Collecting numpy
  Downloading numpy-2.2.5-cp312-cp312-macosx_14_0_arm64.whl.metadata (62 kB)
Downloading numpy-2.2.5-cp312-cp312-macosx_14_0_arm64.whl (5.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 27.3 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-2.2.5
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % rdev.sh develop
zsh: command not found: rdev.sh
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % ./rdev.sh develop 
+ /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/bin/python3 setup.py develop -N
Traceback (most recent call last):
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpiutil/setup.py", line 3, in <module>
    from robotpy_build.setup import setup
ModuleNotFoundError: No module named 'robotpy_build'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/__main__.py", line 75, in <module>
    main()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/decorators.py", line 46, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/__main__.py", line 55, in develop
    project.develop()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/subproject.py", line 54, in develop
    self._cmd(
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/subproject.py", line 39, in _cmd
    subprocess.check_call(args, cwd=cwd)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/bin/python3', 'setup.py', 'develop', '-N')' returned non-zero exit status 1.
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % python -m pip install robotpy-build 
Collecting robotpy-build
  Downloading robotpy_build-2025.1.1-py3-none-any.whl.metadata (2.1 kB)
Collecting cxxheaderparser~=1.4.1 (from cxxheaderparser[pcpp]~=1.4.1->robotpy-build)
  Downloading cxxheaderparser-1.4.1-py3-none-any.whl.metadata (4.7 kB)
Collecting delocate (from robotpy-build)
  Downloading delocate-0.13.0-py3-none-any.whl.metadata (15 kB)
Collecting patch==1.* (from robotpy-build)
  Downloading patch-1.16.zip (12 kB)
  Preparing metadata (setup.py) ... done
Collecting pybind11-stubgen~=2.5.1 (from robotpy-build)
  Downloading pybind11_stubgen-2.5.3-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: pydantic!=1.10.20,<2,>=1.7.0 in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (1.10.22)
Collecting pyyaml>=5.1 (from robotpy-build)
  Downloading PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (2.1 kB)
Requirement already satisfied: setuptools-scm<8,>=6.2 in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (7.1.0)
Requirement already satisfied: setuptools>=45 in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (80.4.0)
Collecting sphinxify>=0.7.3 (from robotpy-build)
  Downloading sphinxify-0.12-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: tomli in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (2.2.1)
Collecting tomli-w (from robotpy-build)
  Downloading tomli_w-1.2.0-py3-none-any.whl.metadata (5.7 kB)
Requirement already satisfied: toposort in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (1.10)
Requirement already satisfied: typing-extensions in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from robotpy-build) (4.13.2)
Collecting pcpp~=1.30 (from cxxheaderparser[pcpp]~=1.4.1->robotpy-build)
  Downloading pcpp-1.30-py2.py3-none-any.whl.metadata (23 kB)
Requirement already satisfied: packaging>=20.0 in /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages (from setuptools-scm<8,>=6.2->robotpy-build) (25.0)
Collecting macholib (from delocate->robotpy-build)
  Downloading macholib-1.16.3-py2.py3-none-any.whl.metadata (11 kB)
Collecting altgraph>=0.17 (from macholib->delocate->robotpy-build)
  Downloading altgraph-0.17.4-py2.py3-none-any.whl.metadata (7.3 kB)
Downloading robotpy_build-2025.1.1-py3-none-any.whl (326 kB)
Downloading cxxheaderparser-1.4.1-py3-none-any.whl (58 kB)
Downloading pcpp-1.30-py2.py3-none-any.whl (91 kB)
Downloading pybind11_stubgen-2.5.3-py3-none-any.whl (29 kB)
Downloading PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl (173 kB)
Downloading sphinxify-0.12-py3-none-any.whl (7.0 kB)
Downloading delocate-0.13.0-py3-none-any.whl (238 kB)
Downloading macholib-1.16.3-py2.py3-none-any.whl (38 kB)
Downloading altgraph-0.17.4-py2.py3-none-any.whl (21 kB)
Downloading tomli_w-1.2.0-py3-none-any.whl (6.7 kB)
Building wheels for collected packages: patch
  DEPRECATION: Building 'patch' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'patch'. Discussion can be found at https://github.com/pypa/pip/issues/6334
  Building wheel for patch (setup.py) ... done
  Created wheel for patch: filename=patch-1.16-py3-none-any.whl size=12413 sha256=c01182f6a1aaf086037b4d3a798bfbf59ecb67a176f00d2bc6b84783f1352c14
  Stored in directory: /Users/mikestitt/Library/Caches/pip/wheels/18/66/34/db58f0543e6a38258bf7e3c5829f8edd02107cd1334d82e0a0
Successfully built patch
Installing collected packages: pcpp, patch, altgraph, tomli-w, sphinxify, pyyaml, pybind11-stubgen, macholib, cxxheaderparser, delocate, robotpy-build
Successfully installed altgraph-0.17.4 cxxheaderparser-1.4.1 delocate-0.13.0 macholib-1.16.3 patch-1.16 pcpp-1.30 pybind11-stubgen-2.5.3 pyyaml-6.0.2 robotpy-build-2025.1.1 sphinxify-0.12 tomli-w-1.2.0
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % ./rdev.sh develop                  
+ /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/bin/python3 setup.py develop -N
running develop
/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:90: DevelopDeprecationWarning: develop command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``develop``.
        Instead, use standards-based tools like pip or uv.

        By 2025-Oct-31, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
Traceback (most recent call last):
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/subprojects/robotpy-wpiutil/setup.py", line 5, in <module>
    setup()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/robotpy_build/setup.py", line 241, in setup
    s.run()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/robotpy_build/setup.py", line 235, in run
    _setup(**self.setup_kwargs)
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
    dist.run_commands()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
    self.run_command(cmd)
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/dist.py", line 1106, in run_command
    super().run_command(command)
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
    cmd_obj.run()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/robotpy_build/command/develop.py", line 7, in run
    self.distribution.rpybuild_develop_path = abspath(self.egg_base)
                                                      ^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 131, in __getattr__
    raise AttributeError(attr)
AttributeError: egg_base
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/__main__.py", line 75, in <module>
    main()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/lib/python3.12/site-packages/click/decorators.py", line 46, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/__main__.py", line 55, in develop
    project.develop()
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/subproject.py", line 54, in develop
    self._cmd(
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostrobotpy/devtools/subproject.py", line 39, in _cmd
    subprocess.check_call(args, cwd=cwd)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/bin/python3', 'setup.py', 'develop', '-N')' returned non-zero exit status 1.
(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % 

@MikeStitt
Copy link
Collaborator Author

(.venvTryRobotPyBuildEditable) mikestitt@peas mostrobotpy % pip list
Package            Version
------------------ ---------
altgraph           0.17.4
black              25.1.0
certifi            2025.4.26
charset-normalizer 3.4.2
click              8.2.0
cxxheaderparser    1.4.1
delocate           0.13.0
idna               3.10
iniconfig          2.1.0
macholib           1.16.3
mypy_extensions    1.1.0
numpy              2.2.5
packaging          25.0
patch              1.16
pathspec           0.12.1
pcpp               1.30
pip                25.1.1
platformdirs       4.3.8
pluggy             1.5.0
pybind11-stubgen   2.5.3
pydantic           1.10.22
pytest             8.3.5
PyYAML             6.0.2
requests           2.32.3
robotpy-build      2025.1.1
setuptools         80.4.0
setuptools-scm     7.1.0
sphinxify          0.12
tomli              2.2.1
tomli_w            1.2.0
tomlkit            0.13.2
toposort           1.10
typing_extensions  4.13.2
urllib3            2.4.0
wheel              0.45.1

@virtuald
Copy link
Member

It appears that robotpy-build is depending on an undocumented feature of setuptools. If you downgrade setuptools that should address the issue.

The next version of robotpy-build (renamed to 'semiwrap') will no longer use setuptools (and can be significantly faster too!). mostrobotpy now builds successfully with that (see #170), I expect to merge and push all of that sometime this week.

@MikeStitt
Copy link
Collaborator Author

@virtuald Thanks!. setuptools < 80.0 did the trick.

MikeStitt added 4 commits May 12, 2025 11:27
Signed-off-by: Mike Stitt <[email protected]>
Signed-off-by: Mike Stitt <[email protected]>
Signed-off-by: Mike Stitt <[email protected]>
Signed-off-by: Mike Stitt <[email protected]>
@MikeStitt
Copy link
Collaborator Author

During my testing, I have been getting a little wrapped around the axle about how many times and when "endCompetition" should be called.

In this test case: https://github.com/MikeStitt/mostrobotpy/blob/pyIterativeAndTimedRobot/subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py#L541

We run through the init, exit, and periodic methods while entering and exiting autonomous with no faults.

I based the code to simulate a robot based upon pyfrc.

subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py::TestCanThrowExceptions::test_robot_mode_with_exceptions[MyRobotRobotDefaultPass-TimedRobotPyDoNotExpectException-True-True-False] Not loading CameraServerShared
Enter:startCompetition at 0.000
Enter:robotInit at 0.000
Exit_:robotInit at 0.000
Enter:_simulationInit at 0.000
Exit_:_simulationInit at 0.000
********** Robot program startup complete **********
periodS=0.02 or 0.03
Enter:disabledInit at 0.020
Exit_:disabledInit at 0.020
Enter:disabledPeriodic at 0.020
Exit_:disabledPeriodic at 0.020
Enter:robotPeriodic at 0.020
Exit_:robotPeriodic at 0.020
Enter:_simulationPeriodic at 0.020
Exit_:_simulationPeriodic at 0.020
Enter:disabledExit at 0.040
Exit_:disabledExit at 0.040
Enter:autonomousInit at 0.040
Exit_:autonomousInit at 0.040
Enter:autonomousPeriodic at 0.040
Exit_:autonomousPeriodic at 0.040
Enter:robotPeriodic at 0.040
Exit_:robotPeriodic at 0.040
Enter:_simulationPeriodic at 0.040
Exit_:_simulationPeriodic at 0.040
Enter:autonomousExit at 0.060
Exit_:autonomousExit at 0.060
Enter:disabledInit at 0.060
Exit_:disabledInit at 0.060
Enter:disabledPeriodic at 0.060
Exit_:disabledPeriodic at 0.060
Enter:robotPeriodic at 0.060
Exit_:robotPeriodic at 0.060
Enter:_simulationPeriodic at 0.060
Exit_:_simulationPeriodic at 0.060
run_robot is calling endCompetition()
Enter:endCompetition at 0.070
Exit_:endCompetition at 0.070
TimedRobotPyExpectsException hasAssertionError=False
Exit_:startCompetition at 1.070
_robot_thread is calling endCompetition()
Enter:endCompetition at 1.070
Exit_:endCompetition at 1.070
PASSED

Note that there are calls to endCompetiton at 0.070 seconds and 1.070 seconds, before and after the exit of startCompetition.

I suspect that the order of the first endCompetition and the exit of startCompetition has something to do with how I instrumented startCompeition.

Later in the tests, I throw exceptions:

Default autonomousPeriodic() method...Override me!
TimedRobotPyExpectsException hasAssertionError=True
Exit_:startCompetition at 0.060
_robot_thread is calling endCompetition()
Enter:endCompetition at 0.060
Exit_:endCompetition at 0.060
run_robot is calling endCompetition()
Enter:endCompetition at 0.070
Exit_:endCompetition at 0.070
PASSED

endCompetition is still called twice, but the order is changed. Again, I suspect the order is a bit based upon how I instrumented the tests.

To try to understand the expected behavior of the system I moved the core code into a simple robot here: https://github.com/MikeStitt/pythonExperiments/tree/main/minTestRobot

running pyfrc_test.py on this robot yields:

obotpy test -- -vvvv --no-header -s tests/pyfrc_test.py::test_operator_control
13:27:06:295 INFO    : faulthandler        : registered SIGUSR2 for PID 91499
================================================================================== test session starts ==================================================================================
collected 1 item                                                                                                                                                                        

tests/pyfrc_test.py::test_operator_control <- .venvMinTestRobot/lib/python3.12/site-packages/pyfrc/tests/basic.py 13:27:06:438 INFO    : faulthandler        : registered SIGUSR2 for PID 91502
13:27:06:438 INFO    : pyfrc.physics       : Physics support successfully enabled
================================================================================== test session starts ==================================================================================
collected 2 items                                                                                                                                                                       

tests/pyfrc_test.py::test_operator_control <- .venvMinTestRobot/lib/python3.12/site-packages/pyfrc/tests/basic.py Not loading CameraServerShared
0.000:Enter:startCompetition
0.000:Enter:robotInit
0.000:Exit :robotInit

********** Robot program startup complete **********
0.020:Enter:disabledInit
0.020:Exit :disabledInit
0.020:Enter:disabledPeriodic
0.020:Exit :disabledPeriodic
0.020:Enter:robotPeriodic
0.020:Exit :robotPeriodic

<-snip->

0.600:Enter:disabledPeriodic
0.600:Exit :disabledPeriodic
0.600:Enter:robotPeriodic
0.600:Exit :robotPeriodic
0.620:Enter:disabledExit
0.620:Exit :disabledExit
Default TeleopPeriodic() method... Override me!
0.620:Enter:robotPeriodic

<-snip->

16.400:Enter:disabledPeriodic
16.400:Exit :disabledPeriodic
16.400:Enter:robotPeriodic
16.400:Exit :robotPeriodic
16.400:Enter:endCompetition
16.400:Exit :endCompetition
17.400:Exit :startCompetition
17.400:Enter:endCompetition
17.400:Exit :endCompetition
PASSED

=================================================================================== 1 passed in 0.02s ===================================================================================

Note the two calls to endCompetition.

Then running the same robot in simulation:

(.venvMinTestRobot) mikestitt@peas minTestRobot % robotpy sim
13:33:49:100 INFO    : faulthandler        : registered SIGUSR2 for PID 91673
13:33:49:101 INFO    : halsim_gui          : WPILib HAL Simulation 2025.3.2.1
HAL Extensions: Attempting to load: libhalsim_gui
Simulator GUI Initializing.
2025-05-14 13:33:49.514 Python[91673:19290362] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
Simulator GUI Initialized!
HAL Extensions: Successfully loaded extension
13:33:49:668 INFO    : pyfrc.physics       : Physics support successfully enabled
13:33:49:669 INFO    : wpilib              : RobotPy version 2025.3.2.1
13:33:49:669 INFO    : wpilib              : WPILib version 2025.3.2.1
13:33:49:669 INFO    : wpilib              : Running with simulated HAL.
13:33:49:670 INFO    : nt                  : Listening on NT3 port 1735, NT4 port 5810
Not loading CameraServerShared
0.642:Enter:startCompetition
0.642:Enter:robotInit
0.642:Exit :robotInit

********** Robot program startup complete **********
0.667:Enter:disabledInit
0.667:Exit :disabledInit
0.667:Enter:disabledPeriodic
0.667:Exit :disabledPeriodic
0.667:Enter:robotPeriodic
0.667:Exit :robotPeriodic

<-snip->

2.786:Enter:disabledPeriodic
2.786:Exit :disabledPeriodic
2.786:Enter:robotPeriodic
2.786:Exit :robotPeriodic
2.802:Enter:endCompetition
2.802:Exit :endCompetition
2.802:Exit :startCompetition
13:33:51:842 INFO    : robotpy             : Robot code exited
(.venvMinTestRobot) mikestitt@peas minTestRobot % 

Above there is only one call to endCompetition.

Should we standardize on how many times endCompetition is called?

Perhaps someone understands why the endCompetion prints are hitting the output before the
2.802:Exit :startCompetition ?

-Thanks
-Mike

@MikeStitt
Copy link
Collaborator Author

MikeStitt commented May 14, 2025

Two more questions:

  1. Does it make sense that robotpy would see fewer packages than python:

This is resolved on May 15, 2025.

Resolution to this question: What was happening is that I was using this command line to rebuild mostrobotpy editable:

deactivate ; rm -rf .venvTryRobotPyBuildEditable ; python3 -m venv .venvTryRobotPyBuildEditable ; . .venvTryRobotPyBuildEditable/bin/activate ; pip install --upgrade pip; pip install -e . ; trpbe --no-clone --toml trpbeConfigMikeStitt.toml doeditable

What was happening was that the above command was putting a new python and a new robotpy on my OS X, zsh path as well as re-adding .venvTryRobotPyBuildEditable/bin to my path. The python3 -m venv .venvTryRobotPyBuildEditable part was successfully getting zsh to find the python, but the trpbe was not getting zsh to find the new robotpy in the venv on the path, zsh was finding a robotpy on main python3 environment instead. Resulting in the confustion of python -m robotpy and robotpy being different executables with different pip installed packages.

a zsh rehash fixes the problem.

For record the problem:

see

(.venvTryRobotPyBuildEditable) mikestitt@peas mostRobotPySpires2025 % python
Python 3.12.3 (v3.12.3:f6650f9ad7, Apr  9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

test_sqlite3: testing with SQLite version 3.45.1
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
30fcd23745efe32ce681__mypyc aifc                importlib           runpy
AutoSequencerV2     altgraph            importlib_metadata  sched
__future__          antigravity         inflect             secrets
__hello__           argparse            iniconfig           select
__phello__          array               inspect             selectors
_abc                ast                 io                  setup
_aix_support        asyncio             ipaddress           setuptools
_ast                atexit              iterativerobotpy    setuptools_scm
_asyncio            audioop             itertools           shelve
_bisect             autocommand         jormungandr         shlex
_black_version      backports           json                shutil
_blake2             base64              keyword             signal
_bz2                bcrypt              lib2to3             site
_cffi_backend       bdb                 linecache           smtplib
_codecs             binascii            locale              sndhdr
_codecs_cn          bisect              logging             socket
_codecs_hk          black               lzma                socketserver
_codecs_iso2022     blackd              macholib            sphinxify
_codecs_jp          blib2to3            magicbot            sqlite3
_codecs_kr          builtins            mailbox             sre_compile
_codecs_tw          bz2                 mailcap             sre_constants
_collections        cProfile            marshal             sre_parse
_collections_abc    calendar            math                ssl
_compat_pickle      certifi             mimetypes           stat
_compression        cffi                mmap                statistics
_contextvars        cgi                 modulefinder        string
_crypt              cgitb               more_itertools      stringprep
_csv                charset_normalizer  multiprocessing     struct
_ctypes             chunk               mypy_extensions     subprocess
_ctypes_test        click               nacl                sunau
_curses             cmath               navigation          symtable
_curses_panel       cmd                 navx                sys
_datetime           code                netconsole          sysconfig
_dbm                codecs              netrc               syslog
_decimal            codeop              nis                 tabnanny
_distutils_hack     collections         nntplib             tarfile
_elementtree        colorsys            ntcore              telnetlib
_functools          compileall          ntpath              tempfile
_hashlib            concurrent          nturl2path          termios
_heapq              config              numbers             test
_imp                configparser        numpy               testingMotors
_io                 contextlib          opcode              tests
_json               contextvars         operator            textwrap
_locale             copy                optparse            this
_lsprof             copyreg             os                  threading
_lzma               crypt               packaging           time
_markupbase         cryptography        paramiko            timedrobotpy
_md5                cscore              patch               timeit
_multibytecodec     csv                 pathlib             tkinter
_multiprocessing    ctypes              pathspec            token
_opcode             curses              pcpp                tokenize
_operator           cv2                 pdb                 tomli
_osx_support        cxxheaderparser     phoenix6            tomli_w
_pickle             dashboard           photonlibpy         tomlkit
_posixshmem         dashboardWidgets    physics             tomllib
_posixsubprocess    dataclasses         pickle              toposort
_py_abc             datetime            pickletools         trace
_pydatetime         dbm                 pint                traceback
_pydecimal          ddc459050edb75a05942__mypyc pip                 tracemalloc
_pyio               debugpy             pipes               trpbe
_pylong             decimal             pkg_resources       tty
_pytest             delocate            pkgutil             turtle
_queue              difflib             platform            turtledemo
_random             dis                 platformdirs        typeguard
_scproxy            doctest             plistlib            types
_sha1               drivetrain          pluggy              typing
_sha2               email               poplib              typing_extensions
_sha3               encodings           positionSchemes     unicodedata
_signal             ensurepip           posix               unittest
_sitebuiltins       enum                posixpath           urllib
_socket             errno               pprint              urllib3
_sqlite3            faulthandler        profile             utils
_sre                fcntl               pstats              uu
_ssl                filecmp             pty                 uuid
_stat               fileinput           pwd                 vectorPlotter
_statistics         flexcache           py                  venv
_string             flexparser          py_compile          warnings
_strptime           fnmatch             pybind11_stubgen    wave
_struct             fractions           pyclbr              weakref
_symtable           ftplib              pycparser           webbrowser
_sysconfigdata__darwin_darwin functools           pydantic            webserver
_testbuffer         gc                  pydoc               wheel
_testcapi           genericpath         pydoc_data          wpilib
_testclinic         getopt              pyexpat             wpimath
_testimportmultiple getpass             pyfrc               wpinet
_testinternalcapi   gettext             pytest              wpiutil
_testmultiphase     glob                pytest_reraise      wrappers
_testsinglephase    graphlib            queue               wsgiref
_thread             grp                 quopri              xdrlib
_threading_local    gzip                random              xml
_tkinter            hal                 re                  xmlrpc
_tokenize           halsim_ds_socket    readline            xrp
_tracemalloc        halsim_gui          reprlib             xxlimited
_typing             halsim_ws           requests            xxlimited_35
_uuid               hashlib             resource            xxsubtype
_warnings           heapq               rev                 yaml
_weakref            hmac                rlcompleter         ytests
_weakrefset         html                robot               zipapp
_xxinterpchannels   http                robotpy             zipfile
_xxsubinterpreters  humanInterface      robotpy_apriltag    zipimport
_xxtestfuzz         idlelib             robotpy_build       zipp
_yaml               idna                robotpy_ext         zlib
_zoneinfo           imaplib             robotpy_installer   zoneinfo
abc                 imghdr              romi                

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

>>> quit()
(.venvTryRobotPyBuildEditable) mikestitt@peas mostRobotPySpires2025 % quit
zsh: command not found: quit
(.venvTryRobotPyBuildEditable) mikestitt@peas mostRobotPySpires2025 % robotpy sim                              
14:55:36:854 INFO    : faulthandler        : registered SIGUSR2 for PID 98397

Please wait a moment while I gather a list of all available modules...

test_sqlite3: testing with SQLite version 3.45.1
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
30fcd23745efe32ce681__mypyc _weakref            heapq               robotpy_ext
AutoSequencerV2     _weakrefset         hmac                robotpy_installer
__future__          _xxinterpchannels   html                runpy
__hello__           _xxsubinterpreters  http                sched
__phello__          _xxtestfuzz         humanInterface      secrets
_abc                _zoneinfo           idlelib             select
_aix_support        abc                 imaplib             selectors
_ast                aifc                imghdr              setup
_asyncio            antigravity         importlib           shelve
_bisect             argparse            iniconfig           shlex
_black_version      array               inspect             shutil
_blake2             ast                 io                  signal
_bz2                astroid             ipaddress           site
_cffi_backend       asyncio             isort               smtplib
_codecs             atexit              iterativerobotpy    sndhdr
_codecs_cn          audioop             itertools           socket
_codecs_hk          base64              jormungandr         socketserver
_codecs_iso2022     bcrypt              json                sqlite3
_codecs_jp          bdb                 keyword             sre_compile
_codecs_kr          binascii            lib2to3             sre_constants
_codecs_tw          bisect              linecache           sre_parse
_collections        black               locale              ssl
_collections_abc    blackd              logging             stat
_compat_pickle      blib2to3            lzma                statistics
_compression        builtins            magicbot            string
_contextvars        bz2                 mailbox             stringprep
_crypt              cProfile            mailcap             struct
_csv                calendar            marshal             subprocess
_ctypes             certifi             math                sunau
_ctypes_test        cffi                mccabe              symtable
_curses             cgi                 mimetypes           sys
_curses_panel       cgitb               mmap                sysconfig
_datetime           chunk               modulefinder        syslog
_dbm                click               multiprocessing     tabnanny
_decimal            cmath               mypy_extensions     tarfile
_elementtree        cmd                 nacl                telnetlib
_functools          code                navigation          tempfile
_hashlib            codecs              netconsole          termios
_heapq              codeop              netrc               test
_imp                collections         nis                 testingMotors
_io                 colorsys            nntplib             tests
_json               compileall          ntcore              textwrap
_locale             concurrent          ntpath              this
_lsprof             config              nturl2path          threading
_lzma               configparser        numbers             time
_markupbase         contextlib          opcode              timedrobotpy
_md5                contextvars         operator            timeit
_multibytecodec     copy                optparse            tkinter
_multiprocessing    copyreg             os                  token
_opcode             coverage            packaging           tokenize
_operator           crypt               paramiko            tomli
_osx_support        cryptography        pathlib             tomlkit
_pickle             csv                 pathspec            tomllib
_posixshmem         ctypes              pdb                 trace
_posixsubprocess    curses              physics             traceback
_py_abc             dashboard           pickle              tracemalloc
_pydatetime         dashboardWidgets    pickletools         tty
_pydecimal          dataclasses         pint                turtle
_pyio               datetime            pip                 turtledemo
_pylong             dbm                 pipes               types
_pytest             ddc459050edb75a05942__mypyc pkgutil             typing
_queue              debugpy             platform            typing_extensions
_random             decimal             platformdirs        unicodedata
_scproxy            difflib             plistlib            unittest
_sha1               dill                pluggy              urllib
_sha2               dis                 poplib              utils
_sha3               doctest             positionSchemes     uu
_signal             drivetrain          posix               uuid
_sitebuiltins       email               posixpath           vectorPlotter
_socket             encodings           pprint              venv
_sqlite3            ensurepip           profile             warnings
_sre                enum                pstats              wave
_ssl                errno               pty                 weakref
_stat               faulthandler        pwd                 webbrowser
_statistics         fcntl               py                  webserver
_string             filecmp             py_compile          wpilib
_strptime           fileinput           pyclbr              wpimath
_struct             flexcache           pycparser           wpinet
_symtable           flexparser          pydoc               wpiutil
_sysconfigdata__darwin_darwin fnmatch             pydoc_data          wrappers
_testbuffer         fractions           pyexpat             wsgiref
_testcapi           ftplib              pyfrc               xdrlib
_testclinic         functools           pylint              xml
_testimportmultiple gc                  pytest              xmlrpc
_testinternalcapi   genericpath         pytest_reraise      xxlimited
_testmultiphase     getopt              queue               xxlimited_35
_testsinglephase    getpass             quopri              xxsubtype
_thread             gettext             random              ytests
_threading_local    glob                re                  zipapp
_tkinter            graphlib            readline            zipfile
_tokenize           grp                 reprlib             zipimport
_tracemalloc        gzip                resource            zlib
_typing             hal                 rlcompleter         zoneinfo
_uuid               halsim_gui          robot               
_warnings           hashlib             robotpy             

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

ERROR: importing /Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/robot.py failed!
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/robotpy/main.py", line 68, in _load_robot_class
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/robot.py", line 8, in <module>
    from dashboard import Dashboard
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/dashboard.py", line 2, in <module>
    from AutoSequencerV2.autoSequencer import AutoSequencer
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/AutoSequencerV2/autoSequencer.py", line 8, in <module>
    from Autonomous.modes.blueRightDriveOut import BlueRightDriveOut
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/Autonomous/modes/blueRightDriveOut.py", line 1, in <module>
    from Autonomous.commands.drivePathCommand import DrivePathCommand
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/Autonomous/commands/drivePathCommand.py", line 3, in <module>
    from drivetrain.controlStrategies.trajectory import Trajectory
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/drivetrain/controlStrategies/trajectory.py", line 1, in <module>
    from drivetrain.controlStrategies.trajectoryGuts import TrajectoryGuts
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/drivetrain/controlStrategies/trajectoryGuts.py", line 3, in <module>
    from drivetrain.controlStrategies.holonomicDriveController import (
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/drivetrain/controlStrategies/holonomicDriveController.py", line 6, in <module>
    from drivetrain.drivetrainPhysical import (
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/drivetrain/drivetrainPhysical.py", line 7, in <module>
    from drivetrain.DrivetrainDependentConstants import drivetrainDepConstants
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/drivetrain/DrivetrainDependentConstants.py", line 10, in <module>
    from wrappers.wrapperedPoseEstPhotonCamera import WrapperedPoseEstPhotonCamera
  File "/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/mostRobotPySpires2025/wrappers/wrapperedPoseEstPhotonCamera.py", line 8, in <module>
    from photonlibpy.photonCamera import PhotonCamera
ModuleNotFoundError: No module named 'photonlibpy'
(.venvTryRobotPyBuildEditable) mikestitt@peas mostRobotPySpires2025 % which python
/Users/mikestitt/Documents/first/pythonExperiments/tryRobotPyBuildEditable/.venvTryRobotPyBuildEditable/bin/python
(.venvTryRobotPyBuildEditable) mikestitt@peas mostRobotPySpires2025 % 

@MikeStitt
Copy link
Collaborator Author

Question two: (It works on my machine). For the online CI builds, what should I change to be able to find this module:

https://github.com/MikeStitt/mostrobotpy/blob/pyIterativeAndTimedRobot/subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py#L34

-Thanks
-Mike

@virtuald
Copy link
Member

Question two: (It works on my machine). For the online CI builds, what should I change to be able to find this module:

It should work. The error in CI appears to be that it can't find the reraise fixture, which is provided by pytest-reraise (add to tests/requirements.txt).

@MikeStitt
Copy link
Collaborator Author

@virtuald Would you approve the workflow. I'd like to see if it passes again.

@virtuald
Copy link
Member

I added you as an outside collaborator, hopefully it doesn't ask me to approve it again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants