Skip to content
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

New arguments + project updates #103

Merged
merged 1 commit into from
Sep 25, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8", "pypy-3.9", "pypy-3.10"]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"] # , "pypy-3.9", "pypy-3.10"
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

#### 0.23.0 - 2023-09-24
- Add new `allow_x00=` and `codec=` arguments to `from_schema()`, so that you can
control generated strings more precisely.
- Require hypothesis 6.84+ and jsonschema 4.18+, to support new features and
avoid deprecations.
- Requires Python 3.8 or later (3.7 is end-of-life), tested on Python 3.11

#### 0.22.1 - 2023-02-07
- Cache JSON Schema validators by their schema's JSON representation

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ def test_integers(value):
def test_card_numbers(value):
assert isinstance(value, str)
assert re.match(r"^\d{4} \d{4} \d{4} \d{4}$", value)


@given(from_schema({}, allow_x00=False, codec="utf-8").map(json.dumps))
def test_card_numbers(payload):
assert isinstance(payload, str)
assert "\0" not in payload # use allow_x00=False to exclude null characters
# If you want to restrict generated strings characters which are valid in
# a specific character encoding, you can do that with the `codec=` argument.
payload.encode(codec="utf-8")
```

For more details on property-based testing and how to use or customise
Expand Down
13 changes: 1 addition & 12 deletions deps/check.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Top-level dependencies for `tox -e check`
flake8
flake8-2020
flake8-bandit
flake8-bugbear
flake8-builtins
flake8-comprehensions
flake8-datetimez
flake8-docstrings
flake8-mutable
# flake8-noqa # See https://github.com/JBKahn/flake8-print/issues/50
flake8-print
flake8-strftime
ruff
mypy
pep8-naming
shed
139 changes: 29 additions & 110 deletions deps/check.txt
Original file line number Diff line number Diff line change
@@ -1,145 +1,64 @@
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=deps/check.txt deps/check.in
#
attrs==21.2.0
# via flake8-bugbear
autoflake==1.4
autoflake==2.2.1
# via shed
bandit==1.7.1
# via flake8-bandit
black==21.12b0
black==23.9.0
# via shed
click==8.0.3
click==8.1.7
# via black
com2ann==0.3.0
# via shed
colorama==0.4.4
# via
# bandit
# click
flake8==4.0.1
# via
# -r deps/check.in
# flake8-2020
# flake8-bandit
# flake8-bugbear
# flake8-builtins
# flake8-comprehensions
# flake8-datetimez
# flake8-docstrings
# flake8-helper
# flake8-mutable
# flake8-polyfill
# flake8-print
# flake8-strftime
# pep8-naming
flake8-2020==1.6.1
# via -r deps/check.in
flake8-bandit==2.1.2
# via -r deps/check.in
flake8-bugbear==21.11.29
# via -r deps/check.in
flake8-builtins==1.5.3
# via -r deps/check.in
flake8-comprehensions==3.7.0
# via -r deps/check.in
flake8-datetimez==20.10.0
flake8==6.1.0
# via -r deps/check.in
flake8-docstrings==1.6.0
# via -r deps/check.in
flake8-helper==0.2.0
# via flake8-strftime
flake8-mutable==1.2.0
# via -r deps/check.in
flake8-polyfill==1.0.2
# via
# flake8-bandit
# pep8-naming
flake8-print==4.0.0
# via -r deps/check.in
flake8-strftime==0.3.2
# via -r deps/check.in
gitdb==4.0.9
# via gitpython
gitpython==3.1.24
# via bandit
importlib-metadata==4.2.0
# via
# click
# flake8
# flake8-2020
# flake8-comprehensions
# stevedore
isort==5.10.1
isort==5.12.0
# via shed
libcst==0.3.23
libcst==1.0.1
# via shed
mccabe==0.6.1
mccabe==0.7.0
# via flake8
mypy==0.910
mypy==1.5.1
# via -r deps/check.in
mypy-extensions==0.4.3
mypy-extensions==1.0.0
# via
# black
# mypy
# typing-inspect
pathspec==0.9.0
packaging==23.1
# via black
pbr==5.8.0
# via stevedore
pep8-naming==0.12.1
# via -r deps/check.in
platformdirs==2.4.0
pathspec==0.11.2
# via black
pycodestyle==2.8.0
# via
# flake8
# flake8-bandit
# flake8-print
pydocstyle==6.1.1
# via flake8-docstrings
pyflakes==2.4.0
platformdirs==3.10.0
# via black
pycodestyle==2.11.0
# via flake8
pyflakes==3.1.0
# via
# autoflake
# flake8
pyupgrade==2.29.1
pyupgrade==3.10.1
# via shed
pyyaml==6.0
# via
# bandit
# libcst
shed==0.5.3
pyyaml==6.0.1
# via libcst
ruff==0.0.287
# via -r deps/check.in
six==1.16.0
# via flake8-print
smmap==5.0.0
# via gitdb
snowballstemmer==2.2.0
# via pydocstyle
stevedore==3.5.0
# via bandit
tokenize-rt==4.2.1
shed==2023.6.1
# via -r deps/check.in
tokenize-rt==5.2.0
# via pyupgrade
toml==0.10.2
# via mypy
tomli==1.2.3
# via black
typed-ast==1.4.3
tomli==2.0.1
# via
# autoflake
# black
# mypy
typing-extensions==4.0.1
typing-extensions==4.7.1
# via
# black
# gitpython
# importlib-metadata
# libcst
# mypy
# typing-inspect
typing-inspect==0.7.1
typing-inspect==0.9.0
# via libcst
zipp==3.6.0
# via importlib-metadata
90 changes: 36 additions & 54 deletions deps/test.txt
Original file line number Diff line number Diff line change
@@ -1,98 +1,80 @@
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=deps/test.txt deps/test.in setup.py
#
arrow==1.2.1
arrow==1.2.3
# via isoduration
atomicwrites==1.4.0
# via pytest
attrs==21.2.0
attrs==23.1.0
# via
# hypothesis
# jsonschema
# pytest
cached-property==1.5.2
# via fqdn
colorama==0.4.4
# via pytest
coverage[toml]==6.2
# referencing
coverage[toml]==7.3.1
# via pytest-cov
execnet==1.9.0
exceptiongroup==1.1.3
# via
# hypothesis
# pytest
execnet==2.0.2
# via pytest-xdist
fqdn==1.5.1
# via jsonschema
hypothesis==6.31.6
hypothesis==6.84.3
# via hypothesis-jsonschema (setup.py)
idna==3.3
idna==3.4
# via jsonschema
importlib-metadata==4.8.2
# via
# jsonschema
# pluggy
# pytest
importlib-resources==5.4.0
# via jsonschema
iniconfig==1.1.1
iniconfig==2.0.0
# via pytest
isoduration==20.11.0
# via jsonschema
jsonpointer==2.2
jsonpointer==2.4
# via jsonschema
jsonschema[format]==4.2.1
jsonschema[format]==4.19.0
# via
# -r deps/test.in
# hypothesis-jsonschema (setup.py)
packaging==21.3
jsonschema-specifications==2023.7.1
# via jsonschema
packaging==23.1
# via pytest
pluggy==1.0.0
pluggy==1.3.0
# via pytest
py==1.11.0
# via
# pytest
# pytest-forked
pyparsing==3.0.6
# via packaging
pyrsistent==0.18.0
# via jsonschema
pytest==6.2.5
pytest==7.4.2
# via
# -r deps/test.in
# pytest-cov
# pytest-forked
# pytest-xdist
pytest-cov==3.0.0
pytest-cov==4.1.0
# via -r deps/test.in
pytest-forked==1.4.0
# via pytest-xdist
pytest-xdist==2.5.0
pytest-xdist==3.3.1
# via -r deps/test.in
python-dateutil==2.8.2
# via arrow
referencing==0.30.2
# via
# jsonschema
# jsonschema-specifications
rfc3339-validator==0.1.4
# via jsonschema
rfc3987==1.3.8
# via jsonschema
rpds-py==0.10.2
# via
# jsonschema
# referencing
six==1.16.0
# via
# python-dateutil
# rfc3339-validator
sortedcontainers==2.4.0
# via hypothesis
toml==0.10.2
# via pytest
tomli==2.0.0
# via coverage
typing-extensions==4.0.1
tomli==2.0.1
# via
# arrow
# importlib-metadata
uri-template==1.1.0
# coverage
# pytest
uri-template==1.3.0
# via jsonschema
webcolors==1.11.1
webcolors==1.13
# via jsonschema
zipp==3.6.0
# via
# importlib-metadata
# importlib-resources
Loading
Loading