Skip to content

Commit b45d065

Browse files
Ben Jefferymergify[bot]
authored andcommitted
Remove 3.7 and update pre-commit to 3.8
1 parent 25116f6 commit b45d065

22 files changed

+57
-55
lines changed

.github/workflows/docker/shared.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ PYTHON_VERSIONS=(
33
cp310-cp310
44
cp39-cp39
55
cp38-cp38
6-
cp37-cp37m
76
)

.github/workflows/wheels.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: macos-latest
1616
strategy:
1717
matrix:
18-
python: [3.7, 3.8, 3.9, "3.10", 3.11]
18+
python: [3.8, 3.9, "3.10", 3.11]
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v2
@@ -55,7 +55,7 @@ jobs:
5555
runs-on: windows-latest
5656
strategy:
5757
matrix:
58-
python: [3.7, 3.8, 3.9, "3.10", 3.11]
58+
python: [3.8, 3.9, "3.10", 3.11]
5959
wordsize: [64]
6060
steps:
6161
- name: Checkout
@@ -140,7 +140,7 @@ jobs:
140140
runs-on: macos-latest
141141
strategy:
142142
matrix:
143-
python: [3.7, 3.8, 3.9, "3.10", 3.11]
143+
python: [3.8, 3.9, "3.10", 3.11]
144144
steps:
145145
- name: Download wheels
146146
uses: actions/download-artifact@v2
@@ -162,7 +162,7 @@ jobs:
162162
runs-on: windows-latest
163163
strategy:
164164
matrix:
165-
python: [3.7, 3.8, 3.9, "3.10", 3.11]
165+
python: [3.8, 3.9, "3.10", 3.11]
166166
wordsize: [64]
167167
steps:
168168
- name: Download wheels
@@ -186,10 +186,9 @@ jobs:
186186
needs: ['manylinux']
187187
strategy:
188188
matrix:
189-
python: [3.7, 3.8, 3.9, "3.10", 3.11]
189+
python: [3.8, 3.9, "3.10", 3.11]
190190
include:
191-
- python: 3.7
192-
wheel: cp37
191+
193192
- python: 3.8
194193
wheel: cp38
195194
- python: 3.9

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-merge-conflict
66
- id: debug-statements
@@ -18,29 +18,29 @@ repos:
1818
exclude: dev-tools|examples
1919
verbose: true
2020
- repo: https://github.com/asottile/reorder_python_imports
21-
rev: v3.9.0
21+
rev: v3.12.0
2222
hooks:
2323
- id: reorder-python-imports
2424
args: [--application-directories=python,
2525
--unclassifiable-application-module=_tskit]
2626
- repo: https://github.com/asottile/pyupgrade
27-
rev: v3.2.2
27+
rev: v3.15.0
2828
hooks:
2929
- id: pyupgrade
30-
args: [--py3-plus, --py37-plus]
30+
args: [--py3-plus, --py38-plus]
3131
- repo: https://github.com/psf/black
32-
rev: 22.10.0
32+
rev: 23.9.1
3333
hooks:
3434
- id: black
3535
language_version: python3
3636
- repo: https://github.com/pycqa/flake8
37-
rev: 5.0.4
37+
rev: 6.1.0
3838
hooks:
3939
- id: flake8
4040
args: [--config=python/.flake8]
41-
additional_dependencies: ["flake8-bugbear==22.10.27", "flake8-builtins==2.0.1"]
41+
additional_dependencies: ["flake8-bugbear==23.9.16", "flake8-builtins==2.1.0"]
4242
- repo: https://github.com/asottile/blacken-docs
43-
rev: v1.12.1
43+
rev: 1.16.0
4444
hooks:
4545
- id: blacken-docs
4646
args: [--skip-errors]

docs/development.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ an overview of how to contribute a new feature to `tskit`.
7171
### Requirements
7272

7373
To develop the Python code you will need a working C compiler and a
74-
development installation of Python (>= 3.7). On Debian/Ubuntu we can install these
74+
development installation of Python (>= 3.8). On Debian/Ubuntu we can install these
7575
with:
7676

7777
```bash
@@ -429,7 +429,7 @@ $ make
429429

430430
If this has completed successfully you should see a file `_tskit.cpython-XXXXXX.so`
431431
in the current directory (the suffix depends on your platform and Python version;
432-
with Python 3.7 on Linux it's `_tskit.cpython-37m-x86_64-linux-gnu.so`).
432+
with Python 3.11 on Linux it's `_tskit.cpython-311-x86_64-linux-gnu.so`).
433433

434434
To make sure that your development environment is working, run some
435435
{ref}`tests <sec_development_python_tests>`.
@@ -1050,10 +1050,10 @@ For instance:
10501050

10511051
```bash
10521052
> git commit -a -m 'fixed all the things'
1053-
/usr/bin/env: ‘python3.7’: No such file or directory
1053+
/usr/bin/env: ‘python3.8’: No such file or directory
10541054
```
10551055

1056-
What the heck? Why is this even looking for python3.7?
1056+
What the heck? Why is this even looking for python3.8?
10571057
This is because of the "pre-commit hook", mentioned above.
10581058
As above, you can proceed by just appending `--no-verify`:
10591059

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ so it may already be installed if you use such software.
3232

3333
## Requirements
3434

35-
Tskit requires Python 3.7+. There are no external C library dependencies. Python
35+
Tskit requires Python 3.8+. There are no external C library dependencies. Python
3636
dependencies are installed automatically by `pip` or `conda`.
3737

3838
(sec_installation_conda)=

python/CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
[0.5.6] - 2023-XX-XX
33
--------------------
44

5+
**Breaking Changes**
6+
7+
- tskit now requires Python 3.8, as Python 3.7 became end-of-life on 2023-06-27
8+
59
**Features**
610

711
- Tree.trmca now accepts >2 nodes and returns nicer errors

python/setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ classifiers =
1616
Programming Language :: C
1717
Programming Language :: Python
1818
Programming Language :: Python :: 3
19-
Programming Language :: Python :: 3.7
2019
Programming Language :: Python :: 3.8
2120
Programming Language :: Python :: 3.9
2221
Programming Language :: Python :: 3.10
@@ -46,7 +45,7 @@ platforms =
4645

4746
[options]
4847
packages = tskit
49-
python_requires = >=3.7
48+
python_requires = >=3.8
5049
include_package_data = True
5150
install_requires =
5251
jsonschema>=3.0.0

python/tests/simplify.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ def flush_edges(self):
725725
return num_edges
726726

727727
def check_state(self):
728-
729728
num_nodes = len(self.A_head)
730729
for j in range(num_nodes):
731730
head = self.A_head[j]
@@ -771,7 +770,6 @@ def print_state(self):
771770
ts = tskit.load(sys.argv[2])
772771

773772
if class_to_implement == "Simplifier":
774-
775773
samples = list(map(int, sys.argv[3:]))
776774

777775
print("When keep_unary = True:")
@@ -805,7 +803,6 @@ def print_state(self):
805803
print(tables.mutations)
806804

807805
elif class_to_implement == "AncestorMap":
808-
809806
samples = sys.argv[3]
810807
samples = samples.split(",")
811808
samples = list(map(int, samples))

python/tests/test_file_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def test_unsupported_version(self):
487487
# Cannot read current files.
488488
ts.dump(self.temp_file)
489489
# Catch Exception here because h5py throws different exceptions on py2 and py3
490-
with pytest.raises(Exception):
490+
with pytest.raises(Exception): # noqa B017
491491
tskit.load_legacy(self.temp_file)
492492

493493
def test_no_version_number(self):

python/tests/test_highlevel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def insert_gap(ts, position, length):
207207
return tables.tree_sequence()
208208

209209

210-
@functools.lru_cache()
210+
@functools.lru_cache
211211
def get_gap_examples():
212212
"""
213213
Returns example tree sequences that contain gaps within the list of
@@ -239,7 +239,7 @@ def get_gap_examples():
239239
return ret
240240

241241

242-
@functools.lru_cache()
242+
@functools.lru_cache
243243
def get_internal_samples_examples():
244244
"""
245245
Returns example tree sequences with internal samples.
@@ -270,7 +270,7 @@ def get_internal_samples_examples():
270270
return ret
271271

272272

273-
@functools.lru_cache()
273+
@functools.lru_cache
274274
def get_decapitated_examples():
275275
"""
276276
Returns example tree sequences in which the oldest edges have been removed.

0 commit comments

Comments
 (0)