Skip to content

fix: drop EOL Python 3.8, pin botocore, fix docstring typos, remove dead code#30

Open
Hardikrepo wants to merge 1 commit into
jpmorganchase:mainfrom
Hardikrepo:fix/dependency-and-compat-issues
Open

fix: drop EOL Python 3.8, pin botocore, fix docstring typos, remove dead code#30
Hardikrepo wants to merge 1 commit into
jpmorganchase:mainfrom
Hardikrepo:fix/dependency-and-compat-issues

Conversation

@Hardikrepo

Copy link
Copy Markdown

Summary

This PR fixes several bugs and maintenance issues found in the main branch:

Fix 1 — Remove dead importlib_metadata fallback in __init__.py

The try/except ImportError block around from importlib import metadata was added to support Python < 3.8, but requires-python = ">=3.8" means this fallback is unreachable. Additionally, importlib_metadata is not listed in dependencies, so the fallback would fail at runtime on Python < 3.8 anyway. Replaced with a direct import.

Fix 2 — _handle_ping docstring says "HEAD request" but route is GET

The docstring for _handle_ping() in __init__.py reads "Handle an incoming ping HEAD request", but _ROUTES maps ("GET", "/ping"). SageMaker sends a GET to /ping. Corrected to "GET request".

Fix 3 — Typos in _plugin.py docstrings

Three 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-dev in CI

Python 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 matrix
  • tox.ini: removed py38 from envlist and [gh-actions] mapping

Additionally, Python 3.13 was released in October 2024, so '3.13-dev' is replaced with '3.13'.

Fix 5 — Add lower bound to unpinned botocore dependency

botocore was listed with no version constraint at all ("botocore"). A fully unpinned dependency can silently pull in incompatible versions. Added botocore>=1.12 as a safe lower bound (the version that introduced the StreamingBody API used in inference_server.testing).

Fix 6 — Remove duplicate test

test_package_has_version and test_version in tests/test_inference_server.py both assert inference_server.__version__ is not None. Removed the duplicate test_package_has_version.

Files Changed

File Change
src/inference_server/__init__.py Remove dead importlib_metadata fallback; fix _handle_ping docstring
src/inference_server/_plugin.py Fix 3 docstring typos
pyproject.toml requires-python >=3.9; botocore>=1.12
.github/workflows/test-package.yml Drop 3.8, fix 3.13-dev3.13
tox.ini Drop py38 from envlist and gh-actions mapping
tests/test_inference_server.py Remove duplicate test_package_has_version

Test plan

  • All existing tests pass (tox)
  • Linting passes (tox -e linting)
  • CI matrix runs cleanly on Python 3.9–3.13
  • from importlib import metadata resolves correctly on Python 3.9+

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant