Skip to content

Commit ee4a6b5

Browse files
authored
Merge pull request #340 from paquiteau/modopt-2024
Bringing Modopt to 2024's standards.
2 parents d37e1e4 + 8e277aa commit ee4a6b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+904
-1116
lines changed

.github/workflows/cd-build.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,28 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818

19-
- name: Set up Conda with Python 3.8
20-
uses: conda-incubator/setup-miniconda@v2
19+
- uses: actions/setup-python@v4
2120
with:
22-
auto-update-conda: true
23-
python-version: 3.8
24-
auto-activate-base: false
21+
python-version: "3.10"
22+
cache: pip
2523

2624
- name: Install dependencies
2725
shell: bash -l {0}
2826
run: |
2927
python -m pip install --upgrade pip
30-
python -m pip install -r develop.txt
3128
python -m pip install twine
32-
python -m pip install .
29+
python -m pip install .[doc,test]
3330
3431
- name: Run Tests
3532
shell: bash -l {0}
3633
run: |
37-
python setup.py test
34+
pytest
3835
3936
- name: Check distribution
4037
shell: bash -l {0}
4138
run: |
42-
python setup.py sdist
4339
twine check dist/*
4440
4541
- name: Upload coverage to Codecov
@@ -57,20 +53,15 @@ jobs:
5753

5854
steps:
5955
- name: Checkout
60-
uses: actions/checkout@v2
56+
uses: actions/checkout@v4
6157

62-
- name: Set up Conda with Python 3.8
63-
uses: conda-incubator/setup-miniconda@v2
64-
with:
65-
python-version: "3.8"
6658

6759
- name: Install dependencies
6860
shell: bash -l {0}
6961
run: |
7062
conda install -c conda-forge pandoc
7163
python -m pip install --upgrade pip
72-
python -m pip install -r docs/requirements.txt
73-
python -m pip install .
64+
python -m pip install .[doc]
7465
7566
- name: Build API documentation
7667
shell: bash -l {0}

.github/workflows/ci-build.yml

Lines changed: 11 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,41 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ubuntu-latest, macos-latest]
19-
python-version: ["3.10"]
19+
python-version: ["3.8", "3.9", "3.10"]
2020

2121
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v2
24-
25-
- name: Set up Conda with Python ${{ matrix.python-version }}
26-
uses: conda-incubator/setup-miniconda@v2
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v4
2724
with:
28-
auto-update-conda: true
2925
python-version: ${{ matrix.python-version }}
30-
auto-activate-base: false
31-
32-
- name: Check Conda
33-
shell: bash -l {0}
34-
run: |
35-
conda info
36-
conda list
37-
python --version
26+
cache: pip
3827

3928
- name: Install Dependencies
4029
shell: bash -l {0}
4130
run: |
4231
python --version
4332
python -m pip install --upgrade pip
44-
python -m pip install -r develop.txt
45-
python -m pip install -r docs/requirements.txt
46-
python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib
47-
python -m pip install tensorflow>=2.4.1
48-
python -m pip install twine
49-
python -m pip install .
33+
python -m pip install .[test]
34+
python -m pip install astropy scikit-image scikit-learn matplotlib
35+
python -m pip install tensorflow>=2.4.1 torch
5036
5137
- name: Run Tests
5238
shell: bash -l {0}
5339
run: |
54-
export PATH=/usr/share/miniconda/bin:$PATH
5540
pytest -n 2
5641
5742
- name: Save Test Results
5843
if: always()
59-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
6045
with:
6146
name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }}
62-
path: pytest.xml
63-
64-
- name: Check Distribution
65-
shell: bash -l {0}
66-
run: |
67-
python setup.py sdist
68-
twine check dist/*
47+
path: coverage.xml
6948

7049
- name: Check API Documentation build
7150
shell: bash -l {0}
7251
run: |
73-
conda install -c conda-forge pandoc
52+
apt install pandoc
53+
pip install .[doc] ipykernel
7454
sphinx-apidoc -t docs/_templates -feTMo docs/source modopt
7555
sphinx-build -b doctest -E docs/source docs/_build
7656
@@ -81,38 +61,3 @@ jobs:
8161
file: coverage.xml
8262
flags: unittests
8363

84-
test-basic:
85-
name: Basic Test Suite
86-
runs-on: ${{ matrix.os }}
87-
88-
strategy:
89-
fail-fast: false
90-
matrix:
91-
os: [ubuntu-latest, macos-latest]
92-
python-version: ["3.7", "3.8", "3.9"]
93-
94-
steps:
95-
- name: Checkout
96-
uses: actions/checkout@v2
97-
98-
- name: Set up Conda with Python ${{ matrix.python-version }}
99-
uses: conda-incubator/setup-miniconda@v2
100-
with:
101-
auto-update-conda: true
102-
python-version: ${{ matrix.python-version }}
103-
auto-activate-base: false
104-
105-
- name: Install Dependencies
106-
shell: bash -l {0}
107-
run: |
108-
python --version
109-
python -m pip install --upgrade pip
110-
python -m pip install -r develop.txt
111-
python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib
112-
python -m pip install .
113-
114-
- name: Run Tests
115-
shell: bash -l {0}
116-
run: |
117-
export PATH=/usr/share/miniconda/bin:$PATH
118-
pytest -n 2

.github/workflows/style.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Style checking
2+
3+
on:
4+
push:
5+
branches: [ "master", "main", "develop" ]
6+
pull_request:
7+
branches: [ "master", "main", "develop" ]
8+
9+
workflow_dispatch:
10+
11+
env:
12+
PYTHON_VERSION: "3.10"
13+
14+
jobs:
15+
linter-check:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Set up Python ${{ env.PYTHON_VERSION }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ env.PYTHON_VERSION }}
24+
cache: pip
25+
26+
- name: Install Python deps
27+
shell: bash
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install -e .[test,dev]
31+
32+
- name: Black Check
33+
shell: bash
34+
run: black . --diff --color --check
35+
36+
- name: ruff Check
37+
shell: bash
38+
run: ruff check

.pylintrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.pyup.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

develop.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)