Skip to content

Commit

Permalink
Use mypy in lint
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Apr 27, 2024
1 parent ba7a2c9 commit 73c59ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Packages
run: pip install -r tests/requirements.txt
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ fate-suite:
rsync -vrltLW rsync://fate-suite.ffmpeg.org/fate-suite/ tests/assets/fate-suite/

lint:
black --check av examples tests
black --check av examples tests setup.py
flake8 av examples tests
isort --check-only --diff av examples tests
mypy av tests

test:
$(PYTHON) setup.py test
2 changes: 0 additions & 2 deletions av/codec/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,4 @@ class CodecContext:
def parse(
self, raw_input: bytes | bytearray | memoryview | None = None
) -> list[Packet]: ...
def encode(self, frame: Frame | None) -> list[Packet]: ...
def decode(self, packet: Packet | None) -> list[Frame]: ...
def flush_buffers(self) -> None: ...
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_config_from_pkg_config():
"""
Get distutils-compatible extension arguments using pkg-config.
"""
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
pkg_config = os.environ.get("PKG_CONFIG", "pkg-config")
try:
raw_cflags = subprocess.check_output(
[pkg_config, "--cflags", "--libs"]
Expand Down Expand Up @@ -180,7 +180,9 @@ def parse_cflags(raw_flags):
exec(fp.read(), about)

package_folders = pathlib.Path("av").glob("**/")
package_data = {".".join(pckg.parts): ["*.pxd", "*.pyi", "*.typed"] for pckg in package_folders}
package_data = {
".".join(pckg.parts): ["*.pxd", "*.pyi", "*.typed"] for pckg in package_folders
}


with open("README.md") as f:
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ isort
flake8
flake8-pyproject
sphinx==5.1.0
mypy==1.10.0

0 comments on commit 73c59ea

Please sign in to comment.