Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ "**" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .[dev]
pip install mypy==1.18.2 ruff==0.14.1

- name: Ruff Lint
run: |
ruff check .
ruff format --check .

- name: Mypy
run: |
mypy urchin

- name: Pytest
run: |
pytest -q
49 changes: 22 additions & 27 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
name: Publish Python 🐍 distributions 📦 to PyPI

on: push
on:
push:
tags:
- "*" # Only run on tag pushes

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
if: github.repository == 'fishbotics/urchin'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
33 changes: 16 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,30 @@ on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "weekly" build at 0 AM UTC on Mondays
- cron: '0 0 * * MON'
# * is a special character in YAML so you have to quote this string
# Execute a "weekly" build at 0 AM UTC on Mondays
- cron: "0 0 * * MON"

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov coveralls wheel
python -m pip install .
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov coveralls wheel
python -m pip install .

- name: Test with pytest
run: |
pytest --cov=urchin tests
- name: Test with pytest
run: |
pytest --cov=urchin tests
31 changes: 26 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.1
hooks:
- id: flake8
exclude: ^setup.py
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.1
hooks:
- id: flake8
exclude: ^setup.py
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.1
hooks:
- id: ruff
name: ruff (lint + isort)
args: ["--fix"]
- id: ruff-format
name: ruff (format)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
name: mypy
args: ["--config=pyproject.toml", "urchin"]
- repo: local
hooks:
- id: pytest
name: pytest
entry: pytest -q
language: system
pass_filenames: false
8 changes: 3 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns: list[str] = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
Expand Down Expand Up @@ -124,7 +124,7 @@

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
latex_elements: dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
Expand Down Expand Up @@ -217,9 +217,7 @@ class MyPythonDomain(PythonDomain):
def find_obj(self, env, modname, classname, name, type, searchmode=0):
"""Ensures an object always resolves to the desired module
if defined there."""
orig_matches = PythonDomain.find_obj(
self, env, modname, classname, name, type, searchmode
)
orig_matches = PythonDomain.find_obj(self, env, modname, classname, name, type, searchmode)

if len(orig_matches) <= 1:
return orig_matches
Expand Down
73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "urchin"
version = "0.0.30"
requires-python = ">=3.9"
description = "URDF parser and manipulator for Python"
readme = { text = "URDF parser and manipulator for Python. This package is a fork of urdfpy, which seems to be no longer maintained.", content-type = "text/plain" }
authors = [
{ name = "Adam Fishman", email = "hello@fishbotics.com" }
]
license = { text = "MIT License" }
urls = { "Homepage" = "https://github.com/fishbotics/urchin" }
keywords = ["robotics", "ros", "urdf", "robots", "parser"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Natural Language :: English",
"Topic :: Scientific/Engineering"
]
dependencies = [
"lxml", # For XML DOM Tree
"networkx", # For joint graph
"numpy>=1.20", # Numpy
"pillow", # For texture image loading
"pycollada>=0.6", # COLLADA (.dae) mesh loading via trimesh
"pyribbit>=0.1.46", # For visualization
"scipy", # For trimesh, annoyingly
"trimesh" # Mesh geometry loading/creation/saving
]

[project.optional-dependencies]
dev = [
"flake8", # Code formatting checker
"pre-commit", # Pre-commit hooks
"pytest", # Code testing
"pytest-cov", # Coverage testing
"tox" # Automatic virtualenv testing
]
docs = [
"sphinx", # General doc library
"sphinx_rtd_theme", # RTD theme for sphinx
"sphinx-automodapi" # For generating nice tables
]

[tool.mypy]
python_version = "3.10"
strict = false
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = ["lxml.*", "trimesh.*", "networkx.*", "PIL.*", "pyribbit.*", "sphinx.*", "sphinx_rtd_theme"]
ignore_missing_imports = true

[tool.ruff]
line-length = 100
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I"]
fixable = ["ALL"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
6 changes: 2 additions & 4 deletions scripts/vis_urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
Script for visualizing a robot from a URDF.
Author: Matthew Matl
"""

import argparse

import urchin

if __name__ == "__main__":

# Parse Args
parser = argparse.ArgumentParser(description="Visualize a robot from a URDF file")
parser.add_argument(
"urdf", type=str, help="Path to URDF file that describes the robot"
)
parser.add_argument("urdf", type=str, help="Path to URDF file that describes the robot")
parser.add_argument("-a", action="store_true", help="Visualize robot articulation")
parser.add_argument("-c", action="store_true", help="Use collision geometry")

Expand Down
59 changes: 0 additions & 59 deletions setup.py

This file was deleted.

Loading