Skip to content

Commit

Permalink
Adds a quick CI job to verify python minimum version (#5272)
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: #5227, #5235, and #5271

Ultimately, we'd like a full matrix of testing support: #3724, #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 #5227 and #5271, but does not catch #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 authored Mar 21, 2024
1 parent ce8865b commit a6d33ce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 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
2 changes: 1 addition & 1 deletion py/server/deephaven/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def _tzinfo_to_j_time_zone(tzi: datetime.tzinfo) -> TimeZone:
return _JDateTimeUtils.parseTimeZone(tzi.zone)

# Handle zoneinfo time zones

if sys.version_info >= (3, 9):
# novermin
import zoneinfo
if isinstance(tzi, zoneinfo.ZoneInfo):
return _JDateTimeUtils.parseTimeZone(tzi.key)
Expand Down

0 comments on commit a6d33ce

Please sign in to comment.