Skip to content

Commit

Permalink
Move to Github API
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat committed Aug 4, 2020
1 parent 301c76e commit 8f89cc2
Show file tree
Hide file tree
Showing 12 changed files with 291 additions and 173 deletions.
28 changes: 28 additions & 0 deletions .coveragerc
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
119 changes: 119 additions & 0 deletions .github/workflows/check.yml
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 }}
58 changes: 43 additions & 15 deletions .pre-commit-config.yaml
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
56 changes: 0 additions & 56 deletions azure-pipelines.yml

This file was deleted.

4 changes: 4 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
changelog
=========

v0.2.0
------
* support for use at session level fixtures

v0.1.2
------
* add ``--print`` flag to force on state even when verbosity is zero
Expand Down
15 changes: 12 additions & 3 deletions pyproject.toml
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}"
"""
12 changes: 6 additions & 6 deletions readthedocs.yml
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
Loading

0 comments on commit 8f89cc2

Please sign in to comment.