Skip to content

Commit d51e906

Browse files
authored
Bump required Python 3.7 -> 3.8, drop TF1 support (#1668)
Closes #1326
1 parent 6e8de68 commit d51e906

File tree

9 files changed

+33
-27
lines changed

9 files changed

+33
-27
lines changed

.github/workflows/black.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.7
20+
python-version: 3.8
2121
cache: 'pip'
2222
cache-dependency-path: '.github/workflows/black.yml'
2323
- run: pip install black==22.3.0

.github/workflows/main.yml

+6-18
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
fail-fast: false
9393
matrix:
9494
python-version:
95-
- 3.7
95+
- 3.8
9696
action:
9797
- TEST=Dataset
9898
- TEST=fork_exec
@@ -158,7 +158,7 @@ jobs:
158158
fail-fast: false
159159
matrix:
160160
python-version:
161-
- 3.7
161+
- 3.8
162162
tf-version:
163163
- 2.10.0
164164
action:
@@ -174,23 +174,11 @@ jobs:
174174
- TEST=TFUtil
175175
- TEST=tools
176176
include:
177-
- action: TEST=TFUtil
178-
python-version: 3.7
179-
tf-version: 1.15.3
180177
- action: TEST=TFEngine
181-
python-version: 3.7
182-
tf-version: 1.15.3
183-
- action: TEST=TFEngine
184-
python-version: 3.7
178+
python-version: 3.8
185179
tf-version: 2.3.0
186-
- action: TEST=TFNativeOp
187-
python-version: 3.7
188-
tf-version: 1.14.0
189-
- action: TEST=TFNetworkSigProcLayer
190-
python-version: 3.7
191-
tf-version: 1.15.3
192180
- action: TEST=demos RETURNN_DISABLE_TORCH=1
193-
python-version: 3.7
181+
python-version: 3.8
194182
tf-version: 2.3.0
195183

196184
steps:
@@ -221,7 +209,7 @@ jobs:
221209
222210
pip install --user pytest
223211
224-
if [[ "${{matrix.tf-version}}" == 2.[0123].* || "${{matrix.tf-version}}" == 1.* ]]; then
212+
if [[ "${{matrix.tf-version}}" == 2.[0123].* ]]; then
225213
# Older TF needs older NumPy version.
226214
# https://github.com/rwth-i6/returnn/pull/1160#issuecomment-1284537803
227215
pip install --user numpy==1.19.5
@@ -358,7 +346,7 @@ jobs:
358346
include:
359347
# Some selected tests (but not all) with some other versions.
360348
- action: TEST=rf_base
361-
python-version: 3.7
349+
python-version: 3.8
362350
torch-version: 1.13.1
363351
tf-version: 2.10.0
364352

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- uses: actions/setup-python@v5
2828
with:
29-
python-version: 3.7
29+
python-version: 3.8
3030

3131
- name: Install Python deps
3232
run: |

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ or any changes which could potentially break or change the behavior of existing
66
This is intentionally kept short. For a full change log, just see the Git log.
77

88

9+
## 2024-12-13: Bump min Python version from 3.7 to 3.8 ([issue #1326](https://github.com/rwth-i6/returnn/issues/1326))
10+
11+
This also drops support for TF 1.x.
12+
913
## 2024-06-07: `VariableDataset`
1014

1115
Custom subdataset per subepoch based on user-provided function.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ General rules when contributing to the code of RETURNN:
2929
and in general to use newer TF features (even maybe TF >=2),
3030
as long as your new feature (new layer or so) is just optional.
3131
For older TF support, `TFCompat.py` might be helpful. (See code for examples.)
32-
* We support Python >=3.7 ([discussion](https://github.com/rwth-i6/returnn/issues/487)).
32+
* We support Python >=3.8 ([discussion](https://github.com/rwth-i6/returnn/issues/1326)).
3333

3434
About new features:
3535

README.rst

+12
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,15 @@ Questions can also be asked on
7272

7373
.. image:: https://github.com/rwth-i6/returnn/workflows/CI/badge.svg
7474
:target: https://github.com/rwth-i6/returnn/actions
75+
76+
Dependencies
77+
============
78+
79+
pip dependencies are listed in ``requirements.txt`` and ``requirements-dev``,
80+
although some parts of the code may require additional dependencies (e.g. ``librosa``, ``resampy``) on-demand.
81+
82+
RETURNN supports Python >= 3.8. Bumps to the minimum Python version are listed in `CHANGELOG.md <https://github.com/rwth-i6/returnn/blob/master/CHANGELOG.md>`__.
83+
84+
TensorFlow-based setups require TensorFlow >= 2.2.
85+
86+
PyTorch-based setups require Torch >= 1.0.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 120
3-
target-version = ["py37"] # https://github.com/rwth-i6/returnn/issues/487
3+
target-version = ["py38"] # https://github.com/rwth-i6/returnn/issues/1326
44
extend-exclude = '''
55
/(
66
# All Git submodules, see .gitmodules.

tests/PyCharm.idea/inspectionProfiles/Project_Default.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
55
<option name="ourVersions">
66
<value>
7-
<list size="3">
8-
<item index="0" class="java.lang.String" itemvalue="3.7" />
9-
<item index="1" class="java.lang.String" itemvalue="3.8" />
10-
<item index="2" class="java.lang.String" itemvalue="3.9" />
7+
<list size="2">
8+
<item index="0" class="java.lang.String" itemvalue="3.8" />
9+
<item index="1" class="java.lang.String" itemvalue="3.9" />
1110
</list>
1211
</value>
1312
</option>

tests/test_Log.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ def filter_out(ls):
5252
i = 0
5353
while i < len(ls):
5454
s = ls[i]
55-
if "tensorflow/core/" in s or "tensorflow/stream_executor/" in s: # some TF warnings
55+
if any(f"{l} tensorflow/" in s for l in "IWE"): # some TF warnings
5656
i += 1
5757
continue
58+
elif "SyntaxWarning" in s:
59+
i += 2
60+
continue
5861
# RuntimeWarning|FutureWarning are warnings and they include the code-line in the next output line
5962
if i + 1 < len(ls) and ls[i + 1].startswith(" "):
6063
if re.match(".*:\\d+: RuntimeWarning: numpy.*", s) or re.match(".*:\\d+: FutureWarning: .*", s):

0 commit comments

Comments
 (0)