Skip to content

Commit f77def1

Browse files
committed
Fixed dependencies for coverage and general tests
1 parent a8505da commit f77def1

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

.github/workflows/pybeamline.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,32 @@ name: pybeamline
55

66
on:
77
push:
8-
branches: [ "master" ]
8+
branches: ["master"]
99
pull_request:
10-
branches: [ "master" ]
10+
branches: ["master"]
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615
strategy:
1716
fail-fast: false
1817
matrix:
19-
python-version: ["3.10", "3.11", "3.12"]
18+
python-version: ["3.9"]
2019

2120
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
31-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32-
- name: Lint with flake8
33-
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Run tests
39-
run: |
40-
python -m unittest discover -s tests
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: "pip"
28+
29+
- name: Install project + dev deps (from pyproject.toml)
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e ".[test]"
33+
34+
- name: Run tests
35+
run: |
36+
python -m unittest discover -s tests

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ dev = [
4545
"pip-tools",
4646
"tox>=4.0"
4747
]
48+
49+
[project.optional-dependencies]
50+
test = ["pytest", "coverage"]

0 commit comments

Comments
 (0)