Skip to content

Commit 402ff4a

Browse files
Setups GitHub Action (#35)
* Deletes `.travis.yml` * Creates test workflow * Adds `pragma: nocover` to `_fmap` function * Add `xml` format to pytest coverage report * Makes `flake8` ignore `ex.py` file * Adds `darglint` section to `setup.cfg` * Updates `isort` section * Adds `local_partial_types` option to `mypy` section * Adds `DAR103` and `DAR203` to the ignore option on `flake8` section * Updates `urllib3` package * Updates `pyyaml` package * Updates `mypy` package * Updates `pytest` and `pytest-mypy-plugins` packages * Changes badges on `README.md`
1 parent 365bd03 commit 402ff4a

File tree

7 files changed

+505
-435
lines changed

7 files changed

+505
-435
lines changed

.github/workflows/test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.6, 3.7, 3.8]
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install poetry
22+
run: |
23+
curl -sSL \
24+
"https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python
25+
# Adding `poetry` to `$PATH`:
26+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
27+
28+
- name: Set up cache
29+
uses: actions/cache@v2
30+
with:
31+
path: .venv
32+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
33+
34+
- name: Install dependencies
35+
run: |
36+
poetry config virtualenvs.in-project true
37+
poetry install
38+
39+
- name: Run tests
40+
run: |
41+
poetry run flake8 .
42+
poetry run mypy lambdas tests/**/*.py
43+
poetry run pytest lambdas tests
44+
poetry run doc8 -q docs
45+
poetry run poetry check
46+
poetry run pip check
47+
poetry run safety check --full-report
48+
# We do this to speed up the build:
49+
poetry run pytest typesafety -p no:cov -o addopts="" --mypy-ini-file=setup.cfg
50+
51+
- name: Upload coverage to Codecov
52+
if: matrix.python-version == 3.8
53+
uses: codecov/codecov-action@v1
54+
with:
55+
file: ./coverage.xml

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
-----
44

5-
[![Build Status](https://travis-ci.org/dry-python/lambdas.svg?branch=master)](https://travis-ci.org/dry-python/lambdas)
6-
[![Coverage Status](https://coveralls.io/repos/github/dry-python/lambdas/badge.svg?branch=master)](https://coveralls.io/github/dry-python/lambdas?branch=master)
5+
[![Build Status](https://github.com/dry-python/lambdas/workflows/test/badge.svg?branch=master&event=push)](https://github.com/dry-python/lambdas/actions?query=workflow%3Atest)
6+
[![codecov](https://codecov.io/gh/dry-python/lambdas/branch/master/graph/badge.svg)](https://codecov.io/gh/dry-python/lambdas)
77
[![Documentation Status](https://readthedocs.org/projects/lambdas/badge/?version=latest)](https://lambdas.readthedocs.io/en/latest/?badge=latest)
88
[![Python Version](https://img.shields.io/pypi/pyversions/lambdas.svg)](https://pypi.org/project/lambdas/)
99
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

lambdas/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
_Number = Union[int, float, complex]
1313

1414

15-
def _fmap(callback):
15+
def _fmap(callback): # pragma: nocover
16+
# TODO: Remove `pragma` after https://github.com/dry-python/lambdas/issues/4
1617
"""Convers callback to instance method with two arguments."""
1718
def decorator(self, second):
1819
return lambda first: callback(first, second)

0 commit comments

Comments
 (0)