Skip to content

Commit

Permalink
Merge pull request #136 from 56kyle/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
56kyle authored Jun 20, 2024
2 parents 56db1aa + bd02ddf commit 9d9f573
Show file tree
Hide file tree
Showing 35 changed files with 1,200 additions and 747 deletions.
6 changes: 4 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"_checkout": null,
"_output_dir": "C:\\Users\\56kyl\\source\\repos",
"_template": "gh:cjolowicz/cookiecutter-hypermodern-python",
"_repo_dir": "./cookiecutter-hypermodern-python",
"_template": "./cookiecutter-hypermodern-python",
"author": "Kyle Oliver",
"copyright_year": "2023",
"development_status": "Development Status :: 1 - Planning",
Expand All @@ -10,5 +12,5 @@
"license": "MIT",
"package_name": "pytest_static",
"project_name": "pytest-static",
"version": "0.0.0"
"version": "0.3.0"
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,toml}]
indent_style = space
indent_size = 4

[*.yml,yaml,json]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,B905
max-line-length = 80
max-line-length = 120
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101,D100,D101,D102,D103,D104 exceptions.py:D107
Expand Down
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
interval: weekly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: daily
interval: weekly
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: daily
interval: weekly
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
interval: weekly
versioning-strategy: lockfile-only
allow:
- dependency-type: "all"
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
permissions:
contents: write
packages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Check out the repository
Expand All @@ -22,16 +23,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
Expand Down Expand Up @@ -61,17 +62,12 @@ jobs:
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/[email protected]
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ jobs:
fail-fast: false
matrix:
include:
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.10", os: "ubuntu-latest", session: "safety" }
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.12", os: "ubuntu-latest", session: "safety" }
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
- { python: "3.8", os: "ubuntu-latest", session: "mypy" }
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.8", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "windows-latest", session: "tests" }
- { python: "3.10", os: "macos-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
- { python: "3.12", os: "windows-latest", session: "tests" }
- { python: "3.12", os: "macos-latest", session: "tests" }
- { python: "3.12", os: "ubuntu-latest", session: "typeguard" }
- { python: "3.12", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.12", os: "ubuntu-latest", session: "docs-build" }

env:
NOXSESSION: ${{ matrix.session }}
Expand All @@ -36,13 +38,13 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python }}

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
Expand All @@ -56,13 +58,13 @@ jobs:
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
nox --version
- name: Compute pre-commit cache key
Expand Down Expand Up @@ -115,24 +117,24 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v4.6.1
with:
python-version: "3.10"
python-version: "3.12"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=${{ github.workspace }}/.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Install Nox
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
nox --version
- name: Download coverage data
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
repos:
- repo: local
hooks:
- id: bandit
name: bandit
entry: bandit
language: system
types: [python]
require_serial: true
args: ["-c", "bandit.yml"]
- id: black
name: black
entry: black
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
python: "3.12"
sphinx:
configuration: docs/conf.py
formats: all
Expand Down
41 changes: 41 additions & 0 deletions .safety-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: "3.0"

scanning-settings:
max-depth: 6
exclude: []
include-files: []
system:
targets: []

report:
dependency-vulnerabilities:
enabled: true
auto-ignore-in-report:
python:
environment-results: true
unpinned-requirements: true
cvss-severity: []

fail-scan-with-exit-code:
dependency-vulnerabilities:
enabled: true
fail-on-any-of:
cvss-severity:
- critical
- medium
- high
exploitability:
- critical
- medium
- high

security-updates:
dependency-vulnerabilities:
auto-security-updates-limit:
- patch

security:
ignore-vulnerabilities:
70612:
reason: Jinja2 has no intentions of fixing this vulnerability.
expires: "2025-01-01"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Request features on the [Issue Tracker].

## How to set up your development environment

You need Python 3.7+ and the following tools:
You need Python 3.9+ and the following tools:

- [Poetry]
- [Nox]
Expand Down
43 changes: 6 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# pytest-static

[![PyPI](https://img.shields.io/pypi/v/pytest-static.svg)][pypi_]
[![Status](https://img.shields.io/pypi/status/pytest-static.svg)][status]
[![Python Version](https://img.shields.io/pypi/pyversions/pytest-static)][python version]
[![PyPI](https://img.shields.io/pypi/v/pytest-static.svg)][pypi status]
[![Status](https://img.shields.io/pypi/status/pytest-static.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/pytest-static)][pypi status]
[![License](https://img.shields.io/pypi/l/pytest-static)][license]

[![Read the documentation at https://pytest-static.readthedocs.io/](https://img.shields.io/readthedocs/pytest-static/latest.svg?label=Read%20the%20Docs)][read the docs]
Expand All @@ -12,48 +12,17 @@
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

[pypi_]: https://pypi.org/project/pytest-static/
[status]: https://pypi.org/project/pytest-static/
[python version]: https://pypi.org/project/pytest-static
[pypi status]: https://pypi.org/project/pytest-static/
[read the docs]: https://pytest-static.readthedocs.io/
[tests]: https://github.com/56kyle/pytest-static/actions?workflow=Tests
[codecov]: https://app.codecov.io/gh/56kyle/pytest-static
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black

## Overview

pytest-static is a pytest plugin that allows you to parametrize your tests using type annotations.

What this looks like in practice is that you can write a test like this:

```python
import pytest
from typing import Tuple


@pytest.mark.parametrize_types("a", [Tuple[bool, bool]])
def test_a(a: bool) -> None:
assert isinstance(a, bool)
```

Which would be equivalent to the following test

```python
import pytest


@pytest.mark.parametrize("a", [(True, True), (True, False), (False, True), (False, False)])
def test_a(a: int) -> None:
assert isinstance(a, int)
```

For types such as int, str, etc that have an unlimited amount of values, there are premade sets meant to cover common edge cases that are used by default

However, you can also override these defaults if you wish by passing an instance of Config with some custom handlers set.

## Features

- TODO

## Requirements

- TODO
Expand Down
2 changes: 2 additions & 0 deletions bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assert_used:
skips: ["*/test_*.py"]
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration."""

project = "pytest-static"
author = "Kyle Oliver"
copyright = "2023, Kyle Oliver"
Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
furo==2023.8.19
sphinx==7.2.5
sphinx-click==5.0.1
myst_parser==2.0.0
furo==2022.12.7
sphinx==5.3.0
sphinx-click==4.4.0
myst_parser==0.18.1
Loading

0 comments on commit 9d9f573

Please sign in to comment.