Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mypy in lint #1388

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading