Skip to content

Commit

Permalink
Merge pull request #36 from nicoddemus/update-required-python
Browse files Browse the repository at this point in the history
Drop Python 3.6 and 3.7 support
  • Loading branch information
nicoddemus committed Apr 30, 2024
2 parents 9a2b99f + 75ff506 commit 4063b7b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 44 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-latest, windows-latest]
exclude: # Apple Silicon ARM64 does not support Python < v3.8
- python-version: "3.6"
os: macos-latest
- python-version: "3.7.7"
os: macos-latest
include: # So run those legacy versions on Intel CPUs
- python-version: "3.6"
os: macos-13
- python-version: "3.7.7"
os: macos-13
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Next Release
CHANGELOG
============

See `Releases <https://github.com/pytest-dev/nose2pytest/releases>`__ for the changelog of each version.
39 changes: 16 additions & 23 deletions nose2pytest/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,22 @@ def decorator(func):

py_grammar_symbols = pygram.python_grammar.symbol2number

# the first item of each triplet below is a number generated by the grammar driver, so depends on
# version of Python used to run the script; they are used by has_weak_op_for_comparison(), put breakpoint
# at "if symbol":
if sys.version_info.minor in [5, 6, 7, 8, 9, 10, 11]:
GRAM_SYM = py_grammar_symbols['comparison']
COMP_OP = py_grammar_symbols['comp_op']
MEMBERSHIP_SYMBOLS = (
(GRAM_SYM, 1, 'in'),
(GRAM_SYM, COMP_OP, 'not in')
)
IDENTITY_SYMBOLS = (
(GRAM_SYM, 1, 'is'),
(GRAM_SYM, COMP_OP, 'is not')
)
BOOLEAN_OPS = (
(py_grammar_symbols['not_test'], 1, 'not'),
(py_grammar_symbols['and_test'], 1, 'and'),
(py_grammar_symbols['or_test'], 1, 'or')
)
GENERATOR_TYPE = py_grammar_symbols['argument']

else:
raise RuntimeError('nose2pytest must be run using Python 3.5 to 3.11')
GRAM_SYM = py_grammar_symbols['comparison']
COMP_OP = py_grammar_symbols['comp_op']
MEMBERSHIP_SYMBOLS = (
(GRAM_SYM, 1, 'in'),
(GRAM_SYM, COMP_OP, 'not in')
)
IDENTITY_SYMBOLS = (
(GRAM_SYM, 1, 'is'),
(GRAM_SYM, COMP_OP, 'is not')
)
BOOLEAN_OPS = (
(py_grammar_symbols['not_test'], 1, 'not'),
(py_grammar_symbols['and_test'], 1, 'and'),
(py_grammar_symbols['or_test'], 1, 'or')
)
GENERATOR_TYPE = py_grammar_symbols['argument']

# these operators require parens around function arg if binop is + or -
ADD_SUB_GROUP_TOKENS = (
Expand Down
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
install_requires=[
'fissix',
],
python_requires='>=3.6',
python_requires='>=3.8,<3.12',
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',

# Indicate who your project is intended for
Expand All @@ -38,8 +34,6 @@
'License :: OSI Approved :: BSD License',

# Specify the Python versions you support here.
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36, 37, 38, 39, 310, 311}
envlist = py{38, 39, 310, 311}

[testenv]
deps =
Expand Down

0 comments on commit 4063b7b

Please sign in to comment.