Skip to content

Commit 817a23a

Browse files
authored
Merge pull request #289 from bashtage/restore-3.6
MAINT: Restore 3.6 functionality
2 parents a3d2d00 + 5579f9f commit 817a23a

6 files changed

+18
-12
lines changed

ci/azure/azure_template_posix.yml

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
NUMPY: 1.16.6
2929
python39_latest:
3030
python.version: '3.9'
31+
python36_latest:
32+
python.version: '3.6'
3133
python38_mid_conda:
3234
python.version: '3.8'
3335
use.conda: true

randomgen/tests/test_recent_numpy_changes.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from distutils.version import LooseVersion
42
from typing import cast
53

randomgen/typing.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
from typing import TYPE_CHECKING, Any, Optional, Sequence, Union
1+
import sys
2+
from typing import TYPE_CHECKING, Optional, Sequence, Union
23

3-
if TYPE_CHECKING:
4-
from typing import Literal
4+
from randomgen.seed_sequence import SeedSequence
55

6-
SeedMode = Literal["sequence", "legacy"]
6+
if sys.version_info >= (3, 8):
7+
from typing import Literal
8+
elif TYPE_CHECKING:
9+
from typing_extensions import Literal
710
else:
8-
SeedMode = Any
911

10-
from randomgen.seed_sequence import SeedSequence
12+
class _Literal:
13+
def __getitem__(self, item):
14+
pass
15+
16+
Literal = _Literal()
17+
18+
SeedMode = Literal["sequence", "legacy"]
19+
1120

1221
__all__ = ["IntegerSequenceSeed", "SeedMode", "Size"]
1322

randomgen/xoshiro256starstar.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Optional
42
import warnings
53

randomgen/xoshiro512starstar.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Optional
42
import warnings
53

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
black==21.4b1
12
pytest>=6
23
pytest-cov
34
scipy>=1.3.2

0 commit comments

Comments
 (0)