Skip to content

Commit 4e3e64b

Browse files
authored
Merge pull request #119 from kevinzakka/revamp
Switch to uv + various fixups.
2 parents e8b1cd8 + ff6e5c3 commit 4e3e64b

File tree

95 files changed

+24984
-781
lines changed

Some content is hidden

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

95 files changed

+24984
-781
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,96 @@ on:
44
push:
55
branches: [ main ]
66
paths-ignore:
7-
- "**/README.md"
7+
- '**.md'
8+
- 'Makefile'
9+
- 'LICENSE'
810
pull_request:
911
branches: [ main ]
1012
paths-ignore:
11-
- "**/README.md"
13+
- '**.md'
14+
- 'Makefile'
15+
- 'LICENSE'
16+
17+
env:
18+
UV_FROZEN: "1"
1219

1320
jobs:
14-
run-mink-tests:
21+
lint-format:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Setup uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
enable-cache: true
30+
version: "0.9.14"
31+
- name: Run lint
32+
run: uvx ruff@0.14.7 check --diff
33+
- name: Run format
34+
run: uvx ruff@0.14.7 format --diff
35+
36+
pyright:
1537
runs-on: ubuntu-latest
1638
strategy:
1739
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
40+
python-version: ["3.10", "3.11", "3.12", "3.13"]
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Setup uv
44+
uses: astral-sh/setup-uv@v6
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
enable-cache: true
48+
version: "0.9.14"
49+
- name: Test with python ${{ matrix.python-version }}
50+
run: uv run pyright
1951

52+
ty:
53+
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2057
steps:
21-
- name: Checkout mink
22-
uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
58+
- uses: actions/checkout@v4
59+
- name: Setup uv
60+
uses: astral-sh/setup-uv@v6
2561
with:
2662
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
pip install uv
30-
uv pip install --system -e ".[test]"
31-
- name: Run tests
32-
run: |
33-
pytest .
63+
enable-cache: true
64+
version: "0.9.14"
65+
- name: Test with python ${{ matrix.python-version }}
66+
run: uv run ty check
3467

35-
run-mink-coverage:
68+
tests:
3669
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
python-version: ["3.10", "3.11", "3.12", "3.13"]
73+
steps:
74+
- uses: actions/checkout@v4
75+
- name: Setup uv
76+
uses: astral-sh/setup-uv@v6
77+
with:
78+
python-version: ${{ matrix.python-version }}
79+
enable-cache: true
80+
version: "0.9.14"
81+
- name: Test with python ${{ matrix.python-version }}
82+
run: uv run pytest
3783

84+
coverage:
85+
runs-on: ubuntu-latest
3886
steps:
39-
- name: Checkout mink
40-
uses: actions/checkout@v4
41-
- name: Set up Python 3.13
42-
uses: actions/setup-python@v5
87+
- uses: actions/checkout@v4
88+
- name: Setup uv
89+
uses: astral-sh/setup-uv@v6
4390
with:
44-
python-version: 3.13
45-
- name: Install dependencies
46-
run: |
47-
pip install uv
48-
uv pip install --system -e ".[test]"
49-
- name: Run tests
50-
run: |
51-
coverage run --source=mink -m pytest .
52-
- name: "Coveralls"
91+
python-version: "3.13"
92+
enable-cache: true
93+
version: "0.9.14"
94+
- name: Run coverage
95+
run: uv run coverage run --source=src -m pytest .
96+
- name: Coveralls
5397
env:
5498
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
run: |
56-
coveralls --service=github
99+
run: uv run coveralls --service=github

.github/workflows/docs.yml

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,35 @@
11
name: Documentation
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
88

9-
defaults:
10-
run:
11-
# See https://github.com/mamba-org/provision-with-micromamba#important
12-
shell: bash -l {0}
9+
env:
10+
UV_FROZEN: "1"
1311

1412
jobs:
15-
docs:
16-
name: "GitHub Pages"
17-
runs-on: ubuntu-latest
18-
permissions:
19-
contents: write
20-
steps:
21-
- name: "Checkout Git repository"
22-
uses: actions/checkout@v4
23-
24-
- name: Set up Python 3.12
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: "3.12"
28-
29-
- name: Set up dependencies
30-
run: |
31-
pip install uv
32-
uv pip install --system -e ".[dev]"
33-
uv pip install --system -r docs/requirements.txt
34-
35-
- name: "Build documentation"
36-
run: |
37-
sphinx-build docs _build -W
38-
39-
- name: "Deploy to GitHub Pages"
40-
uses: peaceiris/actions-gh-pages@v4
41-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
42-
with:
43-
publish_branch: gh-pages
44-
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
publish_dir: _build/
46-
force_orphan: true
13+
docs:
14+
name: "GitHub Pages"
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v6
22+
with:
23+
python-version: "3.13"
24+
enable-cache: true
25+
version: "0.9.14"
26+
- name: Build documentation
27+
run: uv run --group doc sphinx-build docs _build -W
28+
- name: Deploy to GitHub Pages
29+
uses: peaceiris/actions-gh-pages@v4
30+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31+
with:
32+
publish_branch: gh-pages
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: _build/
35+
force_orphan: true

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ _build/
33
_static/
44
_templates/
55
htmlcov/
6-
76
*.pyc

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
### Changed
8+
9+
* Switch to `uv`.
10+
* Deprecate Python 3.8 and 3.9 support.
11+
712
### Added
813

914
* Associate loggers with the name "mink".
1015
* Improve test coverage.
1116
* Add more tests to `test_configuration_limit.py` and `test_velocity_limit.py`.
1217

18+
### Bugfix
19+
20+
* Fix pyright type errors on Python 3.10 by explicitly casting numpy scalars to Python floats.
21+
1322
## [0.0.13] - 2025-09-12
1423

1524
### Bugfix

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cff-version: 1.2.0
22
message: "If you find this code helpful, please cite it as below."
33
title: "Mink: Python inverse kinematics based on MuJoCo"
4-
version: 0.0.11
5-
date-released: 2025-05-22
4+
version: 1.0.0
5+
date-released: 2025-12-19
66
url: "https://github.com/kevinzakka/mink"
77
license: "Apache-2.0"
88
authors:

CONTRIBUTING.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Contributing
22

3-
Thanks for your interest in contributing to **mink**! Here are a few great ways to get involved:
3+
Thanks for your interest in contributing to **mink**! Here are a few great ways
4+
to get involved:
45

56
- Try out the [examples](examples) and report any issues.
6-
- Pick something you'd like to do with one of the many [robot descriptions](https://github.com/robot-descriptions/robot_descriptions.py) and write a new example.
7+
- Pick something you'd like to do with one of the many [robot
8+
descriptions](https://github.com/robot-descriptions/robot_descriptions.py) and
9+
write a new example.
710
- Find a use case that isn’t covered yet and write a unit test for it.
811
- Improve the documentation.
912
- Implement new tasks or constraints.
1013

11-
If any of those sound interesting, open an [issue](https://github.com/kevinzakka/mink/issues) and let us know you're on it!
14+
If any of those sound interesting, open an
15+
[issue](https://github.com/kevinzakka/mink/issues) and let us know you're on it!
1216

1317
## Pull Requests
1418

@@ -21,11 +25,13 @@ When submitting a pull request, please make sure to:
2125
pytest .
2226
```
2327

24-
If you’re adding new functionality, consider adding corresponding tests and updating the docs if applicable.
28+
If you’re adding new functionality, consider adding corresponding tests and
29+
updating the docs if applicable.
2530

2631
## Documentation
2732

28-
If you’re adding new functionality to mink and want to update the documentation, you can build it and preview it locally like this:
33+
If you’re adding new functionality to mink and want to update the documentation,
34+
you can build it and preview it locally like this:
2935

3036
```bash
3137
uv pip install -r docs/requirements.txt

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: sync
2+
sync:
3+
uv sync --all-extras --all-packages --group dev
4+
5+
.PHONY: format
6+
format:
7+
uv run ruff format
8+
uv run ruff check --fix
9+
10+
.PHONY: type
11+
type:
12+
uv run ty check
13+
uv run pyright
14+
15+
.PHONY: check
16+
check: format type
17+
18+
.PHONY: test
19+
test:
20+
uv run pytest
21+
22+
.PHONY: test-all
23+
test-all: check test
24+
25+
.PHONY: coverage
26+
coverage:
27+
uv run coverage run --source=src -m pytest .
28+
uv run coverage report
29+
30+
.PHONY: doc
31+
doc:
32+
uv run --group doc sphinx-build docs _build -W
33+
34+
.PHONY: build
35+
build:
36+
rm -rf dist/
37+
uv build
38+
uv run --isolated --no-project --with pytest --with robot_descriptions --with dist/*.whl pytest tests/
39+
uv run --isolated --no-project --with pytest --with robot_descriptions --with dist/*.tar.gz pytest tests/
40+
@ls -lh dist/*.whl | awk '{print "Wheel size: " $$5}'
41+
@echo "Build and test successful"

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,52 @@ If you use mink in your research, please cite it as follows:
2424
author = {Zakka, Kevin},
2525
title = {{Mink: Python inverse kinematics based on MuJoCo}},
2626
year = {2025},
27-
month = may,
28-
version = {0.0.11},
27+
month = dec,
28+
version = {1.0.0},
2929
url = {https://github.com/kevinzakka/mink},
3030
license = {Apache-2.0}
3131
}
3232
```
3333

3434
## Installation
3535

36-
You can install `mink` using `pip`:
36+
Install from PyPI:
3737

3838
```bash
39-
pip install mink
39+
uv add mink
4040
```
4141

42-
To include the example dependencies:
42+
Or clone and run locally:
4343

4444
```bash
45-
pip install "mink[examples]"
45+
git clone https://github.com/kevinzakka/mink.git && cd mink
46+
uv sync
4647
```
4748

4849
## Examples
4950

51+
To run an example:
52+
53+
```bash
54+
# Linux
55+
uv run examples/arm_ur5e.py
56+
57+
# macOS
58+
./fix_mjpython_macos.sh # So that mjpython works with uv.
59+
uv run mjpython examples/arm_ur5e.py
60+
```
61+
5062
mink works with a variety of robots, including:
5163

52-
* Arms: [UR5e](https://github.com/kevinzakka/mink/blob/main/examples/arm_ur5e_actuators.py), [iiwa14](https://github.com/kevinzakka/mink/blob/main/examples/arm_iiwa.py), [bimanual iiwa14](https://github.com/kevinzakka/mink/blob/main/examples/dual_iiwa.py)
53-
* Humanoids: [Unitree G1](https://github.com/kevinzakka/mink/blob/main/examples/humanoid_g1.py), [Unitree H1](https://github.com/kevinzakka/mink/blob/main/examples/humanoid_h1.py)
54-
* Quadrupeds: [Unitree Go1](https://github.com/kevinzakka/mink/blob/main/examples/quadruped_go1.py), [Boston Dynamics Spot](https://github.com/kevinzakka/mink/blob/main/examples/quadruped_spot.py)
55-
* Hands: [Shadow Hand](https://github.com/kevinzakka/mink/blob/main/examples/hand_shadow.py), [Allegro Hand](https://github.com/kevinzakka/mink/blob/main/examples/arm_hand_iiwa_allegro.py)
56-
* Mobile manipulators: [Stanford TidyBot](https://github.com/kevinzakka/mink/blob/main/examples/mobile_tidybot.py), [Hello Robot Stretch](https://github.com/kevinzakka/mink/blob/main/examples/mobile_stretch.py)
64+
* **Single arms**: [Franka Panda](https://github.com/kevinzakka/mink/blob/main/examples/arm_panda.py), [UR5e](https://github.com/kevinzakka/mink/blob/main/examples/arm_ur5e.py), [KUKA iiwa14](https://github.com/kevinzakka/mink/blob/main/examples/arm_iiwa.py), [ALOHA 2](https://github.com/kevinzakka/mink/blob/main/examples/arm_aloha.py)
65+
* **Dual arms**: [Dual Panda](https://github.com/kevinzakka/mink/blob/main/examples/dual_panda.py), [Dual iiwa14](https://github.com/kevinzakka/mink/blob/main/examples/dual_iiwa.py), [Flying Dual UR5e](https://github.com/kevinzakka/mink/blob/main/examples/flying_dual_arm_ur5e.py)
66+
* **Arm + hand**: [iiwa14 + Allegro](https://github.com/kevinzakka/mink/blob/main/examples/arm_hand_iiwa_allegro.py), [xArm + LEAP](https://github.com/kevinzakka/mink/blob/main/examples/arm_hand_xarm_leap.py)
67+
* **Dexterous hands**: [Shadow Hand](https://github.com/kevinzakka/mink/blob/main/examples/hand_shadow.py)
68+
* **Humanoids**: [Unitree G1](https://github.com/kevinzakka/mink/blob/main/examples/humanoid_g1.py), [Unitree H1](https://github.com/kevinzakka/mink/blob/main/examples/humanoid_h1.py), [Apptronik Apollo](https://github.com/kevinzakka/mink/blob/main/examples/humanoid_apollo.py)
69+
* **Legged robots**: [Unitree Go1](https://github.com/kevinzakka/mink/blob/main/examples/quadruped_go1.py), [Boston Dynamics Spot](https://github.com/kevinzakka/mink/blob/main/examples/quadruped_spot.py), [Agility Cassie](https://github.com/kevinzakka/mink/blob/main/examples/biped_cassie.py)
70+
* **Mobile manipulators**: [TidyBot](https://github.com/kevinzakka/mink/blob/main/examples/mobile_tidybot.py), [Hello Robot Stretch](https://github.com/kevinzakka/mink/blob/main/examples/mobile_stretch.py), [Kinova Gen3 + LEAP](https://github.com/kevinzakka/mink/blob/main/examples/mobile_kinova_leap.py)
5771

58-
Check out the [examples](https://github.com/kevinzakka/mink/blob/main/examples/) directory for more code.
72+
Check out the [examples](https://github.com/kevinzakka/mink/blob/main/examples/) directory for more.
5973

6074
## How can I help?
6175

docs/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)