Skip to content

Commit 646c7d8

Browse files
authored
Merge branch 'master' into master
2 parents 03046bf + 858601d commit 646c7d8

File tree

134 files changed

+11131
-48316
lines changed

Some content is hidden

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

134 files changed

+11131
-48316
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Global Owners
2+
* @petercorke @jhavl @myeatman-bdai

.github/workflows/master.yml

+12-50
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: build
77
on:
88
push:
99
branches: [ master, future ]
10-
# pull_request:
11-
# branches: [ master ]
10+
pull_request:
11+
1212

1313
jobs:
1414
# Run tests on different versions of python
@@ -17,20 +17,21 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [windows-latest, ubuntu-latest, macos-latest]
20-
python-version: [3.9, '3.10']
20+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
21+
exclude:
22+
- os: macos-latest
23+
python-version: "3.7"
2124

2225
steps:
2326
- uses: actions/checkout@v2
2427
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v1
28+
uses: actions/setup-python@v5
2629
with:
2730
python-version: ${{ matrix.python-version }}
2831
- name: Install dependencies
2932
run: |
3033
python -m pip install --upgrade pip
3134
pip install .[dev]
32-
pip install pytest-timeout
33-
pip install pytest-xvfb
3435
- name: Test with pytest
3536
env:
3637
MPLBACKEND: TkAgg
@@ -45,20 +46,18 @@ jobs:
4546
steps:
4647
- uses: actions/checkout@v2
4748
- name: Set up Python 3.7
48-
uses: actions/setup-python@v1
49+
uses: actions/setup-python@v5
4950
with:
5051
python-version: 3.7
5152
- name: Install dependencies
5253
run: |
5354
python -m pip install --upgrade pip
55+
pip install .[dev]
5456
- name: Run coverage
5557
run: |
56-
pip install .[dev]
57-
pip install pytest-xvfb
58-
pip install pytest-timeout
59-
pytest --cov --cov-config=./spatialmath/.coveragerc --cov-report xml
60-
#pytest --cov=spatialmath --cov-report xml
58+
coverage run --omit='tests/*.py,tests/base/*.py' -m pytest
6159
coverage report
60+
coverage xml
6261
- name: upload coverage to Codecov
6362
uses: codecov/codecov-action@v3
6463
with:
@@ -67,41 +66,4 @@ jobs:
6766
# If the above worked:
6867
# Build docs and upload to GH Pages
6968
needs: unittest
70-
runs-on: ubuntu-latest
71-
steps:
72-
- uses: actions/checkout@v2
73-
- name: Set up Python 3.7
74-
uses: actions/setup-python@v1
75-
with:
76-
python-version: 3.7
77-
- name: Install dependencies
78-
run: |
79-
python -m pip install --upgrade pip
80-
pip install .[dev,docs]
81-
pip install git+https://github.com/petercorke/sphinx-autorun.git
82-
pip install sympy
83-
sudo apt-get install graphviz
84-
- name: Build docs
85-
run: |
86-
cd docs
87-
make html
88-
# Tell GitHub not to use jekyll to compile the docs
89-
touch build/html/.nojekyll
90-
cd ../
91-
- name: Commit documentation changes
92-
run: |
93-
git clone https://github.com/petercorke/spatialmath-python.git --branch gh-pages --single-branch gh-pages
94-
cp -r docs/build/html/* gh-pages/
95-
cd gh-pages
96-
git config --local user.email "[email protected]"
97-
git config --local user.name "GitHub Action"
98-
git add .
99-
git commit -m "Update documentation" -a || true
100-
# The above command will fail if no changes were present, so we ignore
101-
# that.
102-
- name: Push changes
103-
uses: ad-m/github-push-action@master
104-
with:
105-
branch: gh-pages
106-
directory: gh-pages
107-
github_token: ${{ secrets.GITHUB_TOKEN }}
69+
uses: ./.github/workflows/sphinx.yml

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v2
2323
- name: Set up Python
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install -U setuptools wheel twine
30+
pip install -U setuptools wheel twine build
3131
- name: Build and publish
3232
env:
3333
TWINE_USERNAME: __token__
3434
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3535
run: |
36-
python setup.py sdist bdist_wheel
36+
python -m build
3737
ls ./dist/*.whl
3838
twine upload dist/*.gz
3939
twine upload dist/*.whl

.github/workflows/sphinx.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sphinx
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
sphinx:
8+
runs-on: ubuntu-latest
9+
if: ${{ github.event_name != 'pull_request' }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.7
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.7
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install .[dev,docs]
20+
pip install git+https://github.com/petercorke/sphinx-autorun.git
21+
pip install sympy
22+
sudo apt-get install graphviz
23+
- name: Build docs
24+
run: |
25+
cd docs
26+
make html
27+
# Tell GitHub not to use jekyll to compile the docs
28+
touch build/html/.nojekyll
29+
cd ../
30+
- name: Commit documentation changes
31+
run: |
32+
git clone https://github.com/petercorke/spatialmath-python.git --branch gh-pages --single-branch gh-pages
33+
cp -r docs/build/html/* gh-pages/
34+
cd gh-pages
35+
git config --local user.email "[email protected]"
36+
git config --local user.name "GitHub Action"
37+
git add .
38+
git commit -m "Update documentation" -a || true
39+
# The above command will fail if no changes were present, so we ignore
40+
# that.
41+
- name: Push changes
42+
uses: ad-m/github-push-action@master
43+
with:
44+
branch: gh-pages
45+
directory: gh-pages
46+
github_token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
# - repo: https://github.com/charliermarsh/ruff-pre-commit
3+
# # Ruff version.
4+
# rev: 'v0.1.0'
5+
# hooks:
6+
# - id: ruff
7+
# args: ['--fix', '--config', 'pyproject.toml']
8+
9+
- repo: https://github.com/psf/black
10+
rev: 23.10.0
11+
hooks:
12+
- id: black
13+
language_version: python3.10
14+
args: ['--config', 'pyproject.toml']
15+
verbose: true
16+
17+
# - repo: https://github.com/pre-commit/mirrors-mypy
18+
# rev: v1.6.1
19+
# hooks:
20+
# - id: mypy

MANIFEST.in

-1
This file was deleted.

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ help:
77
@echo "$(BLUE) make test - run all unit tests"
88
@echo " make coverage - run unit tests and coverage report"
99
@echo " make docs - build Sphinx documentation"
10-
@echo " make docupdate - upload Sphinx documentation to GitHub pages"
1110
@echo " make dist - build dist files"
1211
@echo " make upload - upload to PyPI"
1312
@echo " make clean - remove dist and docs build files"
@@ -17,21 +16,27 @@ test:
1716
pytest
1817

1918
coverage:
20-
coverage run --omit=\*/test_\* -m unittest
19+
coverage run --source='spatialmath' -m pytest
2120
coverage report
21+
coverage html
22+
open htmlcov/index.html
2223

2324
docs: .FORCE
2425
(cd docs; make html)
2526

27+
view:
28+
open docs/build/html/index.html
29+
2630
dist: .FORCE
2731
#$(MAKE) test
2832
python -m build
33+
ls -lh dist
2934

3035
upload: .FORCE
3136
twine upload dist/*
3237

3338
clean: .FORCE
3439
(cd docs; make clean)
3540
-rm -r *.egg-info
36-
-rm -r dist
41+
-rm -r dist build
3742

0 commit comments

Comments
 (0)