Skip to content

Commit f5d6da9

Browse files
committed
Drop support for Python 3.8
1 parent 839145e commit f5d6da9

File tree

6 files changed

+48
-68
lines changed

6 files changed

+48
-68
lines changed

.github/workflows/build.yaml

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,52 @@ on:
44
push:
55
pull_request:
66
schedule:
7-
# run at 7:00 on the first of every month
8-
- cron: '0 7 1 * *'
7+
# run at 7:00 on the first of every month
8+
- cron: "0 7 1 * *"
99

1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
continue-on-error: ${{ matrix.python-version == 'pypy-3.8' }}
13+
continue-on-error: ${{ matrix.python-version == 'pypy-3.9' }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
python-version:
18-
- "3.8"
19-
- "3.9"
20-
- "3.10"
21-
- "3.11"
22-
- "3.12"
23-
- "3.13"
24-
- "pypy-3.8"
18+
- "3.9"
19+
- "3.10"
20+
- "3.11"
21+
- "3.12"
22+
- "3.13"
23+
- "pypy-3.9"
2524
steps:
26-
- uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 0
29-
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Install dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install -r requirements.txt
37-
pip install urwid twisted watchdog "jedi >=0.16" babel "sphinx >=1.5"
38-
pip install pytest pytest-cov numpy
39-
- name: Build with Python ${{ matrix.python-version }}
40-
run: |
41-
python setup.py build
42-
- name: Build documentation
43-
run: |
44-
python setup.py build_sphinx
45-
python setup.py build_sphinx_man
46-
- name: Test with pytest
47-
run: |
48-
pytest --cov=bpython --cov-report=xml -v
49-
- name: Upload coverage to Codecov
50-
uses: codecov/codecov-action@v5
51-
env:
52-
PYTHON_VERSION: ${{ matrix.python-version }}
53-
with:
54-
file: ./coverage.xml
55-
env_vars: PYTHON_VERSION
56-
if: ${{ always() }}
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
pip install urwid twisted watchdog "jedi >=0.16" babel "sphinx >=1.5"
37+
pip install pytest pytest-cov numpy
38+
- name: Build with Python ${{ matrix.python-version }}
39+
run: |
40+
python setup.py build
41+
- name: Build documentation
42+
run: |
43+
python setup.py build_sphinx
44+
python setup.py build_sphinx_man
45+
- name: Test with pytest
46+
run: |
47+
pytest --cov=bpython --cov-report=xml -v
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v5
50+
env:
51+
PYTHON_VERSION: ${{ matrix.python-version }}
52+
with:
53+
file: ./coverage.xml
54+
env_vars: PYTHON_VERSION
55+
if: ${{ always() }}

bpython/simpleeval.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@
3333
from . import line as line_properties
3434
from .inspection import getattr_safe
3535

36-
_is_py38 = sys.version_info[:2] >= (3, 8)
37-
_is_py39 = sys.version_info[:2] >= (3, 9)
38-
3936
_string_type_nodes = (ast.Str, ast.Bytes)
4037
_numeric_types = (int, float, complex)
41-
_name_type_nodes = (ast.Name,) if _is_py38 else (ast.Name, ast.NameConstant)
38+
_name_type_nodes = (ast.Name,)
4239

4340

4441
class EvaluationError(Exception):
@@ -91,10 +88,6 @@ def simple_eval(node_or_string, namespace=None):
9188
def _convert(node):
9289
if isinstance(node, ast.Constant):
9390
return node.value
94-
elif not _is_py38 and isinstance(node, _string_type_nodes):
95-
return node.s
96-
elif not _is_py38 and isinstance(node, ast.Num):
97-
return node.n
9891
elif isinstance(node, ast.Tuple):
9992
return tuple(map(_convert, node.elts))
10093
elif isinstance(node, ast.List):
@@ -168,18 +161,8 @@ def _convert(node):
168161
return left - right
169162

170163
# this is a deviation from literal_eval: we allow indexing
171-
elif (
172-
not _is_py39
173-
and isinstance(node, ast.Subscript)
174-
and isinstance(node.slice, ast.Index)
175-
):
176-
obj = _convert(node.value)
177-
index = _convert(node.slice.value)
178-
return safe_getitem(obj, index)
179-
elif (
180-
_is_py39
181-
and isinstance(node, ast.Subscript)
182-
and isinstance(node.slice, (ast.Constant, ast.Name))
164+
elif isinstance(node, ast.Subscript) and isinstance(
165+
node.slice, (ast.Constant, ast.Name)
183166
):
184167
obj = _convert(node.value)
185168
index = _convert(node.slice)

doc/sphinx/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ the time of day.
1717
Getting your development environment set up
1818
-------------------------------------------
1919

20-
bpython supports Python 3.8 and newer. The code is compatible with all
20+
bpython supports Python 3.9 and newer. The code is compatible with all
2121
supported versions.
2222

2323
Using a virtual environment is probably a good idea. Create a virtual

doc/sphinx/source/releases.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ A checklist to perform some manual tests before a release:
4545

4646
Check that all of the following work before a release:
4747

48-
* Runs under Python 3.8 - 3.11
48+
* Runs under Python 3.9 - 3.13
4949
* Save
5050
* Rewind
5151
* Pastebin

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
[build-system]
2-
requires = [
3-
"setuptools >= 62.4.0",
4-
]
2+
requires = ["setuptools >= 62.4.0"]
53
build-backend = "setuptools.build_meta"
64

75
[tool.black]
86
line-length = 80
9-
target_version = ["py38"]
7+
target_version = ["py39"]
108
include = '\.pyi?$'
119
exclude = '''
1210
/(

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ classifiers =
1414
Programming Language :: Python :: 3
1515

1616
[options]
17-
python_requires = >=3.8
17+
python_requires = >=3.9
1818
packages =
1919
bpython
2020
bpython.curtsiesfrontend

0 commit comments

Comments
 (0)