Skip to content

Commit 241d422

Browse files
committed
tests and reinstall script
1 parent 9e6456a commit 241d422

File tree

3 files changed

+108
-1
lines changed

3 files changed

+108
-1
lines changed

.github/workflows/build.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
os: [ubuntu-latest]
17+
python-version: ["3.10", "3.12"]
18+
# We aim to support the versions on pytorch.org
19+
# as well as selected previous versions on
20+
# https://pytorch.org/get-started/previous-versions/
21+
torch-version: ["2.4.0"]
22+
include:
23+
- os: windows-latest
24+
torch-version: 2.4.0
25+
python-version: "3.12"
26+
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- name: Cache dependencies
31+
id: pip-cache
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.cache/pip
35+
key: pip-os_${{ runner.os }}-python_${{ matrix.python-version }}-torch_${{ matrix.torch-version }}
36+
37+
- name: Checkout code
38+
uses: actions/checkout@v2
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Install package
46+
run: |
47+
python -m pip install --upgrade pip setuptools wheel
48+
python -m pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
49+
pip install '.[dev]'
50+
51+
- name: Run the formatter
52+
run: |
53+
make format
54+
55+
- name: Run the spelling detector
56+
run: |
57+
make codespell
58+
59+
- name: Check CITATION.cff validity
60+
run: |
61+
cffconvert --validate
62+
63+
- name: Check that no binary files have been added to repo
64+
if: matrix.os == 'ubuntu-latest'
65+
run: |
66+
make check_for_binary
67+
68+
- name: Run pytest tests
69+
timeout-minutes: 10
70+
run: |
71+
make test
72+
73+
- name: Build package
74+
run: |
75+
make build
76+
77+
- name: Check reinstall script
78+
timeout-minutes: 10
79+
run: |
80+
./reinstall.sh

.github/workflows/release-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update internal release
1+
name: release
22

33
on:
44
push:

reinstall.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Re-install the package. By running './reinstall.sh'
4+
#
5+
# Note that AROS uses the build
6+
# system specified in
7+
# PEP517 https://peps.python.org/pep-0517/ and
8+
# PEP518 https://peps.python.org/pep-0518/
9+
# and hence there is no setup.py file.
10+
11+
set -e # abort on error
12+
13+
pip uninstall -y aros-node
14+
15+
# Get version info after uninstalling --- this will automatically get the
16+
# most recent version based on the source code in the current directory.
17+
# $(tools/get_cebra_version.sh)
18+
VERSION=0.0.1
19+
echo "Upgrading to AROS v${VERSION}"
20+
21+
# Upgrade the build system (PEP517/518 compatible)
22+
python3 -m pip install virtualenv
23+
python3 -m pip install --upgrade build
24+
python3 -m build --sdist --wheel .
25+
26+
# Reinstall the package with most recent version
27+
pip install --upgrade --no-cache-dir "dist/aros_node-${VERSION}-py3-none-any.whl"

0 commit comments

Comments
 (0)