Skip to content

Commit 162a7f9

Browse files
authored
build(deps-dev): bump ruff to 0.6.4 & update CI (#87)
* build(deps-dev): bump ruff to 0.6.4 * docs(makefile): update make commands * ci(github): update CI orchestration * style(ruff): fix lint * style(pre-commit): update precommit config * style(ci): fix precommit hooks
1 parent 2dc4d3d commit 162a7f9

24 files changed

+272
-251
lines changed

.github/collect_env.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,13 @@ def get_nvidia_smi():
159159
def get_platform():
160160
if sys.platform.startswith("linux"):
161161
return "linux"
162-
elif sys.platform.startswith("win32"):
162+
if sys.platform.startswith("win32"):
163163
return "win32"
164-
elif sys.platform.startswith("cygwin"):
164+
if sys.platform.startswith("cygwin"):
165165
return "cygwin"
166-
elif sys.platform.startswith("darwin"):
166+
if sys.platform.startswith("darwin"):
167167
return "darwin"
168-
else:
169-
return sys.platform
168+
return sys.platform
170169

171170

172171
def get_mac_version(run_lambda):

.github/dependabot.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "monthly"
12+
time: "06:00"
13+
timezone: "Europe/Paris"
14+
groups:
15+
gh-actions:
16+
patterns:
17+
- "*"
18+
reviewers:
19+
- "frgfm"
20+
assignees:
21+
- "frgfm"
22+
- package-ecosystem: "pip"
23+
directory: "/"
24+
schedule:
25+
interval: "daily"
26+
time: "06:00"
27+
timezone: "Europe/Paris"
28+
reviewers:
29+
- "frgfm"
30+
assignees:
31+
- "frgfm"
32+
allow:
33+
- dependency-name: "ruff"
34+
- dependency-name: "mypy"
35+
- dependency-name: "pre-commit"

.github/labeler.yml

+33-14
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
11
'module: crawler':
2-
- torchscan/crawler.py
2+
- changed-files:
3+
- any-glob-to-any-file: torchscan/crawler.py
34

45
'module: modules':
5-
- torchscan/modules/*
6+
- changed-files:
7+
- any-glob-to-any-file: torchscan/modules/*
68

79
'module: process':
8-
- torchscan/process/*
10+
- changed-files:
11+
- any-glob-to-any-file: torchscan/process/*
912

1013
'module: utils':
11-
- torchscan/utils.py
14+
- changed-files:
15+
- any-glob-to-any-file: torchscan/utils.py
1216

1317
'ext: docs':
14-
- docs/*
18+
- changed-files:
19+
- any-glob-to-any-file: docs/*
1520

1621
'ext: scripts':
17-
- scripts/*
22+
- changed-files:
23+
- any-glob-to-any-file: scripts/*
1824

1925
'ext: tests':
20-
- tests/*
26+
- changed-files:
27+
- any-glob-to-any-file: tests/*
2128

2229
'topic: ci':
23-
- .github/*
24-
25-
'topic: documentation':
26-
- README.md
27-
- CONTRIBUTING.md
30+
- changed-files:
31+
- any-glob-to-any-file: .github/*
32+
33+
'topic: docs':
34+
- changed-files:
35+
- any-glob-to-any-file:
36+
- README.md
37+
- CONTRIBUTING.md
38+
- CODFE_OF_CONDUCT.md
39+
- CITATION.cff
40+
- LICENSE
2841

2942
'topic: build':
30-
- setup.py
31-
- pyproject.toml
43+
- changed-files:
44+
- any-glob-to-any-file:
45+
- setup.py
46+
- pyproject.toml
47+
48+
'topic: style':
49+
- changed-files:
50+
- any-glob-to-any-file: .pre-commit-config.yaml

.github/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ changelog:
99
# NEW FEATURES
1010
- title: New Features 🚀
1111
labels:
12-
- "type: new feature"
12+
- "type: feat"
1313
# BUG FIXES
1414
- title: Bug Fixes 🐛
1515
labels:
16-
- "type: bug"
16+
- "type: fix"
1717
# IMPROVEMENTS
1818
- title: Improvements
1919
labels:
20-
- "type: enhancement"
20+
- "type: improvement"
2121
# MISC
2222
- title: Miscellaneous
2323
labels:

.github/verify_labels.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def parse_args():
7474
)
7575

7676
parser.add_argument("pr", type=int, help="PR number")
77-
args = parser.parse_args()
78-
79-
return args
77+
return parser.parse_args()
8078

8179

8280
if __name__ == "__main__":

.github/workflows/builds.yml

+20-24
Original file line numberDiff line numberDiff line change
@@ -13,55 +13,51 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
16-
python: [3.8, 3.9, '3.10', 3.11]
16+
python: [3.8, 3.9, '3.10', 3.11, 3.12]
17+
exclude:
18+
- os: macos-latest
19+
python: 3.8
20+
- os: macos-latest
21+
python: 3.9
22+
- os: macos-latest
23+
python: '3.10'
1724
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-python@v4
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
2027
with:
2128
python-version: ${{ matrix.python }}
2229
architecture: x64
23-
- name: Cache python modules
24-
uses: actions/cache@v2
25-
with:
26-
path: ~/.cache/pip
27-
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-build
2830
- name: Install package
2931
run: |
30-
python -m pip install --upgrade pip
31-
pip install -e .
32+
python -m pip install --upgrade uv
33+
uv pip install --system -e .
3234
- name: Import package
3335
run: python -c "import torchscan; print(torchscan.__version__)"
3436

3537
pypi:
3638
runs-on: ubuntu-latest
3739
steps:
38-
- uses: actions/checkout@v2
39-
- name: Set up Python
40-
uses: actions/setup-python@v4
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
4142
with:
42-
python-version: 3.9
43+
python-version: 3.11
4344
architecture: x64
44-
- name: Cache python modules
45-
uses: actions/cache@v2
46-
with:
47-
path: ~/.cache/pip
48-
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-build
4945
- name: Install dependencies
5046
run: |
51-
python -m pip install --upgrade pip
52-
pip install setuptools wheel twine --upgrade
47+
python -m pip install --upgrade uv
48+
uv pip install --system setuptools wheel twine --upgrade
5349
- run: |
5450
python setup.py sdist bdist_wheel
5551
twine check dist/*
5652
5753
conda:
5854
runs-on: ubuntu-latest
5955
steps:
60-
- uses: actions/checkout@v2
61-
- uses: conda-incubator/setup-miniconda@v2
56+
- uses: actions/checkout@v4
57+
- uses: conda-incubator/setup-miniconda@v3
6258
with:
6359
auto-update-conda: true
64-
python-version: "3.9"
60+
python-version: "3.11"
6561
- name: Install dependencies
6662
shell: bash -el {0}
6763
run: conda install -y conda-build conda-verify

.github/workflows/doc-status.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jobs:
66
see-page-build-payload:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/setup-python@v4
9+
- uses: actions/setup-python@v5
1010
with:
11-
python-version: 3.9
11+
python-version: 3.11
1212
architecture: x64
1313
- name: check status
1414
run: |

.github/workflows/docs.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,17 @@ jobs:
1111
os: [ubuntu-latest]
1212
python: [3.9]
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
with:
1616
persist-credentials: false
17-
- uses: actions/setup-python@v4
17+
- uses: actions/setup-python@v5
1818
with:
1919
python-version: ${{ matrix.python }}
2020
architecture: x64
21-
- name: Cache python modules
22-
uses: actions/cache@v2
23-
with:
24-
path: ~/.cache/pip
25-
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-docs
2621
- name: Install dependencies
2722
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e ".[docs]"
23+
python -m pip install --upgrade uv
24+
uv pip install --system -e ".[docs]"
3025
3126
- name: Build documentation
3227
run: cd docs && bash build.sh
@@ -35,12 +30,12 @@ jobs:
3530
run: test -e docs/build/index.html || exit
3631

3732
- name: Install SSH Client 🔑
38-
uses: webfactory/ssh-agent@v0.4.1
33+
uses: webfactory/ssh-agent@v0.9.0
3934
with:
4035
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
4136

4237
- name: Deploy to Github Pages
43-
uses: JamesIves/github-pages-deploy-action@3.7.1
38+
uses: JamesIves/github-pages-deploy-action@4
4439
with:
4540
BRANCH: gh-pages
4641
FOLDER: 'docs/build'

.github/workflows/pr-labels.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ jobs:
1010
if: github.event.pull_request.merged == true
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v2
15-
- name: Set up python
16-
uses: actions/setup-python@v4
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
1715
- name: Install requests
1816
run: pip install requests
1917
- name: Process commit and find merger responsible for labeling
2018
id: commit
2119
run: echo "::set-output name=merger::$(python .github/verify_labels.py ${{ github.event.pull_request.number }})"
2220
- name: Comment PR
23-
uses: actions/github-script@0.3.0
21+
uses: actions/github-script@7.0.1
2422
if: ${{ steps.commit.outputs.merger != '' }}
2523
with:
2624
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

+13-18
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@ jobs:
99
if: "!github.event.release.prerelease"
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v4
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1414
with:
15-
python-version: 3.9
15+
python-version: 3.11
1616
architecture: x64
17-
- name: Cache python modules
18-
uses: actions/cache@v2
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-pypi
2217
- name: Install dependencies
2318
run: |
24-
python -m pip install --upgrade pip
25-
pip install setuptools wheel twine --upgrade
19+
python -m pip install --upgrade uv
20+
uv pip install --system setuptools wheel twine --upgrade
2621
- name: Build and publish
2722
env:
2823
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
@@ -38,27 +33,27 @@ jobs:
3833
runs-on: ubuntu-latest
3934
needs: pypi
4035
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-python@v4
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-python@v5
4338
with:
44-
python-version: 3.9
39+
python-version: 3.11
4540
architecture: x64
4641
- name: Install package
4742
run: |
48-
python -m pip install --upgrade pip
49-
pip install torchscan
43+
python -m pip install --upgrade uv
44+
uv pip install --system torchscan
5045
python -c "import torchscan; print(torchscan.__version__)"
5146
5247
conda:
5348
if: "!github.event.release.prerelease"
5449
runs-on: ubuntu-latest
5550
steps:
56-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v4
5752
- name: Miniconda setup
5853
uses: conda-incubator/setup-miniconda@v3
5954
with:
6055
auto-update-conda: true
61-
python-version: 3.9
56+
python-version: 3.11
6257
- name: Install dependencies
6358
shell: bash -el {0}
6459
run: conda install -y conda-build conda-verify anaconda-client
@@ -83,7 +78,7 @@ jobs:
8378
uses: conda-incubator/setup-miniconda@v3
8479
with:
8580
auto-update-conda: true
86-
python-version: 3.9
81+
python-version: 3.11
8782
auto-activate-base: true
8883
- name: Install package
8984
shell: bash -el {0}

.github/workflows/pull_requests.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@ jobs:
88
docs:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v4
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
1413
with:
1514
python-version: 3.9
1615
architecture: x64
17-
- name: Cache python modules
18-
uses: actions/cache@v2
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-docs
2216
- name: Install dependencies
2317
run: |
24-
python -m pip install --upgrade pip
25-
pip install -e ".[docs]"
18+
python -m pip install --upgrade uv
19+
uv pip install --system -e ".[docs]"
2620
2721
- name: Build documentation
2822
run: cd docs && bash build.sh

0 commit comments

Comments
 (0)