Skip to content

Commit

Permalink
Run mypy on GitHub actions. (twisted#1349)
Browse files Browse the repository at this point in the history
* Run mypy on GitHub actions based on GitHub Actions template for Python.

- Remove mypy from azure pipelines.
- Run on any change.
- Add a status badge for GitHub Actions on mypy
- Update mypy run.

Author: adiroiban
Reviewer: rodrigc
Fixes: ticket:9903
  • Loading branch information
adiroiban committed Jul 17, 2020
1 parent 9e0adce commit 56c2a4b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 27 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/mypy.yaml
@@ -0,0 +1,48 @@
#
# GitHub actions Python based test runs.
#
# Available VMs:
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
#
# Example Python workflow
# https://docs.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#starting-with-the-python-workflow-template
name: mypy

on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]

jobs:
test_run:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
tox -e mypy --notest
# You can test your matrix by printing the current Python version
- name: Display Python information
run: |
python --version
python -c "import sys; print(sys.prefix)"
python -c "import sys; print(sys.exec_prefix)"
python -c "import sys; print(sys.executable)"
python -c "import struct; print(struct.calcsize('P') * 8)"
python -c 'print("\nENVIRONMENT VARIABLES\n=====================\n")'
python -c "import os; [print(k, v) for k,v in os.environ.items()]"
- name: Test with mypy
run: |
tox -q -e mypy
4 changes: 4 additions & 0 deletions README.rst
Expand Up @@ -4,6 +4,7 @@ Twisted
|pypi|_
|travis|_
|circleci|_
|mypy|_

For information on changes in this release, see the `NEWS <NEWS.rst>`_ file.

Expand Down Expand Up @@ -111,3 +112,6 @@ Again, see the included `LICENSE <LICENSE>`_ file for specific legal details.

.. |circleci| image:: https://circleci.com/gh/twisted/twisted.svg?style=svg
.. _circleci: https://circleci.com/gh/twisted/twisted

.. |mypy| image:: https://github.com/twisted/twisted/workflows/mypy.yaml/badge.svg
.. _mypy: https://github.com/twisted/twisted
25 changes: 0 additions & 25 deletions azure-pipelines/mypy_jobs.yml

This file was deleted.

2 changes: 0 additions & 2 deletions azure-pipelines/tests_pipeline.yml
Expand Up @@ -40,5 +40,3 @@ jobs:
py37: "3.7"
py38: "3.8"
reactor: iocp

- template: 'mypy_jobs.yml'
Empty file.

0 comments on commit 56c2a4b

Please sign in to comment.