Skip to content

Commit

Permalink
ci: test Python 3.12 (deepmodeling#4059)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Chores**
- Updated the Python version in the CI/CD workflow from 3.11 to 3.12,
enhancing compatibility and performance for testing environments.
  
- **Bug Fixes**
- Improved error reporting in parallel training tests, providing clearer
output for failures to aid in debugging.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Aug 20, 2024
1 parent 05323f3 commit e47ca24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
python: ["3.8", "3.11"]
python: ["3.8", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.11"]
python: ["3.8", "3.12"]
needs: testpython
steps:
- name: Get durations from cache
Expand Down
6 changes: 5 additions & 1 deletion source/tests/tf/test_parallel_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ def test_two_workers(self):
stdout=sp.PIPE,
stderr=sp.STDOUT,
)
lines = []
for line in iter(popen.stdout.readline, b""):
if hasattr(line, "decode"):
line = line.decode("utf-8")
line = line.rstrip()
lines.append(line)
popen.wait()
self.assertEqual(0, popen.returncode, "Parallel training failed!")
self.assertEqual(
0, popen.returncode, f"Parallel training failed!\n{''.join(lines)}"
)


if __name__ == "__main__":
Expand Down

0 comments on commit e47ca24

Please sign in to comment.