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

Drop support for older Python versions (2.X, 3.5, 3.6) #153

Merged
merged 3 commits into from
Mar 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
461 changes: 103 additions & 358 deletions .circleci/config.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Icon?
.tox
build/
.cache/

\.idea/
.vscode/
.idea/
72 changes: 28 additions & 44 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,33 +179,27 @@ Compatibility

`Yes`__ (mostly).

__ https://travis-ci.org/wolever/parameterized
__ https://app.circleci.com/pipelines/github/wolever/parameterized?branch=master

.. list-table::
:header-rows: 1
:stub-columns: 1

* -
- Py2.6
- Py2.7
- Py3.4
- Py3.5
- Py3.6
- Py3.7
- Py3.8
- Py3.9
- PyPy
- Py3.10
- Py3.11
- PyPy3
- ``@mock.patch``
* - nose
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- no§
- no§
- yes
* - nose2
- yes
Expand All @@ -215,30 +209,21 @@ __ https://travis-ci.org/wolever/parameterized
- yes
- yes
- yes
- yes
- yes
- yes
* - py.test 2
- yes
- yes
- no*
- no*
- no*
- no*
- yes
- yes
- yes
- yes
- no*
- no*
- no*
* - py.test 3
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- yes
- no*
- no*
- yes
* - py.test 4
- no**
Expand All @@ -248,9 +233,6 @@ __ https://travis-ci.org/wolever/parameterized
- no**
- no**
- no**
- no**
- no**
- no**
* - py.test fixtures
- no†
- no†
Expand All @@ -259,9 +241,6 @@ __ https://travis-ci.org/wolever/parameterized
- no†
- no†
- no†
- no†
- no†
- no†
* - | unittest
| (``@parameterized.expand``)
- yes
Expand All @@ -271,29 +250,29 @@ __ https://travis-ci.org/wolever/parameterized
- yes
- yes
- yes
- yes
- yes
- yes
* - | unittest2
| (``@parameterized.expand``)
- yes
- yes
- yes
- yes
- no§
- no§
- yes
- yes
- yes
- yes
- yes
- yes

\*: py.test 2 does `does not appear to work (#71)`__ under Python 3. Please comment on the related issues if you are affected.
§: nose and unittest2 - both of which were last updated in 2015 - sadly do not
appear to support Python 3.10 or 3.11.

\*: `py.test 2 does not appear to work under Python 3 (#71)`__, and
`py.test 3 does not appear to work under Python 3.10 or 3.11 (#154)`__.

\*\*: py.test 4 is not yet supported (but coming!) in `issue #34`__

†: py.test fixture support is documented in `issue #81`__


__ https://github.com/wolever/parameterized/issues/71
__ https://github.com/wolever/parameterized/issues/154
__ https://github.com/wolever/parameterized/issues/34
__ https://github.com/wolever/parameterized/issues/81

Expand Down Expand Up @@ -649,9 +628,10 @@ To migrate a codebase from ``nose-parameterized`` to ``parameterized``:
FAQ
---

What happened to ``nose-parameterized``?
Originally only nose was supported. But now everything is supported, and it
only made sense to change the name!
What happened to Python 2.X, 3.5, and 3.6 support?
As of version 0.9.0, ``parameterized`` no longer supports Python 2.X, 3.5,
or 3.6. Previous versions of ``parameterized`` - 0.8.1 being the latest -
will continue to work, but will not receive any new features or bug fixes.

What do you mean when you say "nose is best supported"?
There are small caveates with ``py.test`` and ``unittest``: ``py.test``
Expand All @@ -668,3 +648,7 @@ Why do I get an ``AttributeError: 'function' object has no attribute 'expand'``
You've likely installed the ``parametrized`` (note the missing *e*)
package. Use ``parameterized`` (with the *e*) instead and you'll be all
set.

What happened to ``nose-parameterized``?
Originally only nose was supported. But now everything is supported, and it
only made sense to change the name!
2 changes: 1 addition & 1 deletion parameterized/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .parameterized import parameterized, param, parameterized_class

__version__ = "0.8.1"
__version__ = "0.9.0"
3 changes: 3 additions & 0 deletions parameterized/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
class SkipTest(Exception):
pass

# NOTE: even though Python 2 support has been dropped, these checks have been
# left in place to avoid merge conflicts. They can be removed in the future, and
# future code can be written to assume Python 3.
PY3 = sys.version_info[0] == 3
PY2 = sys.version_info[0] == 2

Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "parameterized"
authors = [{name = "David Wolever", email = "david@wolever.net"}]
license = {text = "FreeBSD"}
description = "Parameterized testing with any Python test framework"
readme = "README.rst"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
]
Expand All @@ -30,3 +26,7 @@ version = {attr = "parameterized.__version__"}

[tool.distutils.bdist_wheel]
universal = 1

[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
21 changes: 12 additions & 9 deletions rebuild-circleci-yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Rebuilds the .circleci/config.yml file based on the output of ``tox --listenvs``
Expand All @@ -21,16 +21,16 @@ jobs:

test-{{ tox_env }}:
docker:
{% if python_ver == "pypy" -%}
- image: pypy:2
{% if python_ver == "pypy3" -%}
- image: pypy:3
{%- else -%}
- image: python:{{ python_ver }}
{%- endif %}
steps:
- checkout
- run:
name: install tox
command: pip install tox==3.7.0
command: pip install tox
- run:
name: run tests
command: tox -e {{ tox_env }}
Expand All @@ -48,22 +48,25 @@ workflows:
# !!! WARNING !!!
""")

# Maps tox python versions (ex, "py27") to Travis Python versions (ex, "2.7")
# Maps tox python versions (ex, "py27") to CircleCI Python versions (ex, "2.7")
py_version_map = {
"py26": "2.6",
"py27": "2.7",
"py35": "3.5",
"py36": "3.6",
"py37": "3.7",
"py38": "3.8",
"py39": "3.9-rc",
"pypy": "pypy",
"py39": "3.9",
"py310": "3.10",
"py311": "3.11",
"pypy3": "pypy3",
}

def main():
env_list_str = sp.check_output("tox --listenvs", shell=True).splitlines()
env_list_bytes = sp.check_output("tox --listenvs", shell=True).splitlines()
env_list = []
for env in env_list_str:
for env_bytes in env_list_bytes:
env = env_bytes.decode("utf-8")
if not env.strip():
continue
py_ver, _, _ = env.partition("-")
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[tox]
envlist=py{27,35,36,py}-{nose,nose2,pytest2,pytest3,unit,unit2},py{37,38,39,310,311}-{nose,nose2,pytest3,unit,unit2}
# NOTE: when adding Python versions, also update and re-run `./rebuild-circleci-yaml`
envlist=pypy3-{nose,nose2,pytest3,unit,unit2},py{37,38,39}-{nose,nose2,pytest3,unit,unit2},py{310,311}-{unit,nose2}

[testenv]
deps=
nose
Expand All @@ -16,4 +18,4 @@ commands=
pytest3: py.test parameterized/test.py
#pytest4: py.test parameterized/test.py
unit: python -m unittest parameterized.test
unit2: unit2 parameterized.test
unit2: unit2 parameterized.test