Skip to content

Commit

Permalink
Adds a quick CI job to verify python minimum version
Browse files Browse the repository at this point in the history
We've had a few recent issue/PRs dealing with python minimum version support: deephaven#5227, deephaven#5235, and deephaven#5271

Ultimately, we'd like a full matrix of testing support: deephaven#3724, deephaven#3725

In the more immediate term, there is a tool that I've verified is capable of catching these sorts of issues: https://github.com/netromdk/vermin. I've verified that it does catch deephaven#5227 and deephaven#5271, but does not catch deephaven#5235 (which seems like it is more of a runtime error).

This PR adds a quick CI job to verify a python minimum version of 3.8. The `# novermin` comment is necessary in a few locations where we've explicitly / manually worked around python minimum version support.
  • Loading branch information
devinrsmith committed Mar 20, 2024
1 parent d22197e commit 6e3b35d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/quick-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,18 @@ jobs:
name: quick-ci-jvm-err
path: '**/*_pid*.log'
if-no-files-found: ignore

verify-python-min-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install vermin
run: pip install vermin==1.6.0

- name: Verify minimum version support
run: vermin -t=3.8 --no-tips --eval-annotations --violations py/server/deephaven py/client py/client-ticking py/embedded-server
2 changes: 1 addition & 1 deletion py/server/deephaven/_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _parse_signature(fn: Callable) -> _ParsedSignature:
else:
p_sig = _ParsedSignature(fn=fn)
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
sig = inspect.signature(fn, eval_str=True)
sig = inspect.signature(fn, eval_str=True) # novermin
else:
sig = inspect.signature(fn)

Expand Down
2 changes: 1 addition & 1 deletion py/server/deephaven/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _np_ndarray_component_type(t: type) -> Optional[type]:
# when np.ndarray is used, the 1st argument is the component type
if not component_type and sys.version_info.major == 3 and sys.version_info.minor > 8:
import types
if isinstance(t, types.GenericAlias) and (issubclass(t.__origin__, Sequence) or t.__origin__ == np.ndarray):
if isinstance(t, types.GenericAlias) and (issubclass(t.__origin__, Sequence) or t.__origin__ == np.ndarray): # novermin
nargs = len(t.__args__)
if nargs == 1:
component_type = t.__args__[0]
Expand Down

0 comments on commit 6e3b35d

Please sign in to comment.