Skip to content

Commit db7e986

Browse files
committed
2 parents d99487c + f4529af commit db7e986

17 files changed

+389
-24
lines changed

.coveragerc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[run]
2+
omit =
3+
# leading `*/` for pytest-dev/pytest-cov#456
4+
*/.tox/*
5+
disable_warnings =
6+
couldnt-parse
7+
8+
[report]
9+
show_missing = True
10+
exclude_also =
11+
# jaraco/skeleton#97
12+
@overload
13+
if TYPE_CHECKING:

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
indent_size = 4
7+
insert_final_newline = true
8+
end_of_line = lf
9+
10+
[*.py]
11+
indent_style = space
12+
max_line_length = 88
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.rst]
19+
indent_style = space

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
allow:
8+
- dependency-type: "all"

.github/workflows/main.yml

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,46 @@ on:
1111
- '**'
1212
pull_request:
1313

14-
jobs:
15-
build:
14+
permissions:
15+
contents: read
1616

17-
runs-on: ubuntu-latest
17+
env:
18+
# Environment variable to support color support (jaraco/skeleton#66)
19+
FORCE_COLOR: 1
20+
21+
# Suppress noisy pip warnings
22+
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
23+
PIP_NO_PYTHON_VERSION_WARNING: 'true'
24+
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
25+
26+
# Ensure tests can sense settings about the environment
27+
TOX_OVERRIDE: >-
28+
testenv.pass_env+=GITHUB_*,FORCE_COLOR
29+
30+
31+
jobs:
32+
test:
1833
strategy:
34+
# https://blog.jaraco.com/efficient-use-of-ci-resources/
1935
matrix:
20-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
21-
36+
python:
37+
- "3.8"
38+
- "3.12"
39+
platform:
40+
- ubuntu-latest
41+
- macos-latest
42+
- windows-latest
43+
include:
44+
- python: "3.9"
45+
platform: ubuntu-latest
46+
- python: "3.10"
47+
platform: ubuntu-latest
48+
- python: "3.11"
49+
platform: ubuntu-latest
50+
- python: pypy3.10
51+
platform: ubuntu-latest
52+
runs-on: ${{ matrix.platform }}
53+
continue-on-error: ${{ matrix.python == '3.13' }}
2254
steps:
2355
- uses: actions/checkout@v4
2456
- name: Setup Python
@@ -30,3 +62,61 @@ jobs:
3062
run: python -m pip install tox
3163
- name: Run
3264
run: tox
65+
66+
collateral:
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
job:
71+
- diffcov
72+
- docs
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 0
78+
- name: Setup Python
79+
uses: actions/setup-python@v4
80+
with:
81+
python-version: 3.x
82+
- name: Install tox
83+
run: python -m pip install tox
84+
- name: Eval ${{ matrix.job }}
85+
run: tox -e ${{ matrix.job }}
86+
87+
check: # This job does nothing and is only used for the branch protection
88+
if: always()
89+
90+
needs:
91+
- test
92+
- collateral
93+
94+
runs-on: ubuntu-latest
95+
96+
steps:
97+
- name: Decide whether the needed jobs succeeded or failed
98+
uses: re-actors/alls-green@release/v1
99+
with:
100+
jobs: ${{ toJSON(needs) }}
101+
102+
release:
103+
permissions:
104+
contents: write
105+
needs:
106+
- check
107+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
108+
runs-on: ubuntu-latest
109+
110+
steps:
111+
- uses: actions/checkout@v4
112+
- name: Setup Python
113+
uses: actions/setup-python@v4
114+
with:
115+
python-version: 3.x
116+
- name: Install tox
117+
run: python -m pip install tox
118+
- name: Run
119+
run: tox -e release
120+
env:
121+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.1.8
4+
hooks:
5+
- id: ruff
6+
- id: ruff-format

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
python:
3+
install:
4+
- path: .
5+
extra_requirements:
6+
- docs
7+
8+
# required boilerplate readthedocs/readthedocs.org#10401
9+
build:
10+
os: ubuntu-lts-latest
11+
tools:
12+
python: latest
13+
# post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114
14+
jobs:
15+
post_checkout:
16+
- git fetch --unshallow || true

LICENSE

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
2-
3-
The MIT License
4-
5-
Copyright (c) 2015 Eduardo Naufel Schettino
6-
71
Permission is hereby granted, free of charge, to any person obtaining a copy
8-
of this software and associated documentation files (the "Software"), to deal
9-
in the Software without restriction, including without limitation the rights
10-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
copies of the Software, and to permit persons to whom the Software is
2+
of this software and associated documentation files (the "Software"), to
3+
deal in the Software without restriction, including without limitation the
4+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
5+
sell copies of the Software, and to permit persons to whom the Software is
126
furnished to do so, subject to the following conditions:
137

148
The above copyright notice and this permission notice shall be included in
@@ -18,6 +12,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1812
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1913
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2014
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23-
THE SOFTWARE.
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
IN THE SOFTWARE.

README.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
.. image:: https://img.shields.io/pypi/v/pytest-ignore-flaky.svg
2-
:target: https://pypi.python.org/pypi/pytest-ignore-flaky
2+
:target: https://pypi.org/project/pytest-ignore-flaky
33

44
.. image:: https://img.shields.io/pypi/pyversions/pytest-ignore-flaky.svg
5-
:target: https://pypi.python.org/pypi/pytest-ignore-flaky
65

76
.. image:: https://github.com/coherent-oss/pytest-ignore-flaky/actions/workflows/main.yml/badge.svg
8-
:target: https://github.com/coherent-oss/pytest-ignore-flaky/actions?query=workflow%3Atests
7+
:target: https://github.com/coherent-oss/pytest-ignore-flaky/actions?query=workflow%3A%22tests%22
8+
:alt: tests
9+
10+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
11+
:target: https://github.com/astral-sh/ruff
12+
:alt: Ruff
13+
14+
.. .. image:: https://readthedocs.org/projects/pytest-ignore-flaky/badge/?version=latest
15+
.. :target: https://pytest-ignore-flaky.readthedocs.io/en/latest/?badge=latest
16+
17+
.. image:: https://img.shields.io/badge/skeleton-2024-informational
18+
:target: https://blog.jaraco.com/skeleton
919

1020

1121
pytest-ignore-flaky

docs/conf.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
extensions = [
2+
'sphinx.ext.autodoc',
3+
'jaraco.packaging.sphinx',
4+
]
5+
6+
master_doc = "index"
7+
html_theme = "furo"
8+
9+
# Link dates and other references in the changelog
10+
extensions += ['rst.linker']
11+
link_files = {
12+
'../NEWS.rst': dict(
13+
using=dict(GH='https://github.com'),
14+
replace=[
15+
dict(
16+
pattern=r'(Issue #|\B#)(?P<issue>\d+)',
17+
url='{package_url}/issues/{issue}',
18+
),
19+
dict(
20+
pattern=r'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)',
21+
with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
22+
),
23+
dict(
24+
pattern=r'PEP[- ](?P<pep_number>\d+)',
25+
url='https://peps.python.org/pep-{pep_number:0>4}/',
26+
),
27+
],
28+
)
29+
}
30+
31+
# Be strict about any broken references
32+
nitpicky = True
33+
34+
# Include Python intersphinx mapping to prevent failures
35+
# jaraco/skeleton#51
36+
extensions += ['sphinx.ext.intersphinx']
37+
intersphinx_mapping = {
38+
'python': ('https://docs.python.org/3', None),
39+
}
40+
41+
# Preserve authored syntax for defaults
42+
autodoc_preserve_defaults = True

docs/history.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:tocdepth: 2
2+
3+
.. _changes:
4+
5+
History
6+
*******
7+
8+
.. include:: ../NEWS (links).rst

docs/index.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Welcome to |project| documentation!
2+
===================================
3+
4+
.. sidebar-links::
5+
:home:
6+
:pypi:
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
history
12+
13+
14+
.. automodule:: pytest_ignore_flaky
15+
:members:
16+
:undoc-members:
17+
:show-inheritance:
18+
19+
20+
Indices and tables
21+
==================
22+
23+
* :ref:`genindex`
24+
* :ref:`modindex`
25+
* :ref:`search`
26+

mypy.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[mypy]
2+
ignore_missing_imports = True
3+
# required to support namespace packages
4+
# https://github.com/python/mypy/issues/14057
5+
explicit_package_bases = True

pyproject.toml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pytest-ignore-flaky"
7-
description = "ignore failures from flaky tests (pytest plugin)"
8-
readme = "README.rst"
97
authors = [
108
{ name = "Eduardo Naufel Schettino", email = "[email protected]" },
119
{ name = "Marcos Alfredo Camargo Leal Pinto", email = "[email protected]" },
1210
]
1311
maintainers = [
1412
{ name = "Jason R. Coombs", email = "[email protected]" },
1513
]
14+
description = "ignore failures from flaky tests (pytest plugin)"
15+
readme = "README.rst"
1616
classifiers = [
1717
"Development Status :: 5 - Production/Stable",
1818
"Environment :: Console",
@@ -30,9 +30,35 @@ classifiers = [
3030
"Topic :: Software Development :: Testing",
3131
]
3232
requires-python = ">=3.8"
33-
dependencies = ["pytest>=6.0"]
33+
dependencies = [
34+
"pytest>=6.0",
35+
]
3436
dynamic = ["version"]
3537

38+
39+
[project.optional-dependencies]
40+
testing = [
41+
# upstream
42+
"pytest >= 6, != 8.1.*",
43+
"pytest-checkdocs >= 2.4",
44+
"pytest-cov",
45+
"pytest-mypy",
46+
"pytest-enabler >= 2.2",
47+
"pytest-ruff >= 0.2.1",
48+
49+
# local
50+
]
51+
docs = [
52+
# upstream
53+
"sphinx >= 3.5",
54+
"jaraco.packaging >= 9.3",
55+
"rst.linker >= 1.9",
56+
"furo",
57+
"sphinx-lint",
58+
59+
# local
60+
]
61+
3662
[project.urls]
3763
Homepage = "https://github.com/coherent-oss/pytest-ignore-flaky"
3864

0 commit comments

Comments
 (0)