-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade Python version to 3.12 across all CI/CD workflows and package requirements #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ classifiers = [ | |
| ] | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.9" | ||
| python = ">=3.12" | ||
| numpy = "^1.25.0" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NumPy Compatibility Issue with Python 3.12 NumPy 1.25.0 does not have pre-built wheels for Python 3.12. I verified this by checking PyPI metadata - there are 0 wheels available for cp312. This will cause installation failures when users try to install dependencies with Python 3.12. Recommendation: Bump numpy to a version that supports Python 3.12: # Before
numpy = "^1.25.0"
# After (NumPy 1.26.0+ has Python 3.12 support)
numpy = "^1.26.0"Additionally, please verify that other dependencies (transformers, sentencepiece, torch) have compatible versions available for Python 3.12. You can test this with: python3.12 -m venv .venv && source .venv/bin/activate
pip install -e gguf-py |
||
| sentencepiece = ">=0.1.98,<=0.2.0" | ||
| transformers = ">=4.35.2,<5.0.0" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1320,15 +1320,15 @@ int main() { | |
| if (getenv("LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR")) { | ||
| fprintf(stderr, "\033[33mWARNING: Skipping slow tests on emulator.\n\033[0m"); | ||
| } else { | ||
| if (getenv("LLAMA_PYTHON_AVAILABLE") || (std::system("python -c \"import sys; exit(1) if sys.version_info < (3, 8) else print('Python version is sufficient')\"") == 0)) { | ||
| if (getenv("LLAMA_PYTHON_AVAILABLE") || (std::system("python -c \"import sys; exit(1) if sys.version_info < (3, 12) else print('Python version is sufficient')\"") == 0)) { | ||
| test_all("Python", [](const TestCase & tc) { | ||
| write("test-json-schema-input.tmp", tc.schema); | ||
| tc.verify_status(std::system( | ||
| "python ./examples/json_schema_to_grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE); | ||
| tc.verify(read("test-grammar-output.tmp")); | ||
| }); | ||
| } else { | ||
| fprintf(stderr, "\033[33mWARNING: Python not found (min version required is 3.8), skipping Python JSON schema -> grammar tests.\n\033[0m"); | ||
| fprintf(stderr, "\033[33mWARNING: Python not found (min version required is 3.12), skipping Python JSON schema -> grammar tests.\n\033[0m"); | ||
|
Comment on lines
+1323
to
+1331
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python Executable Resolution Issue The test checks for Python >=3.12 using the Recommendation: // More robust version check that tries python3 first
const char *py3_check = "python3 -c \"import sys; exit(1) if sys.version_info < (3, 12) else print('Python version is sufficient')\"";
const char *py_check = "python -c \"import sys; exit(1) if sys.version_info < (3, 12) else print('Python version is sufficient')\"";
if (getenv("LLAMA_PYTHON_AVAILABLE") ||
std::system(py3_check) == 0 ||
std::system(py_check) == 0) {
// run tests
} else {
fprintf(stderr, "\033[33mWARNING: Python not found (min version required is 3.12), skipping Python JSON schema -> grammar tests.\n\033[0m");
}This ensures the test works across different environments while maintaining the new 3.12 requirement. |
||
| } | ||
|
|
||
| if (getenv("LLAMA_NODE_AVAILABLE") || (std::system("node --version") == 0)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete Python Version Updates Across Workflows
This PR updates Python to 3.12 in several workflows, but there are additional workflow files that still reference older Python versions:
.github/workflows/pre-tokenizer-hashes.yml- still at3.11.github/workflows/python-type-check.yml- still at3.11.github/workflows/python-lint.yml- still at3.11For consistency with this upgrade, these workflows should also be updated to Python 3.12.
Additionally, this workflow uses
actions/setup-python@v4while all other updated workflows use@v5. For consistency and to pick up latest fixes, please upgrade: