fix: drop EOL Python 3.8, pin botocore, fix docstring typos, remove dead code#30
Open
Hardikrepo wants to merge 1 commit into
Open
fix: drop EOL Python 3.8, pin botocore, fix docstring typos, remove dead code#30Hardikrepo wants to merge 1 commit into
Hardikrepo wants to merge 1 commit into
Conversation
…t fallback, fix docstring typos - Drop Python 3.8 (EOL Oct 2024) from CI matrix, tox envlist, and requires-python (>=3.8 -> >=3.9) - Replace '3.13-dev' with '3.13' in CI matrix (Python 3.13 released Oct 2024) - Add botocore>=1.12 lower bound to prevent silent breakage from unconstrained dependency - Remove dead try/except ImportError fallback for importlib.metadata (unreachable since requires-python>=3.9) - Fix docstring typos in _plugin.py: 'functions wich' -> 'function which', 'seriazizes' -> 'serializes', 'aplication' -> 'application' - Fix _handle_ping docstring: 'HEAD request' -> 'GET request' (route is GET /ping) - Remove duplicate test_package_has_version (identical to test_version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several bugs and maintenance issues found in the
mainbranch:Fix 1 — Remove dead
importlib_metadatafallback in__init__.pyThe
try/except ImportErrorblock aroundfrom importlib import metadatawas added to support Python < 3.8, butrequires-python = ">=3.8"means this fallback is unreachable. Additionally,importlib_metadatais not listed independencies, so the fallback would fail at runtime on Python < 3.8 anyway. Replaced with a direct import.Fix 2 —
_handle_pingdocstring says "HEAD request" but route is GETThe docstring for
_handle_ping()in__init__.pyreads "Handle an incoming ping HEAD request", but_ROUTESmaps("GET", "/ping"). SageMaker sends aGETto/ping. Corrected to "GET request".Fix 3 — Typos in
_plugin.pydocstringsThree typos in docstrings:
ping_fn:"A functions wich indicates"→"A function which indicates"output_fn:"seriazizes"→"serializes"output_fn:"aplication/json"→"application/json"Fix 4 — Drop EOL Python 3.8 and fix
3.13-devin CIPython 3.8 reached end-of-life in October 2024. It is removed from:
pyproject.toml:requires-python = ">=3.8"→">=3.9".github/workflows/test-package.yml: removed'3.8'from matrixtox.ini: removedpy38fromenvlistand[gh-actions]mappingAdditionally, Python 3.13 was released in October 2024, so
'3.13-dev'is replaced with'3.13'.Fix 5 — Add lower bound to unpinned
botocoredependencybotocorewas listed with no version constraint at all ("botocore"). A fully unpinned dependency can silently pull in incompatible versions. Addedbotocore>=1.12as a safe lower bound (the version that introduced theStreamingBodyAPI used ininference_server.testing).Fix 6 — Remove duplicate test
test_package_has_versionandtest_versionintests/test_inference_server.pyboth assertinference_server.__version__ is not None. Removed the duplicatetest_package_has_version.Files Changed
src/inference_server/__init__.pyimportlib_metadatafallback; fix_handle_pingdocstringsrc/inference_server/_plugin.pypyproject.tomlrequires-python >=3.9;botocore>=1.12.github/workflows/test-package.yml3.8, fix3.13-dev→3.13tox.inipy38from envlist and gh-actions mappingtests/test_inference_server.pytest_package_has_versionTest plan
tox)tox -e linting)from importlib import metadataresolves correctly on Python 3.9+