Skip to content

Commit

Permalink
setting up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed May 27, 2024
1 parent c1fd4f6 commit 6953258
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

name: Build and test
on:
push:
branches: [ "main", "dev-json" ]
pull_request:
branches: [ "main" ]
merge_group:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
Expand All @@ -29,7 +24,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pytest
python -m install
- name: install xDEVS
run: |
python -m pip install .
- name: Test with pytest
run: |
pytest
3 changes: 2 additions & 1 deletion xdevs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def __len__(self) -> int:
return sum((len(port) for port in self._bag), len(self._values))

def __str__(self) -> str:
return f'{self.name}<{self.p_type.__name__ if self.p_type is not None else 'None'}>'
p_type = self.p_type.__name__ if self.p_type is not None else 'None'
return f'{self.name}<{p_type}>'

def __repr__(self) -> str:
return str(self)
Expand Down
3 changes: 2 additions & 1 deletion xdevs/plugins/input_handlers/bad_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def __init__(self, **kwargs):
:param str handler_type: transducer type.
"""
super().__init__(**kwargs)
raise ImportError(f'{kwargs.get('handler_type')} input handler specific dependencies are not imported')
handler_type = kwargs['handler_type']
raise ImportError(f'{handler_type} input handler specific dependencies are not imported')

def run(self):
pass
3 changes: 2 additions & 1 deletion xdevs/plugins/output_handlers/bad_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def __init__(self, **kwargs):
:param str handler_type: transducer type.
"""
super().__init__(**kwargs)
raise ImportError(f'{kwargs['handler_type']} input handler specific dependencies are not imported')
handler_type = kwargs['handler_type']
raise ImportError(f'{handler_type} input handler specific dependencies are not imported')

def run(self):
pass
3 changes: 2 additions & 1 deletion xdevs/plugins/transducers/bad_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def __init__(self, **kwargs):
:param str transducer_type: transducer type.
"""
super().__init__(**kwargs)
raise ImportError(f'{kwargs.get('transducer_type')} transducer specific dependencies are not imported')
transducer_type = kwargs['transducer_type']
raise ImportError(f'{transducer_type} transducer specific dependencies are not imported')

def create_known_data_types_map(self):
pass
Expand Down
3 changes: 2 additions & 1 deletion xdevs/plugins/wrappers/bad_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def __init__(self, **kwargs):
:param str wrapper_type: wrapper type.
"""
super().__init__(**kwargs)
raise ImportError(f'{kwargs['wrapper_type']} wrapper specific dependencies are not installed')
wrapper_type = kwargs['wrapper_type']
raise ImportError(f'{wrapper_type} wrapper specific dependencies are not installed')

def deltint(self):
pass
Expand Down

0 comments on commit 6953258

Please sign in to comment.