Skip to content

Commit

Permalink
Migrate to Github CI (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Aug 22, 2021
1 parent cf8ebe0 commit 0176357
Show file tree
Hide file tree
Showing 25 changed files with 232 additions and 198 deletions.
32 changes: 0 additions & 32 deletions .appveyor.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
[run]
source = aiohttp_devtools
branch = True
concurrency = multiprocessing
omit =
# __main__ is trivial and hard to test properly
*/__main__.py

[report]
precision = 2
exclude_lines =
pragma: no cover

raise NotImplementedError
raise NotImplemented
130 changes: 130 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: CI

on:
push:
branches:
- master
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
tags: [ 'v*' ]
pull_request:
branches:
- master
- '[0-9].[0-9]+'
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build


jobs:

lint:
name: Linter
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache PyPI
uses: actions/cache@v2
with:
key: pip-lint-${{ hashFiles('requirements-dev.txt') }}
path: ~/.cache/pip
restore-keys: |
pip-lint-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements-dev.txt
- name: Install itself
run: |
pip install .
- name: Lint
run: |
make lint
- name: Prepare twine checker
run: |
pip install -U twine wheel
python setup.py sdist bdist_wheel
- name: Run twine checker
run: |
twine check dist/*
test:
name: Test
needs: lint
strategy:
matrix:
pyver: [3.6, 3.7]
os: [ubuntu, macos]
#include:
# - pyver: pypy3
# os: ubuntu
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)" # - name: Cache
- name: Cache PyPI
uses: actions/cache@v2
with:
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ hashFiles('requirements-dev.txt') }}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements-dev.txt
- name: Install JS dependencies
run: grablib
- name: Run unittests
env:
COLOR: 'yes'
run: |
pytest
python -m coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unit
fail_ci_if_error: false

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: test
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run:
python -m pip install -U pip wheel twine
- name: Install JS dependencies
run: grablib
- name: Make dists
run:
python setup.py sdist bdist_wheel
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: pAzJhAD5HNzxvbNg/UwquwPXOp6V27gi4MpqCs6mK2Hy9h3Ii8vVWzEUx06v2aqT5b3P7FDBRW8+t9oL+aS/dZxeOtA/jNzROxMhFtRbpv1F/Mvd6ocz7yb3yg9WUlc7bhuyN6GUxsw4esATElQygqZucXRGsg+yauiTTd2X1CK6zrTz7/5lhF5H41oMzBKBZgvEUjDzaTs+C+B0bEifADVsI8QDa4EUTzCc93qf2z1jllDd/Jww9MK6xdBJJCoXjfBtWSjnoBANN/Ikthy8yY2PXvbLKH7K4Ri+ED72tLXThuTEsmquj20TnR30Hpm0LjwfdZ1+2O0X0PMyjMIRoATR0D9XdSP36FZs19zyRRFwHYKxZvXKSv+rZxz1rZYbbPojNW/498zlWcI8R9TxqPg/6dnrO1StnltLmN784AVBQr172CX/Ji3BF1bVytgdKqstGVN6d1JJWPuFVNfGpVHJJZEEuOBndK7yoSSV4zMva5wXplETVyGWfPiqvQCtylq8IatXbFxA0trCMW1kQEwBMBLbYrqx6ZIHQJ4Z46ng7OIYdRPod7fkK7e0lXU7OexfXad/UOWfkayOG1C93MWxeVho8ZQrBCdrHd1a5iujAfW8pk7Al8f2gS8L7nZTXUlkWK2ppX9PDOv1O0frtFc1prje+9AzROFC8UXxJk8=
run: |
twine upload dist/*
46 changes: 46 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[mypy]
files = aiohttp_devtools, tests
check_untyped_defs = True
follow_imports_for_stubs = True
#disallow_any_decorated = True
disallow_any_generics = True
#disallow_incomplete_defs = True
disallow_subclassing_any = True
#disallow_untyped_calls = True
disallow_untyped_decorators = True
#disallow_untyped_defs = True
implicit_reexport = False
no_implicit_optional = True
show_error_codes = True
strict_equality = True
warn_incomplete_stub = True
warn_redundant_casts = True
warn_unreachable = True
warn_unused_ignores = True
disallow_any_unimported = True
warn_return_any = True

[mypy-tests.*]
ignore_errors = True
disallow_any_decorated = False
disallow_untyped_calls = False
disallow_untyped_defs = False

[mypy-aiohttp_devtools.start.*]
ignore_errors = True

[mypy-aiohttp_devtools.logs]
ignore_errors = True

[mypy-aiohttp_devtools.runserver.*]
ignore_errors = True


[mypy-aiohttp_debugtoolbar.*]
ignore_missing_imports = True

[mypy-devtools.*]
ignore_missing_imports = True

[mypy-pygments.*]
ignore_missing_imports = True
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ install:
pip install -r tests/requirements.txt
grablib

.PHONY: isort
isort:
isort -rc -w 120 aiohttp_devtools
isort -rc -w 120 tests

.PHONY: lint
lint:
python setup.py check -rms
flake8 aiohttp_devtools/ tests/
isort -rc -w 120 --check-only aiohttp_devtools
isort -rc -w 120 --check-only tests
mypy
flake8

.PHONY: test
test:
Expand Down
5 changes: 1 addition & 4 deletions aiohttp_devtools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
from .version import VERSION

# to match aiohttp
__version__ = str(VERSION)
__version__ = "0.13.1"
4 changes: 2 additions & 2 deletions aiohttp_devtools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

import click

from . import __version__
from .exceptions import AiohttpDevException
from .logs import main_logger, setup_logging
from .runserver import INFER_HOST, run_app
from .runserver import runserver as _runserver
from .runserver import serve_static
from .start import StartProject, check_dir_clean
from .version import VERSION

_dir_existing = click.Path(exists=True, dir_okay=True, file_okay=False)
_file_dir_existing = click.Path(exists=True, dir_okay=True, file_okay=True)
_dir_may_exist = click.Path(dir_okay=True, file_okay=False, writable=True, resolve_path=True)


@click.group()
@click.version_option(VERSION, '-V', '--version', prog_name='aiohttp-devtools')
@click.version_option(__version__, "-V", "--version", prog_name="aiohttp-devtools")
def cli():
pass

Expand Down
3 changes: 2 additions & 1 deletion aiohttp_devtools/runserver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
from .config import INFER_HOST
from .main import run_app, runserver, serve_static

__all__ = ("INFER_HOST", "run_app", "runserver", "serve_static")
Loading

0 comments on commit 0176357

Please sign in to comment.