Skip to content

Commit 46db94f

Browse files
authored
tests: remove tox (#226)
- dev: removed pre-commit - tests: added PyPy 3.9
1 parent 2cc01a9 commit 46db94f

File tree

12 files changed

+113
-135
lines changed

12 files changed

+113
-135
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: daily
8+
labels:
9+
- dependencies
10+
- QA/CI
11+
12+
# Python requirements
13+
- package-ecosystem: pip
14+
directory: /
15+
schedule:
16+
interval: daily
17+
assignees:
18+
- BoboTiG
19+
labels:
20+
- dependencies

.github/workflows/tests.yml

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,84 @@ on:
1111
- "mss/**"
1212

1313
jobs:
14-
lint:
15-
name: Code quality checks
14+
quality:
15+
name: Quality
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v3
19-
with:
20-
ref: ${{ github.event.inputs.branch }}
21-
- uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.x"
24-
- name: Install test dependencies
25-
run: python -m pip install -U pip wheel tox
26-
- name: Tests
27-
run: python -m tox -e lint
28-
29-
types:
30-
name: Types checks
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@v3
34-
with:
35-
ref: ${{ github.event.inputs.branch }}
3619
- uses: actions/setup-python@v4
3720
with:
3821
python-version: "3.x"
39-
- name: Install test dependencies
40-
run: python -m pip install -U pip wheel tox
22+
cache: pip
23+
cache-dependency-path: dev-requirements.txt
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install -U pip wheel
27+
python -m pip install -r dev-requirements.txt
4128
- name: Tests
42-
run: python -m tox -e types
29+
run: ./check.sh
4330

4431
documentation:
45-
name: Documentation build
32+
name: Documentation
4633
runs-on: ubuntu-latest
4734
steps:
4835
- uses: actions/checkout@v3
49-
with:
50-
ref: ${{ github.event.inputs.branch }}
5136
- uses: actions/setup-python@v4
5237
with:
5338
python-version: "3.x"
39+
cache: pip
40+
cache-dependency-path: dev-requirements.txt
5441
- name: Install test dependencies
55-
run: python -m pip install -U pip wheel tox
42+
run: |
43+
python -m pip install -U pip wheel
44+
python -m pip install -r dev-requirements.txt
5645
- name: Tests
57-
run: python -m tox -e docs
46+
run: |
47+
sphinx-build -d docs docs/source docs_out --color -W -bhtml
5848
5949
tests:
60-
name: "${{ matrix.os }} for ${{ matrix.python }}"
61-
runs-on: ${{ matrix.os }}
50+
name: "${{ matrix.os.emoji }} ${{ matrix.python.name }}"
51+
runs-on: ${{ matrix.os.runs-on }}
6252
strategy:
6353
fail-fast: false
6454
matrix:
65-
os: [ubuntu-latest, windows-latest, macos-latest]
66-
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
55+
os:
56+
- emoji: 🐧
57+
runs-on: [ubuntu-latest]
58+
- emoji: 🍎
59+
runs-on: [macos-latest]
60+
- emoji: 🪟
61+
runs-on: [windows-latest]
62+
python:
63+
- name: CPython 3.7
64+
runs-on: "3.7"
65+
- name: CPython 3.8
66+
runs-on: "3.8"
67+
- name: CPython 3.9
68+
runs-on: "3.9"
69+
- name: CPython 3.10
70+
runs-on: "3.10"
71+
- name: CPython 3.11
72+
runs-on: "3.11"
73+
- name: PyPy 3.9
74+
runs-on: "pypy-3.9"
6775
steps:
6876
- uses: actions/checkout@v3
69-
with:
70-
ref: ${{ github.event.inputs.branch }}
7177
- uses: actions/setup-python@v4
7278
with:
73-
python-version: ${{ matrix.python }}
79+
python-version: ${{ matrix.python.runs-on }}
80+
cache: pip
81+
cache-dependency-path: dev-requirements.txt
7482
- name: Install test dependencies
75-
run: python -m pip install -U pip wheel tox
83+
run: |
84+
python -m pip install -U pip wheel
85+
python -m pip install -r dev-requirements.txt
7686
- name: Tests on GNU/Linux
77-
if: matrix.os == 'ubuntu-latest'
87+
if: matrix.os.emoji == '🐧'
7888
run: |
7989
export DISPLAY=:99
80-
sudo Xvfb -ac ${DISPLAY} -screen 0 1280x1024x24 > /dev/null 2>&1 &
81-
python -m tox -e py
90+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
91+
python -m pytest
8292
- name: Tests on other platforms
83-
if: matrix.os != 'ubuntu-latest'
84-
run: python -m tox -e py
93+
if: matrix.os.emoji != '🐧'
94+
run: python -m pytest

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
build/
22
.cache/
33
dist/
4+
*.doctree
5+
docs_out/
46
*.egg-info/
57
.idea/
68
.DS_Store
79
*.orig
810
*.jpg
911
*.png
1012
*.png.old
13+
*.pickle
1114
*.pyc
1215
.pytest_cache
13-
.tox
1416
.vscode
1517
docs/output/
1618
.mypy_cache/

.pre-commit-config.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ History:
22

33
<see Git checking messages for history>
44

5+
7.0.2 2023/0x/xx
6+
- dev: removed pre-commit
7+
- tests: removed tox
8+
- tests: added PyPy 3.9
9+
510
7.0.1 2022/10/27
611
- fixed the wheel package
712
- removed support for Python 3.6

check.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
#
3+
# Small script to ensure quality checks pass before submitting a commit/PR.
4+
#
5+
python -m isort docs mss
6+
python -m black docs mss
7+
python -m flake8 docs mss
8+
python -m pylint mss
9+
# "--platform win32" to not fail on ctypes.windll (it does not affect the overall check on other OSes)
10+
python -m mypy --platform win32 --exclude mss/tests mss docs/source/examples

dev-requirements.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-e .
2+
black
3+
build
4+
flake8
5+
flaky
6+
pytest
7+
pytest-cov
8+
mypy
9+
numpy; platform_python_implementation != "pypy"
10+
numpy==1.15.4; platform_python_implementation == "pypy"
11+
pillow
12+
pylint
13+
sphinx
14+
twine
15+
wheel

docs/source/developers.rst

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,25 @@ Setup
1111
2. Create you own branch.
1212
3. Be sure to add/update tests and documentation within your patch.
1313

14-
Additionally, you can install `pre-commit <http://pre-commit.com/>`_ to ensure you are doing things well::
15-
16-
$ python -m pip install -U --user pre-commit
17-
$ pre-commit install
18-
1914

2015
Testing
2116
=======
2217

2318
Dependency
2419
----------
2520

26-
You will need `tox <https://pypi.org/project/tox/>`_::
21+
You will need `pytest <https://pypi.org/project/pytest/>`_::
2722

28-
$ python -m pip install -U --user tox
23+
$ python -m pip install -U pip wheel
24+
$ python -m pip install -r dev-requirements.txt
2925

3026

3127
How to Test?
3228
------------
3329

3430
Launch the test suit::
3531

36-
$ tox
37-
38-
# or
39-
$ TOXENV=py37 tox
32+
$ python -m pytest
4033

4134
This will test MSS and ensure a good code quality.
4235

@@ -46,20 +39,12 @@ Code Quality
4639

4740
To ensure the code is always well enough using `flake8 <https://pypi.org/project/flake8/>`_::
4841

49-
$ TOXENV=lint tox
50-
51-
52-
Static Type Checking
53-
====================
54-
55-
To check type annotation using `mypy <http://mypy-lang.org/>`_::
56-
57-
$ TOXENV=types tox
42+
$ ./check.sh
5843

5944

6045
Documentation
6146
=============
6247

6348
To build the documentation, simply type::
6449

65-
$ TOXENV=docs tox
50+
$ sphinx-build -d docs docs/source docs_out --color -W -bhtml

mss/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def main(args: Optional[List[str]] = None) -> int:
8181
return 1
8282

8383

84-
if __name__ == "__main__":
84+
if __name__ == "__main__": # pragma: nocover
8585
import sys
8686

8787
sys.exit(main(sys.argv[1:]))

mss/tests/test_setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
if platform.system().lower() != "linux":
1313
pytestmark = pytest.mark.skip
1414

15-
# Note: using `--no-isolation` because it doesn't work with `tox`
16-
INSTALL = "python -m build --no-isolation --sdist --wheel".split()
15+
INSTALL = "python -m build --sdist --wheel".split()
1716
CHECK = "twine check dist/*".split()
1817

1918

0 commit comments

Comments
 (0)