-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mike
committed
Feb 27, 2022
1 parent
490357a
commit c4ccd67
Showing
8 changed files
with
180 additions
and
6 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,30 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade tox-gh-actions | ||
- name: Publish with tox and twine | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
run: | | ||
tox -e publish |
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,39 @@ | ||
# This workflow will install Python dependencies, lint and run tests | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
branches-ignore: | ||
- gh-pages | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade tox-gh-actions | ||
- name: Test with tox/pytest | ||
run: | | ||
tox | ||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: .tox/*.xml | ||
- name: Upload Coverage Results | ||
uses: codecov/codecov-action@v2 | ||
if: success() |
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,3 +1,8 @@ | ||
[![Build Status](https://github.com/mcarans/pytest-loguru/workflows/build/badge.svg)](https://github.com/mcarans/pytest-loguru/actions?query=workflow%3Abuild) | ||
[![Coverage Status](https://codecov.io/gh/mcarans/pytest-loguru/branch/main/graph/badge.svg?token=JpWZc5js4y)](https://codecov.io/gh/mcarans/pytest-loguru) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) | ||
|
||
### pytest-loguru | ||
|
||
A pytest plugin to add support for loguru to pytest's caplog fixture. |
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,3 +1,99 @@ | ||
[build-system] | ||
requires = [ "setuptools>=45" ] | ||
requires = [ "setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/pytest_loguru/_version.py" | ||
local_scheme = "no-local-version" | ||
version_scheme = "python-simplified-semver" | ||
|
||
[tool.black] | ||
line-length = 79 | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 79 | ||
multi_line_output = 3 | ||
|
||
[tool.flakeheaven] | ||
# make output nice | ||
format = "grouped" | ||
max_line_length = 79 | ||
# show line of source code in output | ||
show_source = true | ||
exclude = ["_version.py"] | ||
|
||
# list of plugins and rules for them | ||
[tool.flakeheaven.plugins] | ||
mccabe = ["+*"] | ||
pycodestyle = ["+*", "-E203", "-E501", "-W503"] | ||
pyflakes = ["+*"] | ||
pylint = ["+*"] | ||
flake8-isort = ["+*"] | ||
flake8-black = ["+*"] | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = "src" | ||
addopts = "--color=yes" | ||
log_cli = 1 | ||
|
||
[tool.coverage.paths] | ||
source = ["src/pytest_loguru", "*/site-packages/pytest_loguru"] | ||
|
||
[tool.coverage.report] | ||
omit = [ | ||
"*/setup.py", | ||
"*/python?.?/*", | ||
"*/venv/*", | ||
"*/site-packages/*", | ||
"*/tests/*", | ||
"*__init__*" | ||
] | ||
|
||
exclude_lines = [ | ||
"pragma: no cover", # Have to re-enable the standard pragma | ||
"def __repr__", # Don't complain about missing | ||
"if self.debug", # debug-only code | ||
"raise AssertionError", # Don't complain if tests don't hit | ||
"raise NotImplementedError", # defensive assertion code | ||
"if 0:", # Don't complain if non-runnable code | ||
"if __name__ == .__main__.:" # isn't run | ||
] | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
isolated_build = true | ||
envlist = py310, lint | ||
[gh-actions] | ||
python = | ||
3: py310, lint | ||
[testenv] | ||
recreate = true | ||
wheel = true | ||
deps = | ||
-r test-requirements.txt | ||
commands = | ||
pytest --cov=pytest_loguru --no-cov-on-fail --junitxml=.tox/test-results.xml --cov-report=xml --cov-report=term-missing | ||
[testenv:lint] | ||
wheel_build_env = py310 | ||
deps = | ||
flakeheaven | ||
flake8 | ||
flake8-isort | ||
flake8-black | ||
commands = | ||
flakeheaven lint src tests | ||
[testenv:publish] | ||
wheel_build_env = py310 | ||
passenv = SSH_AUTH_SOCK TWINE_USERNAME TWINE_PASSWORD | ||
deps = | ||
twine | ||
commands = | ||
twine upload {distdir}/* | ||
""" |
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,2 +1,2 @@ | ||
pytest | ||
loguru | ||
pytest==7.0.1 | ||
loguru==0.6.0 |
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 +1 @@ | ||
__version__ = "1.0.0" | ||
from ._version import version as __version__ # noqa: F401 |
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,4 @@ | ||
pytest-cov==3.0.0 | ||
tox==3.24.5 | ||
tox-wheel==0.7.0 | ||
-r requirements.txt |
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