Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into http
Browse files Browse the repository at this point in the history
# Conflicts:
#	walker.pl
  • Loading branch information
Christian-B committed Jul 17, 2023
2 parents c517e06 + 43613e2 commit 71bfd20
Show file tree
Hide file tree
Showing 24 changed files with 472 additions and 77 deletions.
12 changes: 8 additions & 4 deletions actions/checkout-spinn-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@
# limitations under the License.

name: "Check out and install SpiNNaker dependencies"
description: >
Checks out (and optionally installs) SpiNNaker dependencies.
inputs:
repositories:
description: The list of SpiNNaker dependencies to check out
description: >
The list of SpiNNaker dependencies to check out. Space-separated
required: true
install:
description: Whether to install the dependency after checking it out
required: false
default: false
default: "false"
preinstall:
description: Whether to pre-install the dependencies before running the installer
description: >
Whether to pre-install the dependencies before running the installer
required: false
default: false
default: "false"
requirements-filename:
description: The name of the requirements file
required: false
Expand Down
13 changes: 7 additions & 6 deletions actions/configure-spynnaker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# limitations under the License.

name: "Configure sPyNNaker for Execution"
description: "Creates a sPyNNaker configuration file."
description: >
Creates a sPyNNaker configuration file.
inputs:
board-address:
description: The IP address of the SpiNNaker board to talk to directly
Expand All @@ -22,31 +23,31 @@ inputs:
version:
description: What version of SpiNNaker board to talk to
required: false
default: 5
default: "5"
spalloc:
description: Where the spalloc server is located
required: false
default: spinnaker.cs.man.ac.uk
port:
description: What port to contact spalloc on
required: false
default: 22444
default: "22444"
user:
description: What user name to use for spalloc
required: false
default: GitHub Action Test
virtual:
description: Whether to use a virtual machine
required: false
default: false
default: "false"
width:
description: The width of the virtual machine, in chips
required: false
default: 8
default: "8"
height:
description: The height of the virtual machine, in chips
required: false
default: 8
default: "8"
time_scale_factor:
description: Time scale factor allows the slowing down of the simulation
required: false
Expand Down
5 changes: 4 additions & 1 deletion actions/install-matplotlib/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
# as different versions of matplotlib and python are released.

name: Install matplotlib
description: >
Installs matplotlib in a way that is suitable for running CI workflows
against for the purposes of testing.
inputs:
back-end:
description: Which rendering engine to use, a python module name
description: Which rendering engine to use, a Python module name
required: false
default: matplotlib.backends.backend_agg
runs:
Expand Down
29 changes: 17 additions & 12 deletions actions/install-spinn-deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Copyright (c) 2020 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# https://www.apache.org/licenses/LICENSE-2.0
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Note that this action (especially its requirements file) may need updating
# as different versions of matplotlib and python are released.

name: "Check out and install SpiNNaker dependencies"
description: >
Checks out (and optionally installs) SpiNNaker dependencies.
inputs:
repositories:
description: The list of SpiNNaker dependencies to check out
description: >
The list of SpiNNaker dependencies to check out. Space-separated
required: true
install:
description: Whether to install the dependency after checking it out
required: false
default: false
default: "false"
runs:
using: composite
steps:
Expand Down
17 changes: 17 additions & 0 deletions actions/install-spinn-deps/gitclone.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
#!/bin/sh
# Copyright (c) 2020 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Note that this action (especially its requirements file) may need updating
# as different versions of matplotlib and python are released.

# This script works when called from a github action on PUSH not for PULL_REQUEST

REPO=$1
Expand Down
56 changes: 40 additions & 16 deletions actions/pylint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,59 @@ inputs:
disable:
description: The messages/categories to disable
required: false
default: "R,C"
default: "R"
jobs:
description: The number of Python processes to use
required: false
default: 1
default: "1"
rcfile:
description: The name of the pylint rc file
required: false
default: .pylintrc
exitcheck:
description: The combined results code to fail on
required: false
default: 35
default: "6" # Action fails on ERROR or WARNING
# Pylint should leave with following status code:
# 0 if everything went fine
# 1 if a fatal message was issued
# 2 if an error message was issued
# 4 if a warning message was issued
# 8 if a refactor message was issued
# 16 if a convention message was issued
# 32 on usage error
# 0 if everything went fine
# 1 if a fatal message was issued
# 2 if an error message was issued
# 4 if a warning message was issued
# 8 if a refactor message was issued
# 16 if a convention message was issued
# 32 on usage error
# to die on fatal, error or usage the recommended way is
# exit $(($? & 35))
# exit $(($? & 35))
# We handle that internally.
#
# Also note that we ALWAYS die on Fatal or Usage problems; others are
# selectable.
language:
description: The (human) language to use for spell checking
required: false
default: ""
dictionary:
description: The custom dictionary to use for spell checking
required: false
default: .pylint_dict.txt
runs:
using: composite
steps:
- run: |
pylint --output-format=colorized --disable=${{ inputs.disable }} \
--persistent=no --jobs=${{ inputs.jobs }} --rcfile=${{ inputs.rcfile }} \
${{ inputs.package }} || exit $(($? & ${{ inputs.exitcheck }}))
# Note that there's special conditioning of the return code of pylint
- name: Build composite dictionary
run: source $SUPPORT_DIR/mkdict.bash
shell: bash
env:
BASE_DICTIONARY: ${{ github.action_path }}/default_dict.txt
DICTIONARY: ${{ inputs.dictionary }}
SUPPORT_DIR: ${{ github.action_path }}
- name: Run pylint
run: source $SUPPORT_DIR/run_pylint.bash
shell: bash
env:
PACKAGES: ${{ inputs.package }}
DISABLE_CATS: ${{ inputs.disable }}
RC: ${{ inputs.rcfile }}
JOBS: ${{ inputs.jobs }}
SPELL_LANG: ${{ inputs.language }}
FAIL_CODE: ${{ inputs.exitcheck }}
SUPPORT_DIR: ${{ github.action_path }}
106 changes: 106 additions & 0 deletions actions/pylint/default_dict.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Copyright (c) 2023 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Our abbreviations/names
FEC
ASB
sPyNNaker
DBs
SCP
SDP
BMP
EIEIO
STDP
SDRAM
APLX
DSG
RNG

# Sphinx keyword
attr
ivar
py
rtype

# Python types
bool
int
str
dict
frozenset
bytearray
memoryview
ndarray
traceback
timedelta

# Python pseudo-types
iterable

# Python specials
args
kwargs
eval
setattr
metaclass
abstractmethod
abstractproperty
classmethod
classproperty
getx
setx
isinstance

# Python packages
math
io
os
sys
datetime
configparser
matplotlib
numpy
scipy
testfixtures
abc
zipfile

# Misc
stdin
whitespace
ids
submessage
subclassed
subclassing
src
dest
msg
spynnaker
cfg
etc
defaultable
undelayed
unpartitioned
unregisters
unsets
writable
datasheet
microsiemens
nanoamps
nanofarads
timestep
timesteps
bitfield
bitfields
routable
22 changes: 22 additions & 0 deletions actions/pylint/mkdict.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Copyright (c) 2020 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

dict=/tmp/dict.txt

cat "$BASE_DICTIONARY" >$dict
if test -r $DICTIONARY; then
cat "$DICTIONARY" >>$dict
fi
33 changes: 33 additions & 0 deletions actions/pylint/run_pylint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright (c) 2020 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

dict=/tmp/dict.txt

set +e
if test -n "$SPELL_LANG"; then
pylint --output-format=colorized "--disable=$DISABLE_CATS" \
--persistent=no "--jobs=$JOBS" "--rcfile=$RC" \
"--spelling-dict=$SPELL_LANG" "--spelling-private-dict-file=$dict" \
$PACKAGES
else
pylint --output-format=colorized "--disable=$DISABLE_CATS" \
--persistent=no "--jobs=$JOBS" "--rcfile=$RC" \
$PACKAGES
fi

# Note that there's special conditioning of the return code of pylint
exit $(( $? & ($FAIL_CODE | 33) ))
# Fatal (1) and Usage (32) errors are ALWAYS enabled in the bit mask
Loading

0 comments on commit 71bfd20

Please sign in to comment.