Compare commits

...

6 Commits

Author SHA1 Message Date
Jürgen Edelbluth 9c5d28a58c
Documentation fixes 2023-07-01 16:45:10 +02:00
Jürgen Edelbluth fcea9e7349
Maintenance 2023-07
- Updated Jenkins pipeline (mainly notification configuration)
- Updated pylint configuration (builtins)
- Updated pyenv configuration (3.11 is now supported)
- Explicit parameter names when registering the plugin
- Documentation updated
- Code formatting (coding conventions via black and isort)
- Version requirements for pytest updated, the tests accordingly
- Tested new dependencies
2023-07-01 16:16:42 +02:00
Jürgen Edelbluth 0f3c7b26b3
Merge branch 'jed-patch-jenkinsfile' 2023-07-01 14:46:43 +02:00
Jürgen Edelbluth f1a1155d9d
Removing Google Fonts 2022-08-31 17:33:24 +02:00
Jürgen Edelbluth 7774992eae
Better use of notification address
Adresses: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#string-interpolation
2022-08-28 20:46:11 +02:00
Jürgen Edelbluth bef3987479
Including Module Index in Documentation 2022-08-28 15:31:54 +02:00
32 changed files with 1180 additions and 542 deletions

6
.ci/Jenkinsfile vendored
View File

@ -18,7 +18,7 @@ pipeline {
axes {
axis {
name 'PYTHON_VERSION'
values 'py38', 'py39', 'py310'
values 'py38', 'py39', 'py310', 'py311'
}
}
stages {
@ -43,8 +43,8 @@ pipeline {
}
always {
withCredentials([string(credentialsId: 'jed-notification-email', variable: 'EMAIL')]) {
mail to: "${EMAIL}",
subject: "[${currentBuild.fullDisplayName}] Build #${currentBuild.number}: ${currentBuild.currentResult}",
mail to: '$EMAIL',
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
body: "Duration: ${currentBuild.durationString} / Jenkins URL: ${env.BUILD_URL}"
}
}

View File

@ -389,8 +389,8 @@ preferred-modules=
[EXCEPTIONS]
# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
[REFACTORING]

View File

@ -1,4 +1,4 @@
3.10.6
3.9.13
3.8.13
3.11-dev
3.11.4
3.10.12
3.9.17
3.8.17

View File

@ -12,8 +12,8 @@ A pytest plugin to parametrize data-driven tests by CSV files.
## Requirements
- Python 3.8, 3.9 or 3.10
- pytest >= 7.1
- Python 3.8, 3.9, 3.10, 3.11
- pytest >= 7.4
There's no operating system dependent code in this plugin, so it should run anywhere where pytest runs.

View File

@ -15,7 +15,7 @@ def pytest_configure(config: Config, plugin_name: str = "csv_params") -> None:
:param config: Pytets configuration class
:param plugin_name: The name of the pytest plugin, with default value
"""
config.pluginmanager.register(Plugin(config), f"{plugin_name}_plugin")
config.pluginmanager.register(Plugin(config), name=f"{plugin_name}_plugin")
def pytest_unconfigure(config: Config, plugin_name: str = "csv_params") -> None:
@ -25,4 +25,4 @@ def pytest_unconfigure(config: Config, plugin_name: str = "csv_params") -> None:
:param config: Pytest configuration class
:param plugin_name: The name of the pytest plgin, with default value
"""
config.pluginmanager.unregister(f"{plugin_name}_plugin")
config.pluginmanager.unregister(name=f"{plugin_name}_plugin")

View File

@ -23,11 +23,11 @@ def check_python_version(min_version: Tuple[int, int] = (3, 8)) -> None:
raise PythonTooOldError(f"At least Python {'.'.join(map(str, min_version))} required")
def check_pytest_version(min_version: Tuple[int, int] = (7, 1)) -> None:
def check_pytest_version(min_version: Tuple[int, int] = (7, 4)) -> None:
"""
Check if the current version is at least 7.1
Check if the current version is at least 7.4
:param min_version: The minimum version required, as tuple, default is 7.1
:param min_version: The minimum version required, as tuple, default is 7.4
:raises RuntimeError: When the pytest version is too old/unsupported
"""

48
docs/_static/font/fira/style.css vendored Normal file
View File

@ -0,0 +1,48 @@
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Light.woff2') format('woff2'),
url("woff/FiraCode-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Regular.woff2') format('woff2'),
url("woff/FiraCode-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Medium.woff2') format('woff2'),
url("woff/FiraCode-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-SemiBold.woff2') format('woff2'),
url("woff/FiraCode-SemiBold.woff") format("woff");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Bold.woff2') format('woff2'),
url("woff/FiraCode-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Fira Code VF';
src: url('woff2/FiraCode-VF.woff2') format('woff2-variations'),
url('woff/FiraCode-VF.woff') format('woff-variations');
/* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
font-weight: 300 700;
font-style: normal;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

16
docs/_static/font/vollkorn/style.css vendored Normal file
View File

@ -0,0 +1,16 @@
/* #### Generated By: http://www.cufonfonts.com #### */
@font-face {
font-family: 'Vollkorn Regular';
font-style: normal;
font-weight: normal;
src: local('Vollkorn Regular'), url('Vollkorn-Regular.woff') format('woff');
}
@font-face {
font-family: 'Vollkorn Bold';
font-style: normal;
font-weight: normal;
src: local('Vollkorn Bold'), url('Vollkorn-Bold.woff') format('woff');
}

21
docs/_templates/layout.html vendored Normal file
View File

@ -0,0 +1,21 @@
{% extends '!layout.html' %}
{%- block font %}
<!-- Fully omitting Google Fonts from Remote -->
<link href="{{ pathto('_static/font/vollkorn/style.css', 1) }}" rel="stylesheet">
<link href="{{ pathto('_static/font/fira/style.css', 1) }}" rel="stylesheet">
<style>
body,
input {
font-family: "Vollkorn Regular", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}
code,
kbd,
pre {
font-family: "Fira Code VF", "Fira Code", "Courier New", Courier, monospace !important;
font-variant-ligatures: none;
}
</style>
{%- endblock %}

View File

@ -36,5 +36,6 @@ Sitemap
:caption: Meta
genindex
py-modindex
🌍 Project Page <https://git.codebau.dev/pytest-plugins/pytest-csv-params>
🌍 juergen.rocks <https://juergen.rocks/>

View File

@ -12,9 +12,6 @@ from os.path import abspath, dirname, join
import tomli
sys.path.insert(0, abspath(join(dirname(__file__), "..")))
# sys.path.insert(0, abspath(join(dirname(__file__), "..", "tests")))
# sys.path.insert(0, abspath(join(dirname(__file__), "..", "_ptcsvp")))
# sys.path.insert(0, abspath(join(dirname(__file__), "..", "pytest_csv_params")))
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

View File

@ -1,5 +1,25 @@
# Changelog
## Version 1.1.0
<u>Special Announcement:</u>
- This is the last version that supports Python 3.8
<u>Breaking Changes:</u>
- Pytest >= 7.4 is required (was >= 7.1 before)
<u>Changes:</u>
- Maintenance: Dependency versions
- Maintenance: Support for Python 3.11
- Maintenance: CI Configuration cleanup
- Maintenance: Project Configuration cleanup (supported versions etc.)
- Changed Pytest plugin hook
- Tests: Changed version interpretation tests, as the standard lib has a better interpretation now
- Coding conventions: Black and isort updated, changed things accordingly
## Version 1.0.0
<u>Breaking Changes:</u> ✓ None

View File

@ -5,8 +5,8 @@ recommended.
The minimum requirements are:
- Python >= 3.8
- Pytest >= 7.1
- Python >= 3.8, < 3.12
- Pytest >= 7.4
The plugin should run anywhere where these two things can be used.
@ -25,9 +25,21 @@ pip install --extra-index-url https://git.codebau.dev/api/packages/pytest-plugin
## Install via `poetry`
```bash
poetry add --dev pytest_csv_params
poetry add --group dev pytest_csv_params
```
Alternatively, you can use the codebau.dev package repository with `poetry` also:
- Enable the repository as an explicit source (you should only need to do this once):
```bash
poetry source add --priority=explicit codebau_pytest_plugins https://git.codebau.dev/api/packages/pytest-plugins/pypi/simple
```
- Install the package:
```bash
poetry add --source codebau_pytest_plugins --group dev pytest_csv_params
```
For more information about `poetry`, visit [python-poetry.org](https://python-poetry.org/)
## For development

2
docs/py-modindex.rst Normal file
View File

@ -0,0 +1,2 @@
Python Module Index
===================

View File

@ -7,7 +7,6 @@ from os.path import dirname, join
from livereload import Server, shell
if __name__ == "__main__":
cmd = "make html"
if "win32" in sys.platform.lower():
cmd = "make.bat html"

1499
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "pytest-csv-params"
version = "1.0.0"
version = "1.1.0"
description = "Pytest plugin for Test Case Parametrization with CSV files"
authors = ["Juergen Edelbluth <csv_params@jued.de>"]
license = "MIT"
@ -52,6 +52,7 @@ filterwarnings=[
"ignore:Using the __implements__ inheritance pattern for BaseReporter is no longer supported. Child classes should only inherit BaseReporter",
"ignore:.*zipimport.*",
"ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release",
"ignore:The hookimpl .* uses old-style configuration options.*",
]
junit_family = "xunit2"
junit_logging = "all"
@ -103,12 +104,13 @@ exclude_lines = [
[tool.mypy]
python_version = "3.8"
strict = true
ignore_missing_imports = true
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.25.0
envlist = clean,py38,py39,py310
envlist = clean,py38,py39,py310,py311
isolated_build = True
[testenv]
@ -123,7 +125,7 @@ commands =
[tool.black]
line-length = 120
target-version = ['py38', 'py39', 'py310']
target-version = ['py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'
[tool.isort]
@ -133,7 +135,7 @@ multi_line_output = 3
[tool.poetry.dependencies]
python = "^3.8"
pytest = "^7.1.2"
pytest = "^7.4.0"
[tool.poetry.dev-dependencies]
tox = "^3.25.1"

View File

@ -95,34 +95,39 @@ def test_python_version(
@pytest.mark.parametrize(
["p_version", "expect_error"],
[
("7.1", None),
("7.1.1", None),
("7.1.1.2", None),
("7.1.1.2.3", None),
("7.1.1.455555", None),
("7.1.1.2-145", None),
("7.1.1.090909090990", None),
("7.2", None),
("7.2.5", None),
("7.2.5.6", None),
("7.2.5.6.3333333", None),
("7.2.5.6.333333333.4", None),
("7.4", None),
("7.4.1", None),
("7.4.1.2", None),
("7.4.1.2.3", None),
("7.4.1.455555", None),
("7.4.1.2-145", None),
("7.4.1.090909090990", None),
("7.5", None),
("7.5.5", None),
("7.5.5.6", None),
("7.5.5.6.3333333", None),
("7.5.5.6.333333333.4", None),
("8.0", None),
("8.0.1", None),
("8.0.beta", None),
("8.0.beta.3", None),
("8.0.2.3", None),
("7.0", (RuntimeError, "At least Pytest 7.1 required")),
("7.0.1", (RuntimeError, "At least Pytest 7.1 required")),
("7.0.111111", (RuntimeError, "At least Pytest 7.1 required")),
("7.0.111111.extra", (RuntimeError, "At least Pytest 7.1 required")),
("7.0.111111.extra.git-22", (RuntimeError, "At least Pytest 7.1 required")),
("7", (RuntimeError, "At least Pytest 7.1 required")),
("6", (RuntimeError, "At least Pytest 7.1 required")),
("6.1", (RuntimeError, "At least Pytest 7.1 required")),
("6.1.2", (RuntimeError, "At least Pytest 7.1 required")),
("6.1.2.final", (RuntimeError, "At least Pytest 7.1 required")),
("6.1.2.final.3", (RuntimeError, "At least Pytest 7.1 required")),
("7.0", (RuntimeError, "At least Pytest 7.4 required")),
("7.0.1", (RuntimeError, "At least Pytest 7.4 required")),
("7.0.111111", (RuntimeError, "At least Pytest 7.4 required")),
("7.1", (RuntimeError, "At least Pytest 7.4 required")),
("7.1.1", (RuntimeError, "At least Pytest 7.4 required")),
("7.1.111111", (RuntimeError, "At least Pytest 7.4 required")),
("7.2", (RuntimeError, "At least Pytest 7.4 required")),
("7.2.1", (RuntimeError, "At least Pytest 7.4 required")),
("7.2.111111", (RuntimeError, "At least Pytest 7.4 required")),
("7.3", (RuntimeError, "At least Pytest 7.4 required")),
("7.3.1", (RuntimeError, "At least Pytest 7.4 required")),
("7.3.111111", (RuntimeError, "At least Pytest 7.4 required")),
("7", (RuntimeError, "At least Pytest 7.4 required")),
("6", (RuntimeError, "At least Pytest 7.4 required")),
("6.1", (RuntimeError, "At least Pytest 7.4 required")),
("6.1.2", (RuntimeError, "At least Pytest 7.4 required")),
],
)
def test_pytest_version(