Skip to content

Commit 4ea751d

Browse files
authored
Boost max testing version to 3.12 (#202)
Boost max testing version to 3.12
1 parent 226942c commit 4ea751d

27 files changed

+59
-48
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
language: python
2-
dist: bionic
2+
dist: focal
33
python:
44
- '3.8'
55
- '3.9'
66
- '3.10'
77
- '3.11'
8+
- '3.12'
89
env:
9-
- UPGRADES="-U pint pandas"
10+
- UPGRADES="-U --only-binary 'pint,pandas' pint pandas"
1011
- UPGRADES=""
12+
jobs:
13+
exclude:
14+
- python: '3.12'
15+
env: UPGRADES=""
1116
install:
1217
- pip install --only-binary ':all:' -r requirements.txt
18+
- test $TRAVIS_PYTHON_VERSION != "3.12" || perl -pi -E 's/^.*(?:pandas|flake8-docstrings).*$//' test_requirements.txt
1319
- pip install --only-binary ':all:' -r test_requirements.txt
1420
- pip install $UPGRADES -e .
1521
script:

gemd/demo/strehlow_and_cook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ def real_mapper(prop):
289289
template = tmpl[name_map[attr['name']]]
290290

291291
# Move into GEMD structure
292-
if type(template) == PropertyTemplate:
292+
if isinstance(template, PropertyTemplate):
293293
msr.properties.append(
294294
Property(name=template.name,
295295
template=template,
296296
value=content_map[type(template.bounds)](attr),
297297
origin=origin,
298298
notes=method
299299
))
300-
elif type(template) == ConditionTemplate:
300+
elif isinstance(template, ConditionTemplate):
301301
msr.conditions.append(
302302
Condition(name=template.name,
303303
template=template,

gemd/entity/base_entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def to_link(self,
100100

101101
return LinkByUID(scope=scope, id=uid)
102102

103-
def all_dependencies(self) -> Set[Union["BaseEntity", "LinkByUID"]]:
103+
def all_dependencies(self) -> Set[Union["BaseEntity", "LinkByUID"]]: # noqa: F821
104104
"""Return a set of all immediate dependencies (no recursion)."""
105105
result = set()
106106
queue = [type(self)]

gemd/entity/bounds/base_bounds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BaseBounds(DictSerializable):
99
"""Base class for bounds, including RealBounds and CategoricalBounds."""
1010

1111
@abstractmethod
12-
def contains(self, bounds: Union["BaseBounds", "BaseValue"]):
12+
def contains(self, bounds: Union["BaseBounds", "BaseValue"]): # noqa: F821
1313
"""
1414
Check if another bounds is contained within this bounds.
1515
@@ -36,7 +36,7 @@ def contains(self, bounds: Union["BaseBounds", "BaseValue"]):
3636
raise TypeError('{} is not a Bounds object'.format(bounds))
3737

3838
@abstractmethod
39-
def union(self, *others: Union["BaseBounds", "BaseValue"]) -> "BaseBounds":
39+
def union(self, *others: Union["BaseBounds", "BaseValue"]) -> "BaseBounds": # noqa: F821
4040
"""
4141
Return the union of this bounds and other bounds.
4242
@@ -56,7 +56,7 @@ def union(self, *others: Union["BaseBounds", "BaseValue"]) -> "BaseBounds":
5656
pass # pragma: no cover
5757

5858
@abstractmethod
59-
def update(self, *others: Union["BaseBounds", "BaseValue"]):
59+
def update(self, *others: Union["BaseBounds", "BaseValue"]): # noqa: F821
6060
"""
6161
Update this bounds to include other bounds.
6262

gemd/entity/bounds/categorical_bounds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def categories(self, categories: Optional[Iterable[str]]):
3939
if not all(isinstance(x, str) for x in self.categories):
4040
raise ValueError("All the categories must be strings")
4141

42-
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
42+
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool: # noqa: F821
4343
"""
4444
Check if another bounds object or value objects is contained by this bounds.
4545
@@ -69,8 +69,8 @@ def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
6969
return bounds.categories.issubset(self.categories)
7070

7171
def union(self,
72-
*others: Union["CategoricalBounds", "CategoricalValue"]
73-
) -> "CategoricalBounds":
72+
*others: Union["CategoricalBounds", "CategoricalValue"] # noqa: F821
73+
) -> "CategoricalBounds": # noqa: F821
7474
"""
7575
Return the union of this bounds and other bounds.
7676
@@ -102,7 +102,7 @@ def union(self,
102102
result.update(bounds.categories)
103103
return CategoricalBounds(result)
104104

105-
def update(self, *others: Union["CategoricalBounds", "CategoricalValue"]):
105+
def update(self, *others: Union["CategoricalBounds", "CategoricalValue"]): # noqa: F821
106106
"""
107107
Update this bounds to include other bounds.
108108

gemd/entity/bounds/composition_bounds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def components(self, value):
3939
if not all(isinstance(x, str) for x in self.components):
4040
raise ValueError("All the components must be strings")
4141

42-
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
42+
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool: # noqa: F821
4343
"""
4444
Check if another bounds or value object is contained by this bounds.
4545
@@ -69,8 +69,8 @@ def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
6969
return bounds.components.issubset(self.components)
7070

7171
def union(self,
72-
*others: Union["CompositionBounds", "CompositionValue"]
73-
) -> "CompositionBounds":
72+
*others: Union["CompositionBounds", "CompositionValue"] # noqa: F821
73+
) -> "CompositionBounds": # noqa: F821
7474
"""
7575
Return the union of this bounds and other bounds.
7676
@@ -102,7 +102,7 @@ def union(self,
102102
result.update(bounds.components)
103103
return CompositionBounds(result)
104104

105-
def update(self, *others: Union["CompositionBounds", "CompositionValue"]):
105+
def update(self, *others: Union["CompositionBounds", "CompositionValue"]): # noqa: F821
106106
"""
107107
Update this bounds to include other bounds.
108108

gemd/entity/bounds/integer_bounds.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, lower_bound=None, upper_bound=None):
3030
if self.upper_bound < self.lower_bound:
3131
raise ValueError("Upper bound must be greater than or equal to lower bound")
3232

33-
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
33+
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool: # noqa: F821
3434
"""
3535
Check if another bounds or value object is a subset of this range.
3636
@@ -59,7 +59,9 @@ def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
5959

6060
return bounds.lower_bound >= self.lower_bound and bounds.upper_bound <= self.upper_bound
6161

62-
def union(self, *others: Union["IntegerBounds", "IntegerValue"]) -> "IntegerBounds":
62+
def union(self,
63+
*others: Union["IntegerBounds", "IntegerValue"] # noqa: F821
64+
) -> "IntegerBounds": # noqa: F821
6365
"""
6466
Return the union of this bounds and other bounds.
6567
@@ -94,7 +96,7 @@ def union(self, *others: Union["IntegerBounds", "IntegerValue"]) -> "IntegerBoun
9496
upper = bounds.upper_bound
9597
return IntegerBounds(lower_bound=lower, upper_bound=upper)
9698

97-
def update(self, *others: Union["IntegerBounds", "IntegerValue"]):
99+
def update(self, *others: Union["IntegerBounds", "IntegerValue"]): # noqa: F821
98100
"""
99101
Update this bounds to include other bounds.
100102

gemd/entity/bounds/molecular_structure_bounds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class MolecularStructureBounds(BaseBounds, typ="molecular_structure_bounds"):
1212
"""Molecular bounds, with no component or substructural restrictions (yet)."""
1313

14-
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
14+
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool: # noqa: F821
1515
"""
1616
Check if another bounds or value object is contained by this bounds.
1717
@@ -41,8 +41,8 @@ def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
4141
return True
4242

4343
def union(self,
44-
*others: Union["MolecularStructureBounds", "MolecularValue"]
45-
) -> "MolecularStructureBounds":
44+
*others: Union["MolecularStructureBounds", "MolecularValue"] # noqa: F821
45+
) -> "MolecularStructureBounds": # noqa: F821
4646
"""
4747
Return the union of this bounds and other bounds.
4848
@@ -69,7 +69,7 @@ def union(self,
6969
f"expected molecular structure, found {misses}")
7070
return MolecularStructureBounds()
7171

72-
def update(self, *others: Union["MolecularStructureBounds", "MolecularValue"]):
72+
def update(self, *others: Union["MolecularStructureBounds", "MolecularValue"]): # noqa: F821
7373
"""
7474
Update this bounds to include other bounds.
7575

gemd/entity/bounds/real_bounds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def default_units(self, default_units):
4949
"Use an empty string for a dimensionless quantity.")
5050
self._default_units = units.parse_units(default_units)
5151

52-
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
52+
def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool: # noqa: F821
5353
"""
5454
Check if another bounds or value object is a subset of this range.
5555
@@ -84,7 +84,7 @@ def contains(self, bounds: Union[BaseBounds, "BaseValue"]) -> bool:
8484

8585
return bounds.lower_bound >= lower and bounds.upper_bound <= upper
8686

87-
def union(self, *others: Union["RealBounds", "ContinuousValue"]) -> "RealBounds":
87+
def union(self, *others: Union["RealBounds", "ContinuousValue"]) -> "RealBounds": # noqa: F821
8888
"""
8989
Return the union of this bounds and other bounds.
9090
@@ -123,7 +123,7 @@ def union(self, *others: Union["RealBounds", "ContinuousValue"]) -> "RealBounds"
123123
upper = bnd_hi
124124
return RealBounds(lower_bound=lower, upper_bound=upper, default_units=unit_)
125125

126-
def update(self, *others: Union["RealBounds", "ContinuousValue"]):
126+
def update(self, *others: Union["RealBounds", "ContinuousValue"]): # noqa: F821
127127
"""
128128
Update this bounds to include other bounds.
129129

gemd/entity/dict_serializable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class DictSerializableMeta(ABCMeta):
1818

1919
_class: Dict[str, type] = {}
2020

21-
def __new__(mcs, name, bases, *args,
21+
def __new__(mcs, name, bases, *args, # noqa: D102
2222
typ: str = None, skip: Set[str] = frozenset(),
23-
**kwargs): # noqa: D102
23+
**kwargs):
2424
return super().__new__(mcs, name, bases, *args, **kwargs)
2525

2626
def __init__(cls, name, bases, *args, typ: str = None, skip: Set[str] = frozenset(), **kwargs):

0 commit comments

Comments
 (0)