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
31 changes: 19 additions & 12 deletions mypyd.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This bash assumes that other repositories are installed in paralled
# This bash assumes that other repositories are installed in parallel

# requires the latest mypy
# pip install --upgrade mypy
if [ "$#" -eq "0" ]
then
echo "Provide any argument to run setup"
source ../SupportScripts/venv/mypy_runner/bin/activate
else
python3 -m venv ../SupportScripts/venv/mypy_runner
source ../SupportScripts/venv/mypy_runner/bin/activate
pip3 install --upgrade ../SpiNNUtils
pip3 install --upgrade ../SpiNNMachine
pip3 install --upgrade ../SpiNNMan
pip3 install --upgrade ../spalloc
pip3 install --upgrade ../PACMAN
pip3 install --upgrade ../SpiNNFrontEndCommon
pip3 install --upgrade ../TestBase
pip3 install --upgrade ../sPyNNaker[test]
python3 -m pip install --upgrade mypy
fi

utils="../SpiNNUtils/spinn_utilities"
machine="../SpiNNMachine/spinn_machine"
man="../SpiNNMan/spinnman"
pacman="../PACMAN/pacman"
spalloc="../spalloc/spalloc_client"
fec="../SpiNNFrontEndCommon/spinn_front_end_common"
test_base="../TestBase/spinnaker_testbase"

mypy --disallow-untyped-defs $utils $machine $man $pacman $spalloc $fec $test_base spynnaker unittests spynnaker_integration_tests proxy_integration_tests
mypy --disallow-untyped-defs spynnaker unittests spynnaker_integration_tests proxy_integration_tests

4 changes: 3 additions & 1 deletion spynnaker/pyNN/models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import logging
from types import MappingProxyType
from typing import (
Any, Callable, FrozenSet, Iterable, List, Mapping, Optional, Tuple)
Any, Callable, FrozenSet, Iterable, List, Mapping, no_type_check,
Optional, Tuple)
from spinn_utilities.classproperty import classproperty
from spinn_utilities.log import FormatAdapter

Expand Down Expand Up @@ -159,6 +160,7 @@ def wrapper(*args: Any, **kwargs: Any) -> None:
return wrap


@no_type_check
def defaults(cls: type) -> type:
"""
Deprecated! Extend AbstractProvidesDefaults instead
Expand Down
1 change: 1 addition & 0 deletions spynnaker/pyNN/models/populations/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ def __create_model(
is a class to instantiate. Must be ``None`` if ``cell_class`` is an
instantiated object.
"""
model: AbstractPyNNModel | PopulationApplicationVertex
if inspect.isclass(cell_class):
if cell_params is None:
model = cell_class()
Expand Down
2 changes: 1 addition & 1 deletion spynnaker/pyNN/utilities/neo_buffer_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from spynnaker.pyNN.utilities.neo_csv import NeoCsv

if TYPE_CHECKING:
from _csv import _writer as CSVWriter
from _csv import Writer as CSVWriter
from spynnaker.pyNN.models.common.types import Names as ConcreteNames
from spynnaker.pyNN.models.populations.population import Population
from .data_population import DataPopulation
Expand Down
2 changes: 1 addition & 1 deletion spynnaker/pyNN/utilities/neo_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from spynnaker.pyNN.data import SpynnakerDataView

if TYPE_CHECKING:
from _csv import _writer as CSVWriter, _reader as CSVReader
from _csv import Writer as CSVWriter, Reader as CSVReader
from spynnaker.pyNN.utilities.neo_buffer_database import Annotations

logger = FormatAdapter(logging.getLogger(__name__))
Expand Down
Loading