Skip to content

Commit

Permalink
Fully support Python 3.11 (#104)
Browse files Browse the repository at this point in the history
* Ensure tox envs that run tests depend on cmd extra

* Fix test_report_gives_package_version on Python 3.11+

Fixes #94. See python/cpython#98771 and
#94 (comment).

* Add missing newline at end of pyct/tests/test_report.py

* Test Python 3.11 and add it to the trove classifiers
  • Loading branch information
musicinmybrain authored Jan 30, 2023
1 parent 57021da commit 62231c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyct/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class TestModule:
__version__ = "1.9.3"
__file__ = "/mock/opt/anaconda3/envs/pyct/lib/python3.7/site-packages/param/__init__.py"

@patch("builtins.print")
@patch("importlib.import_module")
def test_report_gives_package_version(mock_import_module, mock_print):
@patch("builtins.print")
def test_report_gives_package_version(mock_print, mock_import_module):
module = TestModule()
mock_import_module.return_value = module

Expand Down Expand Up @@ -47,4 +47,4 @@ def test_report_gives_system_version(mock_platform, mock_print):
def test_unknown_package_output(mock_print):
report("fake_package")

mock_print.assert_called_with("fake_package=unknown # not installed in this environment")
mock_print.assert_called_with("fake_package=unknown # not installed in this environment")
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def get_setup_version(root, reponame):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Development Status :: 4 - Beta'
],
author='HoloViz',
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = {py36,py37,py38,py39,py310}-{flakes,unit,cmd_examples,build_examples,all}-{default}-{dev,pkg}
envlist = {py36,py37,py38,py39,py310,py311}-{flakes,unit,cmd_examples,build_examples,all}-{default}-{dev,pkg}
build = wheel

[_flakes]
Expand All @@ -21,11 +21,11 @@ commands = {[_flakes]commands}
{[_unit]commands}
{[_cmd_examples]commands}
{[_build_examples]commands}
deps = .[examples, tests]
deps = .[examples,tests,cmd]

[_unit]
description = Run unit tests
deps = .[tests]
deps = .[tests,cmd]
commands = pytest pyct
pyct --help
pyct --version
Expand Down

0 comments on commit 62231c5

Please sign in to comment.