diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dd658b..91d2e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,23 +16,28 @@ jobs: use-isort: true test: - runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + python-version: [3.8] + poetry-version: [1.3.1] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} steps: + - name: Install graphviz deps + run: sudo apt-get install -y graphviz-dev - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - uses: actions/setup-python@v2 with: - python-version: 3.8 - - name: Install Poetry - uses: snok/install-poetry@v1 + python-version: ${{ matrix.python-version }} + - name: Run image + uses: abatilo/actions-poetry@v2.0.0 with: - version: 1.1.1 - virtualenvs-create: false - - name: Install Dependencies + poetry-version: ${{ matrix.poetry-version }} + - name: Install dependencies run: poetry install - - name: Running pytest - run: poetry run pytest + - name: Run tests + run: poetry run pytest docs: needs: [test] diff --git a/pymint/mintcompiler.py b/pymint/mintcompiler.py index f6cf143..ee4272c 100644 --- a/pymint/mintcompiler.py +++ b/pymint/mintcompiler.py @@ -2,6 +2,7 @@ from typing import Dict, Optional from parchmint import Layer, Target +from parchmint.device import ValveType from pymint.antlrgen.mintListener import mintListener from pymint.antlrgen.mintParser import mintParser @@ -384,12 +385,8 @@ def exitValveStat(self, ctx: mintParser.ValveStatContext): valve_name = ctx.ufname()[0].getText() # type: ignore if not (self._current_layer is not None and self._current_layer.ID is not None): raise AssertionError - valve_component = self.current_device.create_mint_component( - valve_name, - entity, - self.current_params, - [self._current_layer.ID], - ) + + # Get the connection information connection_name = ctx.ufname()[1].getText() # type: ignore valve_connection = self.current_device.device.get_connection(connection_name) if valve_connection is None: @@ -399,7 +396,14 @@ def exitValveStat(self, ctx: mintParser.ValveStatContext): ) ) - self.current_device.device.map_valve(valve_component, valve_connection) + self.current_device.create_valve( + name=valve_name, + technology=entity, + params=self.current_params, + layer_ids=[self._current_layer.ID], + connection=valve_connection, + valve_type=ValveType.NORMALLY_OPEN, + ) def enterViaStat(self, ctx: mintParser.ViaStatContext): if self.current_device is None: diff --git a/pyproject.toml b/pyproject.toml index 8b91b0c..c782d34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,3 +43,9 @@ docs = ["sphinx"] [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +minversion = "6.0" +testpaths = [ + "./tests/" +] \ No newline at end of file