Skip to content

Commit f3273dd

Browse files
authored
Merge pull request #37 from jakkdl/bump_version_support
Add basic 3.13 support, various cleanups and version bumps
2 parents 33d6cac + 734efc6 commit f3273dd

File tree

11 files changed

+43
-32
lines changed

11 files changed

+43
-32
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
check:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- name: Set up Python 3.8
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: 3.8
1818
- name: Install dependencies
@@ -28,12 +28,12 @@ jobs:
2828
runs-on: ubuntu-latest
2929
strategy:
3030
matrix:
31-
python-version: ["3.8", "3.9", "3.10", "3.11"]
31+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
3232
fail-fast: false
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
3535
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v2
36+
uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939
- name: Install dependencies
@@ -48,9 +48,9 @@ jobs:
4848
needs: [check, test]
4949
if: github.repository == 'Zac-HD/hypothesmith' && github.ref == 'refs/heads/master'
5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v4
5252
- name: Set up Python 3.8
53-
uses: actions/setup-python@v1
53+
uses: actions/setup-python@v5
5454
with:
5555
python-version: 3.8
5656
- name: Install tools

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 0.3.3 - 2024-02-16
4+
- Add Python 3.12 and 3.13 to CI
5+
- Can now be imported on Python 3.13
6+
37
### 0.3.2 - 2024-01-13
48
- Performance improvements based on
59
[Hypothesis 6.93.0](https://hypothesis.readthedocs.io/en/latest/changes.html#v6-93-0)

deps/check.txt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ attrs==23.2.0
1010
# hypothesis
1111
autoflake==2.2.1
1212
# via shed
13-
bandit==1.7.6
13+
bandit==1.7.7
1414
# via flake8-bandit
15-
black==23.12.1
15+
black==24.2.0
1616
# via shed
1717
click==8.1.7
1818
# via black
@@ -29,17 +29,13 @@ flake8==7.0.0
2929
# flake8-docstrings
3030
flake8-bandit==4.1.1
3131
# via -r deps/check.in
32-
flake8-bugbear==23.12.2
32+
flake8-bugbear==24.2.6
3333
# via -r deps/check.in
3434
flake8-comprehensions==3.14.0
3535
# via -r deps/check.in
3636
flake8-docstrings==1.7.0
3737
# via -r deps/check.in
38-
gitdb==4.0.11
39-
# via gitpython
40-
gitpython==3.1.41
41-
# via bandit
42-
hypothesis==6.93.0
38+
hypothesis==6.98.6
4339
# via -r deps/check.in
4440
isort==5.13.2
4541
# via shed
@@ -64,7 +60,7 @@ pathspec==0.12.1
6460
# via black
6561
pbr==6.0.0
6662
# via stevedore
67-
platformdirs==4.1.0
63+
platformdirs==4.2.0
6864
# via black
6965
pycodestyle==2.11.1
7066
# via flake8
@@ -84,10 +80,8 @@ pyyaml==6.0.1
8480
# libcst
8581
rich==13.7.0
8682
# via bandit
87-
shed==2023.6.1
83+
shed==2024.1.1
8884
# via -r deps/check.in
89-
smmap==5.0.1
90-
# via gitdb
9185
snowballstemmer==2.2.0
9286
# via pydocstyle
9387
sortedcontainers==2.4.0

deps/test.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
#
77
attrs==23.2.0
88
# via hypothesis
9-
black==23.12.1
9+
black==24.2.0
1010
# via -r deps/test.in
1111
click==8.1.7
1212
# via black
13-
coverage[toml]==7.4.0
13+
coverage[toml]==7.4.1
1414
# via pytest-cov
1515
exceptiongroup==1.2.0
1616
# via
1717
# hypothesis
1818
# pytest
1919
execnet==2.0.2
2020
# via pytest-xdist
21-
hypothesis[lark]==6.93.0
21+
hypothesis[lark]==6.98.6
2222
# via hypothesmith (setup.py)
2323
iniconfig==2.0.0
2424
# via pytest
@@ -38,11 +38,11 @@ parso==0.8.3
3838
# via -r deps/test.in
3939
pathspec==0.12.1
4040
# via black
41-
platformdirs==4.1.0
41+
platformdirs==4.2.0
4242
# via black
43-
pluggy==1.3.0
43+
pluggy==1.4.0
4444
# via pytest
45-
pytest==7.4.4
45+
pytest==8.0.0
4646
# via
4747
# -r deps/test.in
4848
# pytest-cov

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def local_file(name: str) -> str:
4545
"Programming Language :: Python :: 3.9",
4646
"Programming Language :: Python :: 3.10",
4747
"Programming Language :: Python :: 3.11",
48+
"Programming Language :: Python :: 3.12",
4849
"Topic :: Software Development :: Testing",
4950
],
5051
long_description=open(README).read(),

src/hypothesmith/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
from hypothesmith.cst import from_node
44
from hypothesmith.syntactic import from_grammar
55

6-
__version__ = "0.3.2"
6+
__version__ = "0.3.3"
77
__all__ = ["from_grammar", "from_node"]

src/hypothesmith/syntactic.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import ast
44
import dis
55
import sys
6-
import warnings
7-
from importlib.resources import read_text
86

97
from hypothesis import assume, strategies as st
108
from hypothesis.extra.lark import LarkStrategy
@@ -13,10 +11,16 @@
1311

1412
# To update this grammar file, run
1513
# wget https://raw.githubusercontent.com/lark-parser/lark/master/lark/grammars/python.lark -O src/hypothesmith/python.lark
16-
with warnings.catch_warnings():
17-
# `read_text()` is deprecated; I'll update once I've dropped 3.8 and earlier.
18-
warnings.simplefilter("ignore")
14+
if sys.version_info < (3, 9): # pragma: no cover
15+
from importlib.resources import read_text
16+
1917
LARK_GRAMMAR = read_text("hypothesmith", "python.lark")
18+
else: # pragma: no cover # not on py38, anyway
19+
from importlib.resources import files
20+
21+
LARK_GRAMMAR = (
22+
files("hypothesmith").joinpath("python.lark").read_text(encoding="utf8")
23+
)
2024

2125
COMPILE_MODES = {
2226
"eval_input": "eval",

tests/test_cst.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Tests for the hypothesmith.cst module."""
2+
23
import ast
4+
import sys
35
from inspect import isabstract
46
from operator import attrgetter
57

@@ -83,6 +85,7 @@ def test_compilable_never_raises(s):
8385
compilable(s)
8486

8587

88+
@pytest.mark.xfail(sys.version_info >= (3, 13), reason="parso does not support 3.13")
8689
@given(source_code=hypothesmith.from_node())
8790
def test_parso_from_node(source_code):
8891
result = parso.parse(source_code).get_code()

tests/test_syntactic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Tests for the hypothesmith.syntactic module."""
2+
23
import ast
34
import io
5+
import sys
46
import tokenize
57

68
import black
@@ -96,6 +98,7 @@ def test_generation_without_targeting(source_code):
9698
compile(source_code, filename="<string>", mode="exec")
9799

98100

101+
@pytest.mark.xfail(sys.version_info >= (3, 13), reason="parso does not support 3.13")
99102
@given(source_code=hypothesmith.from_grammar())
100103
def test_parso_from_grammar(source_code):
101104
result = parso.parse(source_code).get_code()

tests/test_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the hypothesmith package metadata."""
2+
23
import re
34
from datetime import date
45
from functools import lru_cache

0 commit comments

Comments
 (0)