diff --git a/.github/workflows/host.yml b/.github/workflows/host.yml new file mode 100644 index 0000000..61f6530 --- /dev/null +++ b/.github/workflows/host.yml @@ -0,0 +1,36 @@ +name: python + +on: + push: + pull_request: + workflow_dispatch: + + # Run automatically every monday + schedule: + - cron: 1 12 * * 1 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' + + name: test (${{ matrix.python-version }}) + steps: + - uses: actions/checkout@v1 + - name: Set up PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pdm install -G :all + - name: Run tests + run: pdm run test diff --git a/apollo_fpga/protocol/jtag_svf.py b/apollo_fpga/protocol/jtag_svf.py index c5beab8..dd1700e 100644 --- a/apollo_fpga/protocol/jtag_svf.py +++ b/apollo_fpga/protocol/jtag_svf.py @@ -127,7 +127,7 @@ def _lex(self): else: line, column = self.line_column() print_args = (line, column, self.buffer[self.position:self.position + 16]) - raise SVFParsingError("unrecognized SVF data at line {}, column {} ({}...)".format(print_args)) + raise SVFParsingError("unrecognized SVF data at line {}, column {} ({}...)".format(*print_args)) def peek(self): """Return the next token without advancing the position.""" diff --git a/pyproject.toml b/pyproject.toml index 606a271..bf148bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,12 @@ dependencies = [ "pyxdg>=0.27", ] +[project.optional-dependencies] +py_ci = [ + "amaranth==0.4.1", + "luna-usb @ git+https://github.com/greatscottgadgets/luna@main" +] + [project.urls] repository = "https://github.com/greatscottgadgets/apollo" @@ -41,3 +47,6 @@ include = ["apollo_fpga*"] [project.scripts] apollo = "apollo_fpga.commands.cli:main" + +[tool.pdm.scripts] +test.cmd = "python -m unittest discover -p jtag_svf.py -v"