From 0c69f21b840c748a8e0211cb82689daf5e0aa62a Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Sat, 30 Sep 2023 15:32:34 +0200 Subject: [PATCH 1/2] test 3.12 --- .github/workflows/ci.yml | 2 +- pyproject.toml | 3 ++- requirements/docs.txt | 8 ++++---- requirements/linting.txt | 6 +++--- requirements/pyproject.txt | 8 +++++--- requirements/testing.txt | 16 ++++++++-------- tests/test_insert_assert.py | 14 ++++---------- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3df53d6..91be151 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev'] env: PYTHON: ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 28a9ecf..47e6a57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ classifiers = [ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Internet', 'Typing :: Typed', @@ -78,7 +79,7 @@ color = true line-length = 120 target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] skip-string-normalization = true -extend-exclude = ['tests/test_expr_render.py'] +extend-exclude = 'tests/test_expr_render.py' [tool.ruff] line-length = 120 diff --git a/requirements/docs.txt b/requirements/docs.txt index b2d5b9f..9d54bf2 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --output-file=requirements/docs.txt --resolver=backtracking requirements/docs.in +# pip-compile --output-file=requirements/docs.txt requirements/docs.in # ansi2html==1.8.0 # via -r requirements/docs.in @@ -48,17 +48,17 @@ mkdocs-material-extensions==1.1.1 # via mkdocs-material mkdocs-simple-hooks==0.1.5 # via -r requirements/docs.in -numpy==1.24.2 +numpy==1.26.0 # via -r requirements/docs.in packaging==23.0 # via mkdocs -pygments==2.15.0 +pygments==2.16.1 # via mkdocs-material pymdown-extensions==10.0 # via mkdocs-material python-dateutil==2.8.2 # via ghp-import -pyyaml==6.0 +pyyaml==6.0.1 # via # mkdocs # pymdown-extensions diff --git a/requirements/linting.txt b/requirements/linting.txt index bd6c1fc..01c1a7a 100644 --- a/requirements/linting.txt +++ b/requirements/linting.txt @@ -10,7 +10,7 @@ black==23.3.0 # via -r requirements/linting.in click==8.1.3 # via black -exceptiongroup==1.1.1 +exceptiongroup==1.1.3 # via pytest iniconfig==2.0.0 # via pytest @@ -30,7 +30,7 @@ platformdirs==3.2.0 # via black pluggy==1.0.0 # via pytest -pytest==7.2.2 +pytest==7.4.2 # via -r requirements/linting.in ruff==0.0.261 # via -r requirements/linting.in @@ -41,7 +41,7 @@ tomli==2.0.1 # black # mypy # pytest -typing-extensions==4.5.0 +typing-extensions==4.8.0 # via # mypy # sqlalchemy diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index d385c38..87737f4 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -2,11 +2,13 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --output-file=requirements/pyproject.txt --resolver=backtracking pyproject.toml +# pip-compile --output-file=requirements/pyproject.txt pyproject.toml # -asttokens==2.2.1 +asttokens==2.4.0 # via devtools (pyproject.toml) -executing==1.2.0 +executing==2.0.0 + # via devtools (pyproject.toml) +pygments==2.16.1 # via devtools (pyproject.toml) six==1.16.0 # via asttokens diff --git a/requirements/testing.txt b/requirements/testing.txt index a3b4099..9e2c8f4 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -2,12 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --output-file=requirements/testing.txt --resolver=backtracking requirements/testing.in +# pip-compile --output-file=requirements/testing.txt requirements/testing.in # -asyncpg==0.27.0 ; python_version >= "3.8" +asyncpg==0.28.0 ; python_version >= "3.8" # via -r requirements/testing.in -attrs==22.2.0 - # via pytest black==23.3.0 # via -r requirements/testing.in click==8.1.3 @@ -16,6 +14,8 @@ coverage[toml]==7.2.2 # via -r requirements/testing.in exceptiongroup==1.1.3 # via pytest +greenlet==3.0.0rc3 + # via sqlalchemy iniconfig==2.0.0 # via pytest markdown-it-py==2.2.0 @@ -26,7 +26,7 @@ multidict==6.0.4 ; python_version >= "3.8" # via -r requirements/testing.in mypy-extensions==1.0.0 # via black -numpy==1.24.2 ; python_version >= "3.8" +numpy==1.26.0 ; python_version >= "3.8" # via -r requirements/testing.in packaging==23.0 # via @@ -40,9 +40,9 @@ pluggy==1.0.0 # via pytest pydantic==1.10.7 # via -r requirements/testing.in -pygments==2.15.0 +pygments==2.16.1 # via rich -pytest==7.2.2 +pytest==7.4.2 # via # -r requirements/testing.in # pytest-mock @@ -60,7 +60,7 @@ tomli==2.0.1 # black # coverage # pytest -typing-extensions==4.5.0 +typing-extensions==4.8.0 # via # pydantic # sqlalchemy diff --git a/tests/test_insert_assert.py b/tests/test_insert_assert.py index 299cee8..cba8607 100644 --- a/tests/test_insert_assert.py +++ b/tests/test_insert_assert.py @@ -2,13 +2,13 @@ import sys import pytest +from pytest_pretty import ansi_escape from devtools.pytest_plugin import load_black pytestmark = pytest.mark.skipif(sys.version_info < (3, 8), reason='requires Python 3.8+') -config = "pytest_plugins = ['devtools.pytest_plugin']" # language=Python default_test = """\ def test_ok(): @@ -22,7 +22,6 @@ def test_string_assert(insert_assert): def test_insert_assert(pytester_pretty): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) test_file = pytester_pretty.makepyfile(default_test) result = pytester_pretty.runpytest() result.assert_outcomes(passed=2) @@ -40,7 +39,6 @@ def test_insert_assert(pytester_pretty): def test_insert_assert_no_pretty(pytester): os.environ.pop('CI', None) - pytester.makeconftest(config) test_file = pytester.makepyfile(default_test) result = pytester.runpytest('-p', 'no:pretty') result.assert_outcomes(passed=2) @@ -57,7 +55,6 @@ def test_insert_assert_no_pretty(pytester): def test_insert_assert_print(pytester_pretty, capsys): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) test_file = pytester_pretty.makepyfile(default_test) # assert r == 0 result = pytester_pretty.runpytest('--insert-assert-print') @@ -70,17 +67,15 @@ def test_insert_assert_print(pytester_pretty, capsys): def test_insert_assert_fail(pytester_pretty): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) test_file = pytester_pretty.makepyfile(default_test) # assert r == 0 result = pytester_pretty.runpytest() - assert result.parseoutcomes() == {'passed': 2, 'warning': 1, 'insert': 1} + assert result.parseoutcomes() == {'passed': 2, 'insert': 1} assert test_file.read_text() != default_test def test_deep(pytester_pretty): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) # language=Python test_file = pytester_pretty.makepyfile( """ @@ -103,7 +98,6 @@ def test_deep(insert_assert): def test_enum(pytester_pretty, capsys): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) # language=Python pytester_pretty.makepyfile( """ @@ -121,7 +115,8 @@ def test_deep(insert_assert): result = pytester_pretty.runpytest('--insert-assert-print') result.assert_outcomes(passed=1) captured = capsys.readouterr() - assert ' assert x == Foo.A\n' in captured.out + out = ansi_escape.sub('', captured.out).strip() # clean colors + assert ' assert x == Foo.A\n' in out def test_insert_assert_black(tmp_path): @@ -145,7 +140,6 @@ def test_insert_assert_black(tmp_path): def test_insert_assert_repeat(pytester_pretty, capsys): os.environ.pop('CI', None) - pytester_pretty.makeconftest(config) test_file = pytester_pretty.makepyfile( """\ import pytest From 6a5554c9a8174d6e81540d1168d5442f3288d6f8 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Sat, 30 Sep 2023 15:41:56 +0200 Subject: [PATCH 2/2] upgrade black --- requirements/linting.txt | 2 +- requirements/testing.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements/linting.txt b/requirements/linting.txt index 01c1a7a..05456cf 100644 --- a/requirements/linting.txt +++ b/requirements/linting.txt @@ -6,7 +6,7 @@ # attrs==22.2.0 # via pytest -black==23.3.0 +black==23.9.1 # via -r requirements/linting.in click==8.1.3 # via black diff --git a/requirements/testing.txt b/requirements/testing.txt index 9e2c8f4..2b31a4d 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -6,7 +6,7 @@ # asyncpg==0.28.0 ; python_version >= "3.8" # via -r requirements/testing.in -black==23.3.0 +black==23.9.1 # via -r requirements/testing.in click==8.1.3 # via black @@ -62,5 +62,6 @@ tomli==2.0.1 # pytest typing-extensions==4.8.0 # via + # black # pydantic # sqlalchemy