From 3cfe150d90323ae98c65f51f84b51c6ca7560bdb Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Tue, 8 Oct 2024 16:32:37 +0200 Subject: [PATCH 1/2] Release 0.12.1 --- .github/workflows/tests.yml | 6 +++--- .travis.yml | 15 --------------- README.md | 5 +++-- doc/conf.py | 2 +- doc/release_notes.rst | 22 ++++++++++++++++++++-- fairgraph/__init__.py | 2 +- fairgraph/client.py | 2 +- pyproject.toml | 4 ++-- 8 files changed, 31 insertions(+), 27 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 874f4d8f..d5c875cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d392ebc1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -dist: xenial -language: python -python: - - "3.7" - - "3.8" - - "3.9" - - "3.10" -# command to install dependencies -install: - - pip install -r requirements.txt - - pip install -U pytest-cov matplotlib pandas numpy jsondiff - - python setup.py install -# command to run tests -script: - - pytest --cov=fairgraph \ No newline at end of file diff --git a/README.md b/README.md index 1d3c4d62..2d4242de 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Authors: Andrew P. Davison, Onur Ates, Nico Feld, Yann Zerlaut, Glynis Mattheisen, Peyman Najafi -Copyright CNRS 2019-2023 +Copyright CNRS 2019-2024 **fairgraph** is a Python library for working with metadata in the EBRAINS Knowledge Graph, with a particular focus on data reuse, @@ -156,4 +156,5 @@ please open a ticket in the [issue tracker](https://github.com/HumanBrainProject
EU Logo
-This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3). +This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3) and in the EBRAINS research infrastructure, +funded from the European Union's Horizon Europe funding programme under grant agreement No. 101147319 (EBRAINS-2.0). diff --git a/doc/conf.py b/doc/conf.py index 3af8ddea..b935b3e6 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = "0.12" # The full version, including alpha/beta/rc tags -release = "0.12.0" +release = "0.12.1" # -- General configuration --------------------------------------------------- diff --git a/doc/release_notes.rst b/doc/release_notes.rst index afa43396..bfe852ac 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -2,6 +2,24 @@ Release notes ============= + +Version 0.12.1 +============== + +This version includes various small changes and bug fixes. + +- Reverse properties/fields, introduced in version 0.11, are now contained in the attribute :attr:`reverse_properties`, + which makes it easier to operate only on intrinsic, "forward" properties or only on reverse properties. +- The :attr:`type_` attribute is now a string (as in openMINDS Python), rather than a single-element list containing that string (as in the KG). +- The :class:`KGClient` now allows interactive authentication via a web-browser ("device flow"), + if the client cannot find an authorization token. + To disable this (for example for non-interactive use), create the client with ``allow_interactive=False``. +- Added methods :meth:`space_info()` and :meth:`clean_space()` to :class:`KGClient`, to make it easier to clean up private and collab KG spaces used for testing and development. +- Added method :meth:`move_all_to_space()` method to :class:`KGClient`, primarily intended for use by KG curators. +- Added the option to ignore duplicates in :meth:`node.exists()` calls (by default, if multiple nodes match the existence query an Exception will be raised) +- Updated the :mod:`openminds` module to include the latest changes in the openMINDS schemas. +- Partially fixed a `bug `_ in which resolving certain reverse links is broken. + Version 0.12.0 ============== @@ -85,10 +103,10 @@ and you can also make queries across these reverse links, e.g. Other changes ------------- -- made the `follow_links` argument to `resolve()` behave the same way as for `list()`, `from_id()`, etc., +- made the ``follow_links`` argument to :meth:`resolve()` behave the same way as for :meth:`list()`, :meth:`from_id()`, etc., i.e. it expects a structure of nested dicts to specify explicitly which links to follow, rather than an integer meaning "follow all links for this number of levels". -- added :func:`set_error_handling()` as a module-level function, so you can control the behaviour of all classes in a module (e.g. `fairgraph.openminds.core`) in a single line. +- added :func:`set_error_handling()` as a module-level function, so you can control the behaviour of all classes in a module (e.g. ``fairgraph.openminds.core``) in a single line. Version 0.10.0 diff --git a/fairgraph/__init__.py b/fairgraph/__init__.py index f1360601..1405c466 100644 --- a/fairgraph/__init__.py +++ b/fairgraph/__init__.py @@ -26,7 +26,7 @@ from .kgquery import KGQuery from .base import IRI -__version__ = "0.12.0" +__version__ = "0.12.1" # from . import ( # base, client, errors, utility, openminds) diff --git a/fairgraph/client.py b/fairgraph/client.py index 3d969992..fbd6884c 100644 --- a/fairgraph/client.py +++ b/fairgraph/client.py @@ -652,7 +652,7 @@ def clean_space(self, space_name): for instance in instances: assert instance.space == space_name print(".", end="") - instance.delete(self, ignore_errors=False) + instance.delete(self, ignore_not_found=False) print() else: print(f"The space '{space_name}' is already clean") diff --git a/pyproject.toml b/pyproject.toml index 02c42b96..dca916e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] name = "fairgraph" -version = "0.12.0" +version = "0.12.1" description = "Python API for the EBRAINS Knowledge Graph" readme = "README.md" authors = [ { name="Andrew P. Davison", email="andrew.davison@cnrs.fr" } ] -requires-python = ">=3.7" +requires-python = ">=3.8" license = {text = "Apache Software License"} classifiers = [ "Development Status :: 4 - Beta", From a29a7a471de3e0db842c800fcb1b2e8f4bb07828 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Tue, 8 Oct 2024 16:52:17 +0200 Subject: [PATCH 2/2] Reverting testing with Python 3.12 due to pydantic error via kg-core: ``` fairgraph/__init__.py:22: in from .client import KGClient fairgraph/client.py:28: in from kg_core.kg import kg /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/kg_core/kg.py:32: in from kg_core.response import Result, Instance, JsonLdDocument, ResultsById, ResultPage, ReleaseStatus, Error, translate_error, User, Scope, SpaceInformation, TypeInformation, TermsOfUse, ListOfUUID, ListOfReducedUserInformation /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/kg_core/response.py:83: in class Scope(BaseModel): /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pydantic/main.py:286: in __new__ cls.__try_update_forward_refs__() /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pydantic/main.py:808: in __try_update_forward_refs__ update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,)) /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pydantic/typing.py:554: in update_model_forward_refs update_field_forward_refs(f, globalns=globalns, localns=localns) /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pydantic/typing.py:520: in update_field_forward_refs field.type_ = evaluate_forwardref(field.type_, globalns, localns or None) /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pydantic/typing.py:66: in evaluate_forwardref return cast(Any, type_)._evaluate(globalns, localns, set()) E TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' ``` --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d5c875cb..77fc8b42 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4