Skip to content

Commit

Permalink
Merge pull request #9 from thedropbears/davo/uv
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienMorey authored Oct 31, 2024
2 parents ffdb869 + 8bae71f commit 49ab551
Show file tree
Hide file tree
Showing 7 changed files with 818 additions and 915 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- uses: astral-sh/setup-uv@v3
with:
cache: true
enable-cache: true
version: "0.4.x"
- name: Install dependencies
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install coverage pytest-github-actions-annotate-failures
- run: pdm run robotpy coverage test
- run: pdm run coverage xml
uv sync
uv pip install coverage pytest-github-actions-annotate-failures
- run: uv run robotpy coverage test
- run: uv run coverage xml
- uses: codecov/codecov-action@v4
with:
use_oidc: true
Expand All @@ -34,14 +34,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- uses: astral-sh/setup-uv@v3
with:
cache: true
enable-cache: true
version: "0.4.x"
- name: Install dependencies
run: |
pdm install
uv sync
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: mypy
run: pdm run mypy --show-column-numbers .
run: uv run mypy --show-column-numbers .
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ coverage.xml
.hypothesis/
.pytest_cache/

# pyenv
.python-version

# pdm
.pdm-python
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
40 changes: 16 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@ The Drop Bears' robot code for FRC 2025

### Install dependencies

We use `pdm` to manage our dependencies in a virtual environment.
We use `uv` to manage our dependencies in our development environments.
This includes the Python version, and any Python packages such as `wpilib`.

First, install `pdm`, either by using your system package manager, using [`pipx`][],
or following the instructions on the [`pdm` website][].
Install `uv` by following the [`uv` docs](https://docs.astral.sh/uv/).

[`pipx`]: https://pipx.pypa.io
[`pdm` website]: https://pdm-project.org

After installing `pdm`, use it to create a virtual environment and install our dependencies.
After installing `uv`, use it to create a virtual environment and install our dependencies.

```sh
pdm install
uv sync
```

```sh
pdm run python -m ensurepip
```
Then, download the roboRIO dependencies.

```sh
pdm run download
uv run python -m ensurepip
uv run robotpy sync --no-install
```

### pre-commit
Expand All @@ -34,13 +30,13 @@ pdm run download
These are enforced for all code committed to this project.

You must install pre-commit outside of this project's virtual environment.
Either use your system package manager, or use `pipx`:
Either use your system package manager, or use `uv tool`:

```
pipx install pre-commit
uv tool install pre-commit
```

Setup the pre-commit hooks to run on commit:
You can then set up the pre-commit hooks to run on commit:
```
pre-commit install
```
Expand All @@ -54,33 +50,29 @@ pre-commit install
Before your first run, copy the `*.json.orig` files to the main directory and remove the `.orig` extension.

```
pdm run robotpy sim
uv run robotpy sim
```

### Deploy to Robot

Once on robots network

```
pdm run deploy
uv run robotpy deploy
```

### Test

```
pdm run test
uv run robotpy test
```

### Type checking

We use mypy to check our type hints in CI. You can install and run mypy locally:

```sh
pdm install --group typing
```
We use mypy to check our type hints in CI. You can run mypy locally:

```sh
pdm run mypy .
uv run mypy .
```

## Code Structure
Expand Down
Loading

0 comments on commit 49ab551

Please sign in to comment.