Skip to content

Add support for Python 3.11 and pytest 7. #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand Down
48 changes: 37 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -18,13 +18,39 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/PyCQA/autoflake
rev: v1.7.6
hooks:
- id: autoflake
args: [
--in-place,
--remove-all-unused-imports,
]

- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
rev: v3.9.0
hooks:
- id: reorder-python-imports
- id: reorder-python-imports
name: reorder python imports inside src
args: [
--application-directories,
src,
--py37-plus,
--add-import,
"from __future__ import annotations",
]
files: ^src
- id: reorder-python-imports
name: reorder python imports outside src
exclude: ^src
args: [
--py37-plus,
--add-import,
"from __future__ import annotations",
]

- repo: https://github.com/myint/docformatter
rev: v1.4
rev: v1.5.0
hooks:
- id: docformatter
exclude: ^tests/.*$
Expand All @@ -37,36 +63,36 @@ repos:
]

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v3.2.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==21.9.2
- flake8-bugbear==22.10.27
- flake8-docstrings==1.6.0
- flake8-print==4.0.0
- pep8-naming==0.12.1

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v0.982
hooks:
- id: mypy
additional_dependencies:
- types-dataclasses
- types-PyYAML

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
rev: v1.3.1
hooks:
- id: insert-license
name: insert apache license
Expand Down
18 changes: 16 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ The format is based on `Keep a Changelog
<https://keepachangelog.com/en/1.0.0/>`_, and this project adheres to `Semantic
Versioning <https://semver.org/spec/v2.0.0.html>`_.

0.5.3 - 2021-11-10
0.5.4 - 2022-11-05
------------------

Fixed
~~~~~
- #22: support for pytest 7.

Added
~~~~~
- Support for Python 3.11.

Removed
~~~~~~~
- Support for Python 3.6.

0.5.3 - 2021-11-10
------------------

- Support Python 3.10.
Added
~~~~~
- Support for Python 3.10.

0.5.2 - 2020-08-09
------------------
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

10 changes: 5 additions & 5 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ The following components are provided under the MIT License
https://pyyaml.org
https://pytest.org
https://python-jsonschema.readthedocs.io

https://github.com/rlgomes/delta

================================================================
The CC0 License
The BSD License
================================================================

The following components are provided under the CC0 License
(https://creativecommons.org/publicdomain/zero/1.0)
The following components are provided under the BSD License
(https://opensource.org/licenses/bsd-license.php)

https://github.com/warner/python-versioneer
https://palletsprojects.com/p/jinja
2 changes: 2 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
from __future__ import annotations

from sphinx.ext import autodoc

# import os
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.black]
target-version = ['py36']
target-version = ['py37']
15 changes: 7 additions & 8 deletions report-conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from __future__ import annotations


def setup(app):
app.add_css_file("html_width.css")

Expand All @@ -43,7 +46,6 @@ def setup(app):
# The full version, including alpha/beta/rc tags
release = "V1.0"


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -57,7 +59,10 @@ def setup(app):
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
]
mathjax_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_CHTML-full"
mathjax_path = (
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"
"?config=TeX-AMS_CHTML-full"
)

# extensions = ['sphinxcontrib.katex']

Expand Down Expand Up @@ -89,7 +94,6 @@ def setup(app):
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -141,7 +145,6 @@ def setup(app):
# Output file base name for HTML help builder.
htmlhelp_basename = "Validation Case"


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand All @@ -166,14 +169,12 @@ def setup(app):
(master_doc, "Validation_case.tex", "Validation case", " ", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "validation_case", "Validation case", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -191,7 +192,6 @@ def setup(app):
),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
Expand All @@ -209,5 +209,4 @@ def setup(app):
# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
8 changes: 4 additions & 4 deletions report-conf/generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
This module requires the packages tabulate and sphinx, these could be installed
with the command: conda install tabluate sphinx
"""
from __future__ import annotations

import shutil
import subprocess
import textwrap
from pathlib import Path
from typing import List
from typing import Tuple

import yaml
from tabulate import tabulate
Expand Down Expand Up @@ -75,7 +75,7 @@ def create_summary_table(output_root: Path) -> str:
with (output_root / REPORT_DB_FILENAME).open() as stream:
report_db = yaml.safe_load(stream)

report_data: List[Tuple[str]] = []
report_data: list[tuple[str]] = []
for case, data in report_db.items():
messages = "\n".join(data.get("messages", []))
report_data += [(case, data["status"], messages)]
Expand All @@ -95,7 +95,7 @@ def create_index_rst(output_root: Path) -> None:
output_root = Path(output_root).resolve(True)

# find the paths to the description rst files relatively to the output_root
description_paths: List[Path] = []
description_paths: list[Path] = []
for path in output_root.glob(f"**/{DESCRIPTION_FILENAME}"):
description_paths += [path.relative_to(output_root)]

Expand Down
32 changes: 18 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# setuptools settings
# See https://python-packaging-user-guide.readthedocs.io for more details.
[metadata]
name = pytest-executable
author = Antoine Dechaume
Expand All @@ -8,17 +6,18 @@ description = pytest plugin for testing executables
long_description = file: README.rst
long_description_content_type = text/x-rst
license = Apache Software License 2.0
license_file = LICENSE.txt
license_files = LICENSE.txt
classifiers =
Operating System :: POSIX :: Linux
Operating System :: MacOS
Development Status :: 4 - Beta
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3.6
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Environment :: Console
Topic :: Utilities
Topic :: Software Development :: Testing
Expand All @@ -31,20 +30,20 @@ package_dir=
=src
packages = find:
include_package_data = True
python_requires = >=3.6,<3.11
python_requires = >=3.7,<3.12
install_requires =
pytest >=4.3,<6.3
pytest >=4.3,<8
pyyaml >=3,<6.1
jsonschema >=2,<4
jinja2 >=2.7,<3.1
jsonschema >=2,<5
jinja2 >=2.7,<3.2
delta >=0.4,<0.5
dataclasses;python_version<'3.7'

[options.packages.find]
where = src

[options.extras_require]
test =
covdefaults
pytest-cov

[options.entry_points]
Expand All @@ -61,7 +60,12 @@ filterwarnings =
ignore::pytest.PytestExperimentalApiWarning

[coverage:run]
branch = True
plugins = covdefaults
source = pytest_executable

[coverage:report]
# Override covdefaults.
fail_under = 90

[flake8]
# See http://www.pydocstyle.org/en/latest/error_codes.html for more details.
Expand All @@ -76,13 +80,13 @@ ignore =
E501,
exclude = tests/data
max-line-length = 88
select = B,C,E,F,G,N,T,W
select = B,C,E,F,G,N,T,W,B950
docstring-convention = google

[mypy]
;files = src/pytest_executable, tests
;exclude = (tests/data|report-conf)
python_version = 3.6
python_version = 3.7
warn_unused_configs = True
disallow_subclassing_any = True
disallow_any_generics = True
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
See https://python-packaging-user-guide.readthedocs.io for more details. See setup.cfg
for other settings.
"""
from __future__ import annotations

import setuptools

setuptools.setup()
1 change: 1 addition & 0 deletions src/pytest_executable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@

This module contains function that do not depend on pytest to allow easier testing.
"""
from __future__ import annotations
Loading