-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bernat Gabor <[email protected]>
- Loading branch information
1 parent
301c76e
commit 8f89cc2
Showing
12 changed files
with
291 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[coverage:report] | ||
show_missing = True | ||
exclude_lines = | ||
\#\s*pragma: no cover | ||
^\s*raise AssertionError\b | ||
^\s*raise NotImplementedError\b | ||
^\s*raise$ | ||
^if __name__ == ['"]__main__['"]:$ | ||
omit = | ||
[coverage:paths] | ||
source = | ||
src | ||
.tox/*/lib/python*/site-packages | ||
.tox/pypy*/site-packages | ||
.tox\*\Lib\site-packages\ | ||
*/src | ||
*\src | ||
[coverage:run] | ||
branch = false | ||
parallel = true | ||
dynamic_context = test_function | ||
source = | ||
${_COVERAGE_SRC} | ||
[coverage:html] | ||
show_contexts = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: check | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
- uses: pre-commit/[email protected] | ||
|
||
test: | ||
name: test ${{ matrix.py }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- Ubuntu | ||
- Windows | ||
- MacOs | ||
py: | ||
- 3.9-dev | ||
- 3.8 | ||
- 3.7 | ||
- 3.6 | ||
- pypy3 | ||
- 3.5 | ||
- 2.7 | ||
- pypy2 | ||
steps: | ||
- name: setup python for tox | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: install tox | ||
run: python -m pip install tox | ||
- uses: actions/checkout@v2 | ||
- name: setup python for test ${{ matrix.py }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: pick environment to run | ||
run: | | ||
import subprocess; import json | ||
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True)) | ||
print('::set-env name=TOXENV::' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else ""))) | ||
shell: python | ||
- name: setup test suite | ||
run: tox -vv --notest | ||
- name: run test suite | ||
run: tox --skip-pkg-install | ||
env: | ||
PYTEST_ADDOPTS: "-vv --durations=20" | ||
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
- name: rename coverage report file | ||
run: | | ||
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml') | ||
shell: python | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./.tox/coverage.xml | ||
flags: tests | ||
name: ${{ matrix.py }} - ${{ matrix.os }} | ||
|
||
check: | ||
name: check ${{ matrix.tox_env }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- Ubuntu | ||
- Windows | ||
tox_env: | ||
- dev | ||
- docs | ||
- package_description | ||
exclude: | ||
- { os: Windows, tox_env: package_description } | ||
- { os: Windows, tox_env: docs } | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: setup Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: install tox | ||
run: python -m pip install tox | ||
- name: run check for ${{ matrix.tox_env }} | ||
run: python -m tox -e ${{ matrix.tox_env }} | ||
env: | ||
UPGRADE_ADVISORY: "yes" | ||
|
||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [check, test, pre-commit] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: setup python to build package | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: install pep517 | ||
run: python -m pip install pep517 | ||
- uses: actions/checkout@v2 | ||
- name: build package | ||
run: python -m pep517.build -s -b . -o dist | ||
- name: publish to PyPi | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
skip_existing: true | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,57 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: debug-statements | ||
- id: flake8 | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v2.0.1 | ||
hooks: | ||
- id: add-trailing-comma | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v1.25.1 | ||
rev: v2.7.2 | ||
hooks: | ||
- id: pyupgrade | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 19.3b0 | ||
hooks: | ||
- id: black | ||
args: [--safe] | ||
language_version: python3.7 | ||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v1.9.3 | ||
rev: v2.2.0 | ||
hooks: | ||
- id: seed-isort-config | ||
args: [--application-directories, "src:."] | ||
args: [--application-directories, ".:src"] | ||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.21 | ||
rev: v5.2.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/ambv/black | ||
rev: 19.10b0 | ||
hooks: | ||
- id: black | ||
args: [--safe] | ||
language_version: python3.8 | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.7.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==19.10b0] | ||
language_version: python3.8 | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.5.1 | ||
hooks: | ||
- id: rst-backticks | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.11.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
args: [--min-py3-version, "3.4"] | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: "3.8.3" | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: ["flake8-bugbear == 20.1.4"] | ||
language_version: python3.8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 40.0.4", | ||
"setuptools_scm >= 2.0.0, <4", | ||
"wheel >= 0.29.0", | ||
"setuptools >= 44", | ||
"wheel >= 0.30", | ||
"setuptools_scm[toml]>=3.4", | ||
] | ||
build-backend = 'setuptools.build_meta' | ||
|
||
[tool.black] | ||
line-length = 120 | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/pytest_print/version.py" | ||
write_to_template = """ | ||
\"\"\" Version information \"\"\" | ||
from __future__ import unicode_literals | ||
__version__ = "{version}" | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
formats: | ||
- none | ||
- none | ||
|
||
build: | ||
image: latest | ||
image: latest | ||
python: | ||
version: 3.7 | ||
pip_install: true | ||
extra_requirements: | ||
- doc | ||
version: 3.8 | ||
pip_install: true | ||
extra_requirements: | ||
- doc |
Oops, something went wrong.