Skip to content

Commit 0283cf5

Browse files
authored
[Update] Lots of stuff (#448)
* update: codes * build(deps): dev deps * docs: v3.8.2 changelog * chore: disable warnings for pytest * build(ci): split tasks * fix: TypeAlias * update: Parameters type * build(deps): pytorch * update: test_version_utils * build(deps): pytorch * update: test cases * update: test cases * update: test cases * update: test cases * update: test cases * update: test cases * build(ci): refactor publish script * fix: test_version_utils * build(ci): remove `check lint`
1 parent 13ad3e8 commit 0283cf5

Some content is hidden

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

110 files changed

+1489
-1103
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,32 @@ on:
99
env:
1010
OMP_NUM_THREADS: 2
1111
MKL_NUM_THREADS: 2
12+
PYTHONDONTWRITEBYTECODE: 1
1213

1314
jobs:
15+
lint:
16+
name: Lint / Static Checks
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.12
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.12
25+
cache: 'pip'
26+
27+
- name: Install dev-dependencies
28+
run: pip --disable-pip-version-check install --no-compile -r requirements-dev.txt
29+
30+
- name: Run lint
31+
run: make check
32+
1433
test:
1534
runs-on: ubuntu-latest
1635
strategy:
1736
matrix:
18-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
37+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1938

2039
steps:
2140
- uses: actions/checkout@v4
@@ -29,20 +48,25 @@ jobs:
2948
- name: Install dev-dependencies
3049
run: pip --disable-pip-version-check install --no-compile -r requirements-dev.txt
3150

32-
- name: Check lint
33-
run: make check
34-
3551
- name: Check test
36-
env:
37-
PYTHONDONTWRITEBYTECODE: 1
3852
run: make test
3953

40-
- name: Check codecov
54+
- name: Upload coverage
55+
if: success()
4156
uses: codecov/codecov-action@v5
4257
with:
4358
token: ${{ secrets.CODECOV_TOKEN }}
4459
directory: ./
4560
files: ./coverage.xml
4661
env_vars: OS,PYTHON
62+
flags: ${{ matrix.python-version }}
4763
fail_ci_if_error: true
4864
verbose: false
65+
66+
ci-summary:
67+
if: always()
68+
needs: [lint, test]
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Report Summary
72+
run: echo "✅ Lint and tests completed for all targets"

.github/workflows/publish.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@ on:
66
- 'v*'
77

88
jobs:
9+
10+
get-version:
11+
name: Get Version
12+
runs-on: ubuntu-latest
13+
outputs:
14+
version: ${{ steps.extract.outputs.version }}
15+
steps:
16+
- name: Extract tag version
17+
id: extract
18+
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
19+
920
prepend-changelog:
1021
name: Prepend Change Log
1122
runs-on: ubuntu-latest
23+
needs: get-version
1224

1325
permissions:
1426
contents: write
@@ -18,38 +30,37 @@ jobs:
1830
- name: Checkout code
1931
uses: actions/checkout@v4
2032

21-
- name: Get the version
22-
id: get_version
23-
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
24-
2533
- name: Prepend changelog to CHANGELOG.md
2634
run: |
27-
VERSION="${{ steps.get_version.outputs.VERSION }}"
35+
VERSION="${{ needs.get-version.outputs.version }}"
2836
CHANGELOG_FILE="docs/changelogs/$VERSION.md"
29-
MAIN_CHANGELOG="CHANGELOG.md"
3037
3138
if [ ! -f "$CHANGELOG_FILE" ]; then
3239
echo "No changelog found for $VERSION"
3340
exit 1
3441
fi
3542
43+
MAIN_CHANGELOG="CHANGELOG.md"
3644
TMP_FILE=$(mktemp)
3745
38-
echo "# $VERSION" > "$TMP_FILE"
39-
echo "" >> "$TMP_FILE"
40-
cat "$CHANGELOG_FILE" >> "$TMP_FILE"
41-
echo "" >> "$TMP_FILE"
42-
cat "$MAIN_CHANGELOG" >> "$TMP_FILE"
46+
{
47+
echo "# $VERSION"
48+
echo
49+
cat "$CHANGELOG_FILE"
50+
echo
51+
cat "$MAIN_CHANGELOG"
52+
} > "$TMP_FILE"
53+
4354
mv "$TMP_FILE" "$MAIN_CHANGELOG"
4455
4556
- name: Create Pull Request
4657
id: create_pull_request
4758
uses: peter-evans/create-pull-request@v6
4859
with:
49-
branch: "docs/changelog-update-${{ steps.get_version.outputs.VERSION }}"
50-
commit-message: "[skip ci] docs: prepend changelog for ${{ steps.get_version.outputs.VERSION }}"
51-
title: "[Docs] Prepend changelog for ${{ steps.get_version.outputs.VERSION }}"
52-
body: "Automated changelog update for ${{ steps.get_version.outputs.VERSION }}"
60+
branch: "docs/changelog-update-${{ needs.get-version.outputs.version }}"
61+
commit-message: "[skip ci] docs: prepend changelog for ${{ needs.get-version.outputs.version }}"
62+
title: "[Docs] Prepend changelog for ${{ needs.get-version.outputs.version }}"
63+
body: "Automated changelog update for ${{ needs.get-version.outputs.version }}"
5364
base: main
5465
delete-branch: true
5566
labels: automerge
@@ -58,14 +69,11 @@ jobs:
5869
release:
5970
name: Create Release
6071
runs-on: ubuntu-latest
72+
needs: [get-version, prepend-changelog]
6173
steps:
6274
- name: Checkout code
6375
uses: actions/checkout@v4
6476

65-
- name: Get the version
66-
id: get_version
67-
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
68-
6977
- name: Create release
7078
id: create_release
7179
uses: actions/create-release@v1
@@ -74,14 +82,14 @@ jobs:
7482
with:
7583
tag_name: ${{ github.ref }}
7684
release_name: pytorch-optimizer ${{ github.ref }}
77-
body_path: docs/changelogs/${{ steps.get_version.outputs.VERSION }}.md
85+
body_path: docs/changelogs/${{ needs.get-version.outputs.version }}.md
7886
draft: false
7987
prerelease: false
8088

8189
deploy:
8290
name: Deploy
83-
needs: release
8491
runs-on: ubuntu-latest
92+
needs: release
8593
steps:
8694
- uses: actions/checkout@v4
8795

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ check:
1010
pyright pytorch_optimizer examples
1111

1212
test:
13-
python -m pytest -p no:pastebin -p no:nose -p no:doctest -sv -vv --cov=pytorch_optimizer --cov-report=xml ./tests
13+
python -m pytest -p no:pastebin -p no:nose -p no:doctest --disable-warnings -sv -vv --cov=pytorch_optimizer --cov-report=xml ./tests
1414

1515
requirements:
1616
poetry export -f requirements.txt --output requirements.txt --without-hashes

docs/changelogs/v3.8.2.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Change Log
2+
3+
### Feature
4+
5+
* Speed-up `zeropower_via_newtonschulz` up to 20% by utilizing `torch.baddmm` and `torch.addmm` ops. (#488)
6+
7+
### Update
8+
9+
* Refactor the type hints. (#448)

0 commit comments

Comments
 (0)