Skip to content

Commit 9696472

Browse files
authored
Open-source prep: MIT relicense, templates, SPDX, scrub UW (#59)
Preparing mj_environment for public release (see personalrobotics/robot-code#3). Licensing: - LICENSE: BSD-3 → MIT, Copyright (c) 2025 Siddhartha Srinivasa. - pyproject.toml: license = "MIT" (SPDX), authors email siddh@cs.washington.edu → siddhartha.srinivasa@gmail.com, urls added, ruff config added. - README.md: "BSD-3-Clause — Personal Robotics Laboratory, University of Washington" → "MIT — see LICENSE". - SPDX + copyright header on every .py (src/, tests/, demos/). Templates synced from robot-code/.github-templates/. Code cleanup: - Moved mid-file imports in environment.py to the top (no circular dep). - Wrapped one 135-char line. - ruff check --fix + ruff format (incl. unsafe fixes: `== True/False` → direct). - [tool.ruff] config: 120 line-length, F/E/W/I, __init__.py F401 ignore. Verified: 129 tests pass, ruff check clean, ruff format clean.
1 parent dc53380 commit 9696472

31 files changed

Lines changed: 500 additions & 235 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @siddhss5
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible bug
4+
labels: bug
5+
---
6+
7+
## Environment
8+
- OS:
9+
- Python version:
10+
- uv version:
11+
- Package version or commit:
12+
13+
## Reproduction
14+
<!-- Minimal steps to reproduce the problem. -->
15+
16+
## Expected behavior
17+
18+
## Actual behavior
19+
20+
## Logs / traceback
21+
```
22+
```

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions and discussion
4+
url: https://github.com/personalrobotics/robot-code/discussions
5+
about: Ask questions or discuss design in the umbrella repo.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Improvement
3+
about: Propose an enhancement to existing functionality
4+
labels: enhancement
5+
---
6+
7+
## Motivation
8+
<!-- What problem or limitation prompts this improvement? -->
9+
10+
## Proposal
11+
<!-- What should change, concretely? -->
12+
13+
## Alternatives considered

.github/ISSUE_TEMPLATE/task.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Task
3+
about: A planned unit of work
4+
labels: task
5+
---
6+
7+
## Goal
8+
9+
## Acceptance criteria
10+
- [ ]
11+
12+
## Notes

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Summary
2+
3+
<!-- One or two sentences describing what this PR does and why. -->
4+
5+
## Changes
6+
7+
<!-- Bulleted list of the concrete changes made. -->
8+
-
9+
10+
## Testing
11+
12+
- [ ] `uv run pytest tests/ -v` passes
13+
- [ ] `uv run ruff check .` passes
14+
- [ ] `uv run ruff format --check .` passes
15+
- [ ] Integration tested locally against the robot-code workspace (if cross-repo)
16+
17+
## Breaking changes
18+
19+
- [ ] None
20+
- [ ] Yes (describe migration below):
21+
22+
## Related issues
23+
24+
<!-- e.g. Fixes #123, Part of personalrobotics/robot-code#3 -->

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12"]
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
enable-cache: true
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: uv sync --all-extras --dev
32+
33+
- name: Ruff lint
34+
run: uv run ruff check .
35+
36+
- name: Ruff format check
37+
run: uv run ruff format --check .
38+
39+
- name: Pytest
40+
run: |
41+
if [ -d tests ]; then
42+
uv run pytest tests/ -v
43+
else
44+
echo "No tests/ directory; skipping pytest."
45+
fi
46+
47+
notify-robot-code:
48+
needs: test
49+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Dispatch integration run
53+
uses: peter-evans/repository-dispatch@v3
54+
with:
55+
token: ${{ secrets.ROBOT_CODE_DISPATCH_TOKEN }}
56+
repository: personalrobotics/robot-code
57+
event-type: sibling-updated
58+
client-payload: '{"repo":"${{ github.event.repository.name }}","sha":"${{ github.sha }}"}'

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Code of Conduct
2+
3+
This project adopts the [Contributor Covenant, version 2.1][cc].
4+
5+
The full text is available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>.
6+
7+
## Reporting
8+
9+
Instances of unacceptable behavior may be reported privately to the project
10+
maintainer at **siddhartha.srinivasa@gmail.com**. All reports will be
11+
reviewed and investigated promptly and fairly.
12+
13+
[cc]: https://www.contributor-covenant.org/version/2/1/code_of_conduct/

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
This repository is part of the [robot-code workspace](https://github.com/personalrobotics/robot-code).
4+
All projects in the workspace share a common layout (`src/` + `tests/`), a single
5+
package manager (`uv`), and a common CI setup.
6+
7+
## Development setup
8+
9+
```bash
10+
git clone https://github.com/personalrobotics/robot-code
11+
cd robot-code
12+
./setup.sh
13+
```
14+
15+
This clones every sibling repo (including this one) into a single uv workspace
16+
and runs `uv sync`. You can then work in any sibling's directory.
17+
18+
## Running tests and linters
19+
20+
From inside this repo:
21+
22+
```bash
23+
uv run pytest tests/ -v
24+
uv run ruff check .
25+
uv run ruff format --check .
26+
```
27+
28+
From the workspace root, you can also run the cross-repo integration suite:
29+
30+
```bash
31+
uv run pytest tests/integration -v
32+
```
33+
34+
## Pull requests
35+
36+
- Branch from `main`. Open a PR with a clear summary and test plan.
37+
- Per-repo CI (ruff + pytest) must pass.
38+
- Cross-repo integration CI in robot-code runs automatically when this repo's
39+
`main` advances, and on scheduled nightly runs.
40+
- Review is by [@siddhss5](https://github.com/siddhss5) (enforced via CODEOWNERS).
41+
42+
## Package manager: uv only
43+
44+
We use [uv](https://docs.astral.sh/uv/) exclusively. **Do not use pip.**
45+
The workspace layout in robot-code relies on uv's workspace resolution.
46+
47+
## License
48+
49+
By contributing, you agree that your contributions will be licensed under the
50+
MIT License (see [LICENSE](LICENSE)).

LICENSE

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
BSD 3-Clause License
1+
MIT License
22

3-
Copyright (c) 2025, Personal Robotics Laboratory
4-
All rights reserved.
3+
Copyright (c) 2025 Siddhartha Srinivasa <siddhartha.srinivasa@gmail.com>
54

6-
Redistribution and use in source and binary forms, with or without
7-
modification, are permitted provided that the following conditions are met:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
811

9-
1. Redistributions of source code must retain the above copyright notice, this
10-
list of conditions and the following disclaimer.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1114

12-
2. Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
16-
3. Neither the name of the copyright holder nor the names of its
17-
contributors may be used to endorse or promote products derived from
18-
this software without specific prior written permission.
19-
20-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)