FIRST Robotics FRC is a high school robotics program. This repository contains the code used in the Southfield High School Team 94 (NinetyFouriors) robot.
- Python 3.8: This codebase uses Python 3.8
- pyfrc: Be sure to follow the pyfrc instructions for the latest roboPy setup. This is largely handled by the install of this project mentioned below.
It is highly recommended that you use an python environment manager with python to help as the version of python required by pyfrc changes.
- pyenv is useful for managing multiple python versions (3.8) on your computer: NOTE your python version and pip version/dependencies are highly correlated
brew install pyenvfor macOS and Homebrewscoop install pythonwith Scoop is the closest thing if you have the misfortune to be using Windows and possibly follow this page for more instructions on supporting different python versions- pipenv is useful for dependency management for this project as well
pipenv --python 3.8to create a python 3.8 environment for this projectpipenv install -e .to setup this project in the created virtualenvpipenv shellto enter the environment for this projecttoxafter that to run the tests
IDEs like Pycharm also support pipenv.
It is very important that you have updated pip to the latest version. You can do so with the command below:
# update `pip` and `setuptools` to the latest versions available
pip3 install -U pip setuptoolsNote: If you are confident that your system version of python is exactly python 3.8, then you can simply use:
pip3 install -e .
toxGood luck!
To be soothing to your mind, the project attempts to make python/PEP formatting not an issue. Given you think you are ready to commit your code changes. Just run:
black --check .To show which files black will reformat.
black --diff .Shows the changes black will make, and then:
black .will let the reformatting goodness happen. Black comes with the pipenv install -e . of the project.
- Copy/install all .py files in the src/robot folder to the robot.
RobotPy has some great robot code deployment instructions and automation. Note that the RobotPy deployment process will automatically run the tests for the project as part of the deployment to try and protect us from ourselves.
python3 robot.py deploy
# in the virtual environment python3 may not be available
python robot.py deploy-
Make sure, you have
toxinstalled:pipenv install -e .[tests] pipenv shell
-
Run the projects tests:
tox
tox is running python src/robot.py coverage test from RobotPy Unit Testing