Skip to content

Commit ece6368

Browse files
mh-nguyen712mh-nguyen712
andauthored
Update python version to 3.10+ (deepinv#605)
* Export all changes: workflow updates, pyproject.toml changes to py>=310 * rm torch version dependency * update * changelog * py version as str * py version in lint * debug * debug py311 * torch27 * torch>=2.2.0 * save_path in n2n example * update python version in badge * merge main --------- Co-authored-by: mh-nguyen712 <[email protected]>
1 parent 67b4d37 commit ece6368

File tree

9 files changed

+53
-17
lines changed

9 files changed

+53
-17
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-python@v4
1717
with:
18-
python-version: '3.9'
18+
python-version: '3.10' # minimum supported version
1919
- uses: psf/black@stable
2020
- name: Install and run ruff
2121
run: |
2222
pip install ruff
23-
ruff check --target-version "py39" --select "UP006"
23+
ruff check --target-version "py310" --select "UP006"

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ jobs:
5050
- name: Set up Python
5151
uses: actions/setup-python@v5
5252
with:
53-
python-version: '3.9'
53+
python-version: '3.10' # minimum supported version
54+
cache: 'pip' # caching pip dependencies
5455

5556
- name: Install tools
5657
run: |

.github/workflows/test.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,32 @@ jobs:
2424
strategy:
2525
matrix:
2626
include:
27-
# Test with all dependencies
27+
# Ubuntu tests
2828
- os: ubuntu-latest
29-
version_python: 3.9
29+
version_python: "3.10"
3030
extra: dataset,denoisers,test
31-
name: "ubuntu all dependencies"
32-
# Test with all dependencies
31+
name: "ubuntu py3.10 all dependencies"
32+
- os: ubuntu-latest
33+
version_python: "3.11"
34+
extra: dataset,denoisers,test
35+
name: "ubuntu py3.11 all dependencies"
36+
- os: ubuntu-latest
37+
version_python: "3.12"
38+
extra: dataset,denoisers,test
39+
name: "ubuntu py3.12 all dependencies"
40+
# Windows tests
41+
- os: windows-latest
42+
version_python: "3.10"
43+
extra: dataset,denoisers,test
44+
name: "windows py3.10 all dependencies"
3345
- os: windows-latest
34-
version_python: 3.9
46+
version_python: "3.11"
3547
extra: dataset,denoisers,test
36-
name: "windows all dependencies"
48+
name: "windows py3.11 all dependencies"
49+
- os: windows-latest
50+
version_python: "3.12"
51+
extra: dataset,denoisers,test
52+
name: "windows py3.12 all dependencies"
3753
env:
3854
DEEPINV_MOCK_TESTS: "True"
3955
steps:
@@ -47,6 +63,17 @@ jobs:
4763
run: |
4864
pip install .[${{ matrix.extra }}]
4965
66+
# For debugging purposes
67+
- name: Check Python version
68+
run: python3 --version
69+
70+
- name: Check installed packages
71+
run: pip list
72+
73+
- name: Test importing numpy
74+
run: python3 -c "import numpy; print('NumPy version:', numpy.__version__)"
75+
# ----------------------------
76+
5077
- name: Test with pytest and generate coverage report
5178
run: |
5279
python3 -m pytest -n 2 --dist=loadgroup --cov=deepinv --junitxml=junit.xml -o junit_family=legacy -v

.github/workflows/upload_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.9'
21+
python-version: '3.10'
2222

2323
- name: Install tools
2424
run: |

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Changed
2929
- Make autograd use the base linear operator for `deepinv.physics.adjoint_function` (:gh:`519` by `Jérémy Scanvic`_)
3030
- Parallelize the test suite making it 15% faster (:gh:`522` by `Jérémy Scanvic`_)
3131
- Adjust backward paths for tomography (:gh:`535` by `Johannes Hertrich`_)
32+
- Update python version to 3.10+ (:gh:`605` by `Minh Hai Nguyen`_)
3233

3334
Fixed
3435
^^^^^

README.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ To install the latest stable release of ``deepinv``, you can simply do:
4242
4343
pip install deepinv
4444
45+
# or using uv for faster installation
46+
47+
uv pip install deepinv
48+
4549
You can also install the latest version of ``deepinv`` directly from github:
4650

4751
.. code-block:: bash
@@ -148,8 +152,8 @@ Star history
148152
:target: https://github.com/deepinv/deepinv/actions/workflows/test.yml
149153
.. |Docs Status| image:: https://github.com/deepinv/deepinv/actions/workflows/documentation.yml/badge.svg
150154
:target: https://github.com/deepinv/deepinv/actions/workflows/documentation.yml
151-
.. |Python Version| image:: https://img.shields.io/badge/python-3.9%2B-blue
152-
:target: https://www.python.org/downloads/release/python-390/
155+
.. |Python Version| image:: https://img.shields.io/badge/python-3.10%2B-blue
156+
:target: https://www.python.org/downloads/release/python-3100/
153157
.. |codecov| image:: https://codecov.io/gh/deepinv/deepinv/branch/main/graph/badge.svg?token=77JRvUhQzh
154158
:target: https://codecov.io/gh/deepinv/deepinv
155159
.. |pip install| image:: https://img.shields.io/pypi/dm/deepinv.svg?logo=pypi&label=pip%20install&color=fedcba

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ If you use DeepInverse in your research, please cite the following paper (availa
7878
:target: https://github.com/deepinv/deepinv/actions/workflows/test.yml
7979
.. |Docs Status| image:: https://github.com/deepinv/deepinv/actions/workflows/documentation.yml/badge.svg
8080
:target: https://github.com/deepinv/deepinv/actions/workflows/documentation.yml
81-
.. |Python Version| image:: https://img.shields.io/badge/python-3.9%2B-blue
82-
:target: https://www.python.org/downloads/release/python-390/
81+
.. |Python Version| image:: https://img.shields.io/badge/python-3.10%2B-blue
82+
:target: https://www.python.org/downloads/release/python-3100/
8383
.. |codecov| image:: https://codecov.io/gh/deepinv/deepinv/branch/main/graph/badge.svg?token=77JRvUhQzh
8484
:target: https://codecov.io/gh/deepinv/deepinv
8585
.. |pip install| image:: https://img.shields.io/pypi/dm/deepinv.svg?logo=pypi&label=pip%20install&color=fedcba

examples/self-supervised-learning/demo_n2n_denoising.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
# In this example, we use the MNIST dataset as the base image dataset.
5252
#
5353

54-
operation = "denoising"
54+
operation = "denoising_n2n"
5555
train_dataset_name = "MNIST"
5656

5757
transform = transforms.Compose([transforms.ToTensor()])

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ classifiers = [
1414
"License :: OSI Approved :: BSD License",
1515
"Operating System :: OS Independent",
1616
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
1720
"Topic :: Utilities",
1821
"Topic :: Scientific/Engineering",
1922
"Topic :: Software Development :: Libraries",
2023
]
21-
requires-python = ">=3.9"
24+
requires-python = ">=3.10"
2225
version = "0.3.2"
2326
dependencies = [
2427
"numpy",
2528
"matplotlib",
2629
"hdf5storage",
2730
"tqdm",
28-
"torch<2.7",
31+
"torch>=2.2.0",
2932
"torchvision",
3033
"torchmetrics",
3134
"einops",

0 commit comments

Comments
 (0)