Skip to content

Commit 24c5498

Browse files
authored
♻️ do not run regression tests by default; update test and lint packages (#213)
1 parent e77d989 commit 24c5498

File tree

7 files changed

+20
-27
lines changed

7 files changed

+20
-27
lines changed

.github/workflows/test-regression.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
uses: actions/cache@v3
4141
with:
4242
path: ~/.cache/pip
43-
key: ${{ runner.os }}-test-${{ hashFiles('**/setup.cfg') }}
43+
key: ${{ runner.os }}-dev-${{ hashFiles('setup.cfg') }}
4444
restore-keys: |
45-
${{ runner.os }}-test-
45+
${{ runner.os }}-dev-
4646
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install pip
50-
pip install -e .[test]
50+
pip install -e .[dev]
5151
- name: Run Regression Testing
5252
env:
5353
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
5454
run: |
55-
pytest -m regression tests
55+
pytest -m regression

.github/workflows/unit-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737
uses: actions/cache@v3
3838
with:
3939
path: ~/.cache/pip
40-
key: ${{ runner.os }}-test-${{ hashFiles('**/setup.cfg') }}
40+
key: ${{ runner.os }}-dev-${{ hashFiles('setup.cfg') }}
4141
restore-keys: |
42-
${{ runner.os }}-test-
42+
${{ runner.os }}-dev-
4343
4444
- name: Install dependencies
4545
run: |
4646
python -m pip install pip
47-
pip install -e .[test]
47+
pip install -e .[dev]
4848
4949
- name: Unit testing with pytest
5050
env:
5151
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
5252
run: |
53-
pytest -m "not regression" tests
53+
pytest --cov-fail-under 87

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/ambv/black
3-
rev: 23.10.0
3+
rev: 24.1.1
44
hooks:
55
- id: black
66

77
- repo: https://github.com/pycqa/isort
8-
rev: 5.11.5
8+
rev: 5.13.2
99
hooks:
1010
- id: isort
1111
args: [ "--profile", "black" ]

mindee/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ def __init__(
293293
client
294294
if client
295295
else Client(
296-
api_key=self.parsed_args.api_key
297-
if "api_key" in self.parsed_args
298-
else None
296+
api_key=(
297+
self.parsed_args.api_key if "api_key" in self.parsed_args else None
298+
)
299299
)
300300
)
301301
self._set_input()

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ safe_licenses = [
3232
]
3333

3434
[tool.pytest.ini_options]
35+
addopts = "--pyargs --cov mindee --cov-report term:skip-covered --cov-report term-missing -m 'not regression'"
36+
python_files = "test*.py"
37+
junit_family = "xunit2"
3538
markers = [
36-
"regression: marks tests as regression tests (deselect with '-m \"not regression\"')",
39+
"regression: marks tests as regression tests - select with '-m regression'",
3740
"lineitems: debug line items"
3841
]
3942
testpaths = [

setup.cfg

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,13 @@ mindee =
4848

4949
[options.extras_require]
5050
dev =
51-
black==23.10.0
52-
mypy==1.6.1
5351
pylint==2.17.7
5452
setuptools==51.3.3
55-
isort==5.11.5
5653
pre-commit~=2.21.0
57-
pydocstyle==6.3.0
5854
types-pytz~=2023.3
5955
types-requests~=2.31
60-
test =
61-
pytest~=7.1
62-
pytest-cov~=4.0
56+
pytest~=7.4
57+
pytest-cov~=4.1
6358
docs =
6459
sphinx~=5.3
6560
sphinx_rtd_theme~=1.1
@@ -70,8 +65,3 @@ build =
7065

7166
[options.packages.find]
7267
exclude = tests
73-
74-
[tool:pytest]
75-
addopts = --pyargs --cov-fail-under 85 --cov-config=.coveragerc --cov mindee --cov-report term:skip-covered --cov-report term-missing
76-
python_files = test*.py
77-
junit_family = xunit2

tests/test_pkg_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ def test_style_pkg_versions():
3030
pkg_version = lines[idx + 1].strip().split(":")[-1].strip()
3131
pre_commit_versions[pkg_name] = pkg_version
3232

33-
for req in ("black", "pylint", "isort", "pydocstyle", "mypy"):
33+
for req in ("pylint",):
3434
_test_version(requirements_versions, pre_commit_versions, req)

0 commit comments

Comments
 (0)