"plugins/vscode:/vscode.git/clone" did not exist on "01e99e774c2dd6b20292d0e1e33d5dc82e9a0d8a"
Unverified Commit e7aa6ee9 authored by Matti Picus's avatar Matti Picus Committed by GitHub
Browse files

Merge pull request #455 from cclauss/patch-2

GitHub Action to lint Python code
parents dad30479 392930ef
name: lint_python
on: [pull_request, push, workflow_dispatch]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip wheel
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
flake8-comprehensions isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101 . # B101 is assert statements
- run: black --check . || true
- run: codespell --ignore-words-list="commend" # --skip="*.css,*.js,*.lock"
- run: flake8 . --count --max-complexity=10 --max-line-length=88
--show-source --statistics
- run: isort --check-only --profile black .
- run: pip install -r requirements.txt || pip install --editable . || true
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive .
- run: pytest . || pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
......@@ -179,7 +179,7 @@ shell scripts listed above are available for your build and test.
Build options are controlled mainly by the following environment
variables:
* ``MB_PYTHON_VER`` sets the Python version targetted: ``major.minor.patch``
* ``MB_PYTHON_VER`` sets the Python version targeted: ``major.minor.patch``
for CPython, or ``pypy-major.minor`` for PyPy.
* ``MB_PYTHON_OSX_VER`` sets the minimum macOS SDK version for any C
extensions. For CPython targets it may be set to 10.6 or 10.9, provided a
......
......@@ -26,13 +26,14 @@ def tags_for(fname):
def main():
supported = {(tag.interpreter, tag.abi, tag.platform)
for tag in sys_tags()
supported = {
(tag.interpreter, tag.abi, tag.platform) for tag in sys_tags()
}
for fname in sys.argv[1:]:
tags = set(tags_for(fname))
if supported.intersection(tags):
print(fname)
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment