Skip to content

Commit acc02c4

Browse files
authored
Merge pull request #499 from ExaWorks/remove_typing_compat
Removed dependency on typing_compat and bumped the minimum python
2 parents e05d3d0 + 0cdcf01 commit acc02c4

File tree

9 files changed

+14
-20
lines changed

9 files changed

+14
-20
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ updates:
1515
- dependency-name: "psutil"
1616
- dependency-name: "pystache"
1717
- dependency-name: "typeguard"
18-
- dependency-name: "typing-compat"
1918
- dependency-name: "packaging"
2019

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: [3.7, 3.8, 3.9, 3.10]
17+
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
1818
runs-on: ubuntu-latest
1919

2020
steps:

.mypy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ ignore_missing_imports = True
1616

1717
[mypy-pystache.*]
1818
ignore_missing_imports = True
19-
20-
[mypy-typing_compat.*]
21-
ignore_missing_imports = True

QuickStart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ This document will guide you through the install procedure and your first Hello
77
- [Hello World example](#hello-world)
88

99
## Requirements
10-
- python3.7+
10+
- python3.8+
1111

1212
## Install PSI/J
1313

1414
If you have conda installed you might want to start from a fresh environment. This part is not installing PSI/J but setting up a new environment with the specified python version:
1515

16-
1. `conda create -n psij python=3.7`
16+
1. `conda create -n psij python=3.8`
1717
2. `conda activate psij`
1818

1919

@@ -35,7 +35,7 @@ Install PSI/J from the GitHub repository:
3535
## Hello World
3636

3737
**Requirements**
38-
- python3.7
38+
- python3.8
3939
- Job executor, e.g. Slurm in this example
4040

4141
**Steps**

docs/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ or from source.
1010
Requirements
1111
^^^^^^^^^^^^
1212

13-
The only requirements are Python 3.7+ and pip, which almost always
13+
The only requirements are Python 3.8+ and pip, which almost always
1414
comes with Python.
1515

1616
Install from PIP

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
psutil >=5.9, <=6.1.1
22
pystache>=0.6.0
33
typeguard>=3.0.1
4-
typing-compat
54
packaging >= 24.0, <= 24.2

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@
4242
},
4343

4444
install_requires=install_requires,
45-
python_requires='>=3.7'
45+
python_requires='>=3.8'
4646
)

src/psij/serialize.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from io import StringIO, TextIOBase
77
from pathlib import Path
88
from typing import Optional, Dict, Union, List, IO, AnyStr, TextIO
9-
import typing_compat
109

1110
from psij import ResourceSpec
1211
from psij.job_attributes import JobAttributes
@@ -135,12 +134,12 @@ def _from_psij_object(self, o: Union[JobSpec, JobAttributes, ResourceSpec]) \
135134

136135
def _canonicalize_type(self, t: object) -> object:
137136
# generics don't appear to be subclasses of Type, so we can't really use Type for t
138-
origin = typing_compat.get_origin(t)
137+
origin = typing.get_origin(t)
139138
if origin == Optional:
140139
# Python converts Optional[T] to Union[T, None], so this shouldn't happen
141-
return typing_compat.get_args(t)[0]
140+
return typing.get_args(t)[0]
142141
elif origin == Union:
143-
args = typing_compat.get_args(t)
142+
args = typing.get_args(t)
144143
if args[0] == NoneType:
145144
return args[1]
146145
elif args[1] == NoneType:
@@ -171,10 +170,10 @@ def _from_object(self, o: object, t: object) -> object:
171170
else:
172171
if t == Union[str, Path] or t == Optional[Union[str, Path]]:
173172
return str(o)
174-
if typing_compat.get_origin(t) == dict:
173+
if typing.get_origin(t) == dict:
175174
assert isinstance(o, dict)
176175
return self._from_dict(o)
177-
if typing_compat.get_origin(t) == list:
176+
if typing.get_origin(t) == list:
178177
assert isinstance(o, list)
179178
return self._from_list(o)
180179
raise ValueError('Cannot convert type "%s".' % t)
@@ -249,10 +248,10 @@ def _to_object(self, s: object, t: object) -> object:
249248
if t == Union[str, Path] or t == Optional[Union[str, Path]]:
250249
assert isinstance(s, str)
251250
return Path(s)
252-
if typing_compat.get_origin(t) == dict:
251+
if typing.get_origin(t) == dict:
253252
assert isinstance(s, dict)
254253
return self._to_dict(s)
255-
if typing_compat.get_origin(t) == list:
254+
if typing.get_origin(t) == list:
256255
assert isinstance(s, list)
257256
return self._to_list(s)
258257
raise ValueError('Cannot convert type "%s".' % t)

web/install.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2><i class="fab fa-python"></i> Installing <span class="psij-font">PSI/J</span
1313
<div style="margin-top: 1em">
1414
The psij-python library has the following requirements:
1515
<ul>
16-
<li>Python 3.7 or later
16+
<li>Python 3.8 or later
1717
<li>Ubuntu 16.04 or later (or an equivalent Linux distribution)
1818
<li>OS X 10.10 or later
1919
</ul>

0 commit comments

Comments
 (0)