Skip to content
Snippets Groups Projects
Commit c86fd79f authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'release-0.7.4' into 'main'

Release 0.7.4

See merge request !60
parents f6711159 adb21a89
No related branches found
Tags v0.11.2
1 merge request!60Release 0.7.4
Pipeline #23482 passed
...@@ -21,6 +21,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -21,6 +21,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Documentation ### ### Documentation ###
## [0.7.4] - 2022-05-31
(Florian Spreckelsen)
### Fixed ###
* [#64](https://gitlab.com/caosdb/caosdb-pylib/-/issues/64) Use `Dict[]` and
`List[]` from `typing` for type hinting instead of `dict[]` and `list[]` for
compatibility with Python<3.9.
## [0.7.3] - 2022-05-03 ## [0.7.3] - 2022-05-03
(Henrik tom Wörden) (Henrik tom Wörden)
......
...@@ -48,7 +48,7 @@ from setuptools import find_packages, setup ...@@ -48,7 +48,7 @@ from setuptools import find_packages, setup
ISRELEASED = True ISRELEASED = True
MAJOR = 0 MAJOR = 0
MINOR = 7 MINOR = 7
MICRO = 3 MICRO = 4
# Do not tag as pre-release until this commit # Do not tag as pre-release until this commit
# https://github.com/pypa/packaging/pull/515 # https://github.com/pypa/packaging/pull/515
# has made it into a release. Probably we should wait for pypa/packaging>=21.4 # has made it into a release. Probably we should wait for pypa/packaging>=21.4
......
...@@ -33,7 +33,7 @@ import warnings ...@@ -33,7 +33,7 @@ import warnings
from collections.abc import Iterable from collections.abc import Iterable
from subprocess import call from subprocess import call
from typing import Optional, Any from typing import Optional, Any, Dict, List
from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER,
REFERENCE, TEXT, is_reference) REFERENCE, TEXT, is_reference)
...@@ -205,8 +205,8 @@ def compare_entities(old_entity: Entity, new_entity: Entity): ...@@ -205,8 +205,8 @@ def compare_entities(old_entity: Entity, new_entity: Entity):
In case of changed information the value listed under the respective key shows the In case of changed information the value listed under the respective key shows the
value that is stored in the respective entity. value that is stored in the respective entity.
""" """
olddiff: dict[str, Any] = {"properties": {}, "parents": []} olddiff: Dict[str, Any] = {"properties": {}, "parents": []}
newdiff: dict[str, Any] = {"properties": {}, "parents": []} newdiff: Dict[str, Any] = {"properties": {}, "parents": []}
if old_entity is new_entity: if old_entity is new_entity:
return (olddiff, newdiff) return (olddiff, newdiff)
...@@ -467,7 +467,7 @@ def resolve_reference(prop: Property): ...@@ -467,7 +467,7 @@ def resolve_reference(prop: Property):
prop.value = retrieve_entity_with_id(prop.value) prop.value = retrieve_entity_with_id(prop.value)
def create_flat_list(ent_list: list[Entity], flat: list[Entity]): def create_flat_list(ent_list: List[Entity], flat: List[Entity]):
""" """
Recursively adds all properties contained in entities from ent_list to Recursively adds all properties contained in entities from ent_list to
the output list flat. Each element will only be added once to the list. the output list flat. Each element will only be added once to the list.
...@@ -483,8 +483,10 @@ def create_flat_list(ent_list: list[Entity], flat: list[Entity]): ...@@ -483,8 +483,10 @@ def create_flat_list(ent_list: list[Entity], flat: list[Entity]):
if isinstance(el, Entity): if isinstance(el, Entity):
if el not in flat: if el not in flat:
flat.append(el) flat.append(el)
create_flat_list([el], flat) # TODO: move inside if block? # TODO: move inside if block?
create_flat_list([el], flat)
elif isinstance(p.value, Entity): elif isinstance(p.value, Entity):
if p.value not in flat: if p.value not in flat:
flat.append(p.value) flat.append(p.value)
create_flat_list([p.value], flat) # TODO: move inside if block? # TODO: move inside if block?
create_flat_list([p.value], flat)
...@@ -561,7 +561,7 @@ class CaosDBPythonEntity(object): ...@@ -561,7 +561,7 @@ class CaosDBPythonEntity(object):
return propval return propval
def resolve_references(self, deep: bool, references: db.Container, def resolve_references(self, deep: bool, references: db.Container,
visited: dict[Union[str, int], visited: Dict[Union[str, int],
"CaosDBPythonEntity"] = None): "CaosDBPythonEntity"] = None):
""" """
Resolve this entity's references. This affects unresolved properties as well Resolve this entity's references. This affects unresolved properties as well
...@@ -692,7 +692,7 @@ class CaosDBPythonEntity(object): ...@@ -692,7 +692,7 @@ class CaosDBPythonEntity(object):
if self in visited: if self in visited:
return visited[self] return visited[self]
metadata: dict[str, Any] = dict() metadata: Dict[str, Any] = dict()
properties = dict() properties = dict()
parents = list() parents = list()
......
...@@ -39,7 +39,7 @@ import shutil ...@@ -39,7 +39,7 @@ import shutil
import caosdb as db import caosdb as db
from caosdb.common.datatype import is_reference, get_referenced_recordtype from caosdb.common.datatype import is_reference, get_referenced_recordtype
from typing import Optional from typing import List, Optional
import tempfile import tempfile
...@@ -341,9 +341,9 @@ def retrieve_substructure(start_record_types, depth, result_id_set=None, result_ ...@@ -341,9 +341,9 @@ def retrieve_substructure(start_record_types, depth, result_id_set=None, result_
return None return None
def to_graphics(recordtypes: list[db.Entity], filename: str, def to_graphics(recordtypes: List[db.Entity], filename: str,
output_dirname: Optional[str] = None, output_dirname: Optional[str] = None,
formats: list[str] = ["tsvg"], formats: List[str] = ["tsvg"],
silent: bool = True, silent: bool = True,
add_properties: bool = True, add_properties: bool = True,
add_recordtypes: bool = True, add_recordtypes: bool = True,
...@@ -367,7 +367,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str, ...@@ -367,7 +367,7 @@ def to_graphics(recordtypes: list[db.Entity], filename: str,
the destination directory for the resulting images as defined by the "-o" the destination directory for the resulting images as defined by the "-o"
option by plantuml option by plantuml
default is to use current working dir default is to use current working dir
formats : list[str] formats : List[str]
list of target formats as defined by the -t"..." options by plantuml, e.g. "tsvg" list of target formats as defined by the -t"..." options by plantuml, e.g. "tsvg"
silent : bool silent : bool
Don't output messages. Don't output messages.
......
...@@ -29,10 +29,10 @@ copyright = '2022, IndiScale GmbH' ...@@ -29,10 +29,10 @@ copyright = '2022, IndiScale GmbH'
author = 'Daniel Hornung' author = 'Daniel Hornung'
# The short X.Y version # The short X.Y version
version = '0.7.3' version = '0.7.4'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
# release = '0.5.2-rc2' # release = '0.5.2-rc2'
release = '0.7.3' release = '0.7.4'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment