Skip to content

Commit 9cab1eb

Browse files
committed
Coverage support
1 parent 1903c59 commit 9cab1eb

File tree

5 files changed

+73
-30
lines changed

5 files changed

+73
-30
lines changed

.codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
precision: 2
3+
range: [95, 100]
4+
5+
comment:
6+
layout: "header, diff, flags, files, footer"

.github/workflows/ci.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,40 @@ jobs:
3030

3131
- name: mypy
3232
run: make mypy
33+
34+
test-linux:
35+
name: test py${{ matrix.python-version }} on linux
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
# python-version: ["3.6", "3.7", "3.8", "3.9"]
41+
python-version: ["3.8"]
42+
env:
43+
PYTHON: ${{ matrix.python-version }}
44+
OS: ubuntu
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- name: set up python
50+
uses: actions/setup-python@v2
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
54+
- name: install
55+
run: |
56+
make install-testing
57+
pip freeze
58+
59+
- name: test uncompiled without deps
60+
run: make test
61+
env:
62+
COVERAGE_FILE: coverage/.coverage.linux-py${{ matrix.python-version }}-cN-dN
63+
CONTEXT: linux-py${{ matrix.python-version }}-compiled-no-deps-no
64+
65+
- name: store coverage files
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: coverage
69+
path: coverage

Makefile

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ install-testing: install-pydantic_ssm_settings
2828
install: install-testing install-linting # install-docs
2929
@echo 'installed development requirements'
3030

31-
# .PHONY: build-trace
32-
# build-trace:
33-
# python setup.py build_ext --force --inplace --define CYTHON_TRACE
31+
.PHONY: build-trace
32+
build-trace:
33+
python setup.py build_ext --force --inplace --define CYTHON_TRACE
3434

35-
# .PHONY: build
36-
# build:
37-
# python setup.py build_ext --inplace
35+
.PHONY: build
36+
build:
37+
python setup.py build_ext --inplace
3838

3939
.PHONY: format
4040
format:
@@ -59,18 +59,17 @@ mypy:
5959

6060
.PHONY: test
6161
test:
62-
# pytest --cov=pydantic_ssm_settings
63-
pytest
62+
pytest --cov=pydantic_ssm_settings
6463

6564
.PHONY: testcov
6665
testcov: test
6766
@echo "building coverage html"
6867
@coverage html
6968

70-
.PHONY: testcov-compile
71-
testcov-compile: build-trace test
72-
@echo "building coverage html"
73-
@coverage html
69+
# .PHONY: testcov-compile
70+
# testcov-compile: build-trace test
71+
# @echo "building coverage html"
72+
# @coverage html
7473

7574
# .PHONY: test-examples
7675
# test-examples:
@@ -121,19 +120,19 @@ clean:
121120
rm -rf codecov.sh
122121
rm -rf coverage.xml
123122

124-
.PHONY: docs
125-
docs:
126-
flake8 --max-line-length=80 docs/examples/
127-
python docs/build/main.py
128-
mkdocs build
129-
130-
.PHONY: docs-serve
131-
docs-serve:
132-
python docs/build/main.py
133-
mkdocs serve
134-
135-
.PHONY: publish-docs
136-
publish-docs:
137-
zip -r site.zip site
138-
@curl -H "Content-Type: application/zip" -H "Authorization: Bearer ${NETLIFY}" \
139-
--data-binary "@site.zip" https://api.netlify.com/api/v1/sites/pydantic-docs.netlify.com/deploys
123+
# .PHONY: docs
124+
# docs:
125+
# flake8 --max-line-length=80 docs/examples/
126+
# python docs/build/main.py
127+
# mkdocs build
128+
129+
# .PHONY: docs-serve
130+
# docs-serve:
131+
# python docs/build/main.py
132+
# mkdocs serve
133+
134+
# .PHONY: publish-docs
135+
# publish-docs:
136+
# zip -r site.zip site
137+
# @curl -H "Content-Type: application/zip" -H "Authorization: Bearer ${NETLIFY}" \
138+
# --data-binary "@site.zip" https://api.netlify.com/api/v1/sites/pydantic-docs.netlify.com/deploys

pydantic_ssm_settings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .settings import AwsSsmSourceConfig
22

3-
__all__ = [m.__name__ for m in (AwsSsmSourceConfig,)]
3+
__all__ = 'AwsSsmSourceConfig',

tests/requirements-testing.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
mypy==0.910
1+
coverage==5.5
22
pytest==6.2.5
3+
pytest-cov==2.12.1
34
moto[all]==2.2.6

0 commit comments

Comments
 (0)