Skip to content

Commit 7ef9b04

Browse files
authored
update versions + minor improvements (#85)
* update some version + other minor changes * fix test.yml for covereage * bump version + clean up setup.cfg * fix ignore for flake8 * relative imports
1 parent 32f8402 commit 7ef9b04

File tree

11 files changed

+62
-55
lines changed

11 files changed

+62
-55
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,47 @@ jobs:
1010
- name: Set up Python
1111
uses: actions/setup-python@v1
1212
with:
13-
python-version: '3.7'
13+
python-version: '3.8'
1414
- name: Install dependencies
1515
run: make install-test
1616
- name: Lint
1717
run: make lint
1818

1919
test:
2020
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
python-version: [3.6, 3.7, 3.8]
2124
steps:
2225
- uses: actions/checkout@v2
23-
- name: Set up Python 3.7
26+
- name: Set up Python ${{ matrix.python-version }}
2427
uses: actions/setup-python@v1
2528
with:
26-
python-version: 3.7
29+
python-version: ${{ matrix.python-version }}
2730
- name: Install dependencies
28-
run: |
29-
cp env.template .env
30-
make install-test
31+
run: make install-test
3132
- name: Run tests
3233
run: |
33-
export $(<.env)
34-
make test
34+
export $(<env.template)
35+
pytest
3536
coverage:
3637
runs-on: ubuntu-latest
3738
steps:
3839
- uses: actions/checkout@master
3940
- name: Setup Python
4041
uses: actions/setup-python@master
4142
with:
42-
python-version: 3.7
43+
python-version: 3.8
4344
- name: Install dependencies
44-
run: |
45-
make install-test
46-
cp env.template .env
45+
run: make install-test
4746
- name: Generate coverage report
4847
run: |
49-
export $(<.env)
48+
export $(<env.template)
5049
pytest --cov-report=xml
5150
- name: Upload coverage to Codecov
5251
uses: codecov/codecov-action@v1
5352
with:
54-
token: c3898684-cb06-4229-b7fe-b8489a1b8fb2
5553
file: ./coverage.xml
5654
flags: unittests
5755
name: codecov-umbrella
58-
fail_ci_if_error: true
56+
fail_ci_if_error: true

Makefile

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
11
SHELL := bash
22
PATH := ./venv/bin:${PATH}
3-
PYTHON=python3.7
4-
PROJECT=arcus
5-
isort = isort -rc -ac $(PROJECT) tests setup.py
6-
black = black -S -l 79 --target-version py37 $(PROJECT) tests setup.py
3+
PYTHON = python3.7
4+
PROJECT = arcus
5+
isort = isort $(PROJECT) tests setup.py
6+
black = black -S -l 79 --target-version py38 $(PROJECT) tests setup.py
77

88

99
all: test
1010

1111
venv:
12-
$(PYTHON) -m venv --prompt $(PROJECT) venv
13-
pip install -qU pip
12+
$(PYTHON) -m venv --prompt $(PROJECT) venv
13+
pip install -qU pip
1414

1515
install-test:
16-
pip install -q .[test]
16+
pip install -q .[test]
1717

1818
test: clean install-test lint
19-
python setup.py test
19+
python setup.py test
2020

2121
format:
22-
$(isort)
23-
$(black)
22+
$(isort)
23+
$(black)
2424

2525
lint:
26-
$(isort) --check-only
27-
$(black) --check
28-
flake8 $(PROJECT) tests setup.py
29-
mypy $(PROJECT) tests
26+
flake8 $(PROJECT) tests setup.py
27+
$(isort) --check-only
28+
$(black) --check
29+
mypy $(PROJECT) tests
3030

3131
clean:
32-
find . -name '*.pyc' -exec rm -f {} +
33-
find . -name '*.pyo' -exec rm -f {} +
34-
find . -name '*~' -exec rm -f {} +
35-
rm -rf build dist $(PROJECT).egg-info
32+
rm -rf `find . -name __pycache__`
33+
rm -f `find . -type f -name '*.py[co]' `
34+
rm -f `find . -type f -name '*~' `
35+
rm -f `find . -type f -name '.*~' `
36+
rm -rf .cache
37+
rm -rf .pytest_cache
38+
rm -rf .mypy_cache
39+
rm -rf htmlcov
40+
rm -rf *.egg-info
41+
rm -f .coverage
42+
rm -f .coverage.*
43+
rm -rf build
44+
rm -rf dist
3645

3746
release: clean
38-
python setup.py sdist bdist_wheel
39-
twine upload dist/*
47+
python setup.py sdist bdist_wheel
48+
twine upload dist/*
4049

4150

4251
.PHONY: all install-test test format lint clean release

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
[![test](https://github.com/cuenca-mx/arcus-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/arcus-python/actions?query=workflow%3Atest)
33
[![codecov](https://codecov.io/gh/cuenca-mx/arcus-python/branch/master/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/arcus-python)
44
[![PyPI](https://img.shields.io/pypi/v/arcus.svg)](https://pypi.org/project/arcus/)
5+
[![Downloads](https://pepy.tech/badge/arcus)](https://pepy.tech/project/arcus)
56

67

7-
Arcus python3.6 + 3.7 client library for API version 3.1 of [Arcus](https://www.arcusfi.com/).
8+
Arcus python3.6+ client library for API version 3.1 of [Arcus](https://www.arcusfi.com/).
89

910

1011

arcus/resources/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Resource:
7-
_client: ClassVar['arcus.Client'] # type: ignore
7+
_client: ClassVar['arcus.Client'] # type:ignore # noqa:F821
88
_endpoint: ClassVar[str]
99

1010
# Just for mypy

arcus/resources/bill_payments.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from dataclasses import dataclass, field
33
from typing import ClassVar, Optional
44

5-
from arcus.exc import UnprocessableEntity, raise_arcus_exception
6-
5+
from ..exc import UnprocessableEntity, raise_arcus_exception
76
from .base import Resource
87

98
"""

arcus/resources/billers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
from pydash import filter_
55

6-
from arcus.exc import NotFound
7-
6+
from ..exc import NotFound
87
from .base import Resource
98

109
ENDPOINTS = ['topups', 'utilities']

arcus/resources/bills.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
from dataclasses import dataclass, field
33
from typing import ClassVar, Optional, Union
44

5-
from arcus.exc import (
5+
from ..exc import (
66
InvalidBiller,
77
NotFound,
88
UnprocessableEntity,
99
raise_arcus_exception,
1010
)
11-
1211
from .base import Resource
1312
from .transactions import Transaction
1413

arcus/resources/transactions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from dataclasses import dataclass, field
33
from typing import ClassVar, Union
44

5-
from arcus.exc import UnprocessableEntity, raise_arcus_exception
6-
5+
from ..exc import UnprocessableEntity, raise_arcus_exception
76
from .base import Resource
87

98

arcus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.2.3' # pragma: no cover
1+
__version__ = '1.2.4' # pragma: no cover

setup.cfg

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22
test=pytest
33

44
[tool:pytest]
5-
addopts = -p no:warnings -v --cov=arcus
5+
addopts = -p no:warnings -v --cov-report term-missing --cov=arcus
66

77
[flake8]
88
inline-quotes = '
99
multiline-quotes = """
10-
builtins = arcus
1110
1211
[isort]
13-
multi_line_output=3
14-
include_trailing_comma=True
15-
force_grid_wrap=0
16-
combine_as_imports=True
12+
profile=black
13+
line_length=79
1714
1815
[mypy-iso8601]
1916
ignore_missing_imports = true
2017
2118
[mypy-pytest]
2219
ignore_missing_imports = true
2320
24-
[mypy]
25-
ignore_missing_imports = True
21+
[mypy-pydash]
22+
ignore_missing_imports = true
23+
24+
[mypy-requests_mock]
25+
ignore_missing_imports = true
26+
27+
[coverage:report]
28+
precision = 2

0 commit comments

Comments
 (0)