From c08ca108b5157f9e85f5be5892299ade4d582b23 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Tue, 31 May 2022 17:28:45 +0200 Subject: [PATCH] Remove support of python3.10 since urllib3 not supported yet --- .github/workflows/ci_tests.yml | 2 +- Dockerfile | 2 +- aiida_optimade/translators/entities.py | 37 +------------------------- setup.json | 1 - 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 47a00037..63b26440 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9'] backend: ['psql_dos'] services: diff --git a/Dockerfile b/Dockerfile index 6dc533d8..6937763e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.9 WORKDIR /app diff --git a/aiida_optimade/translators/entities.py b/aiida_optimade/translators/entities.py index 3dfc31a4..c6370520 100644 --- a/aiida_optimade/translators/entities.py +++ b/aiida_optimade/translators/entities.py @@ -147,42 +147,7 @@ def _store_attributes_node_extra(self) -> None: optimade.update(self.new_attributes) else: optimade = self.new_attributes - # extras = ( - # self._get_unique_node_property("extras") - # if self._get_unique_node_property("extras") - # else {} - # ) - # extras[self.EXTRAS_KEY] = optimade - - # profile = get_manager().get_profile() - - # if profile.storage_backend == "psql_dos": - # # TODO: this can be `set_extra` directly? is there performance issue? - # # from aiida.storage.psql_dos.models.node import DbNode - # LOGGER.debug(f"{self._node.extras}") - # # LOGGER.debug(f"extras: {extras}") - - # # self._node.reset_extras(extras) - # node = orm.load_node(self._pk) - # node.set_extra(self.EXTRAS_KEY, optimade) - # LOGGER.debug(f"{self._node.extras}") - # # LOGGER.debug(f"extras: {extras}") - - # # with get_manager().get_backend().transaction() as session: - # # session.query(DbNode).filter(DbNode.id == self._pk).update( - # # values={"extras": extras} - # # ) - - # else: - # raise AiidaError( - # f'Unknown AiiDA backend "{profile.database_backend}" for profile' - # f"{profile}" - # ) LOGGER.debug("Updating Node %s in AiiDA DB!", self._pk) node = orm.load_node(self._pk) - node.set_extra(self.EXTRAS_KEY, optimade) - - # For posterity, this is how to do the same, going through AiiDA's API: - # self._node.set_extra_many(extras) - # self._node.set_extra(self.EXTRAS_KEY, optimade) + node.set_extra(self.EXTRAS_KEY, optimade) \ No newline at end of file diff --git a/setup.json b/setup.json index a9abb20c..45e2b379 100644 --- a/setup.json +++ b/setup.json @@ -18,7 +18,6 @@ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Intended Audience :: Developers", "Topic :: Database", "Topic :: Database :: Database Engines/Servers",