Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update datalad_registry_client to remove DeprecationWarnings #338

Open
candleindark opened this issue Mar 19, 2024 · 3 comments
Open

Update datalad_registry_client to remove DeprecationWarnings #338

candleindark opened this issue Mar 19, 2024 · 3 comments
Assignees

Comments

@candleindark
Copy link
Collaborator

There are numerous ``DeprecationWarningwhen running thetools/populate.py` script, which is built on top of `datalad_registry_client`.

❯ python tools/populate.py --start 60 --stop 65
/Users/isaac/.pyenv/versions/3.9.16/envs/datalad-registry/lib/python3.9/site-packages/boto/plugin.py:40: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
/Users/isaac/.pyenv/versions/3.9.16/envs/datalad-registry/lib/python3.9/site-packages/datalad_catalog/webcatalog.py:5: DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
  from jsonschema import (
/Users/isaac/.pyenv/versions/3.9.16/envs/datalad-registry/lib/python3.9/site-packages/datalad_catalog/validate.py:18: DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
  from jsonschema import (
/Users/isaac/.pyenv/versions/3.9.16/envs/datalad-registry/lib/python3.9/site-packages/datalad/interface/utils.py:223: DeprecationWarning: datalad.interface.utils.eval_results is obsolete. Use datalad.interface.base.eval_results instead
  warnings.warn("datalad.interface.utils.eval_results is obsolete. "
/Users/isaac/.pyenv/versions/3.9.16/envs/datalad-registry/lib/python3.9/site-packages/datalad/interface/utils.py:223: DeprecationWarning: datalad.interface.utils.eval_results is obsolete. Use datalad.interface.base.eval_results instead
  warnings.warn("datalad.interface.utils.eval_results is obsolete. "
Submitting 5 of the total 5112 active GitHub datasets to the datalad-registry.
registry-submit-urls(ok): [Registered https://github.com/NCCR-SYNAPSY/ds-NeuroDataPubOSFTest4.git]
registry-submit-urls(ok): [Registered https://github.com/NGenetzky/academic-oss-elc.git]
registry-submit-urls(ok): [Registered https://github.com/NGenetzky/balena-phusion.git]
registry-submit-urls(ok): [Registered https://github.com/NGenetzky/bitbake.bblayer.git]
registry-submit-urls(ok): [Registered https://github.com/NGenetzky/datasets.datalad.org.git]

Out of these five ``DeprecationWarnings, four of the them occurred when just import datalad.api as dl` with the working directory set to the repo directory of `datalad-registry` which contains the `datalad_registry_client` source.

>>> import datalad.api as dl
/Users/isaac/.pyenv/versions/datalad-registry/lib/python3.9/site-packages/datalad_catalog/webcatalog.py:5: DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
  from jsonschema import (
/Users/isaac/.pyenv/versions/datalad-registry/lib/python3.9/site-packages/datalad_catalog/validate.py:18: DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
  from jsonschema import (
/Users/isaac/.pyenv/versions/datalad-registry/lib/python3.9/site-packages/datalad/interface/utils.py:223: DeprecationWarning: datalad.interface.utils.eval_results is obsolete. Use datalad.interface.base.eval_results instead
  warnings.warn("datalad.interface.utils.eval_results is obsolete. "
/Users/isaac/.pyenv/versions/datalad-registry/lib/python3.9/site-packages/datalad/interface/utils.py:223: DeprecationWarning: datalad.interface.utils.eval_results is obsolete. Use datalad.interface.base.eval_results instead
  warnings.warn("datalad.interface.utils.eval_results is obsolete. "
>>>

import datalad.api as dl did not produce any warning when the working directory is set outside of the repo directory of datalad-registry.

@candleindark candleindark self-assigned this Mar 19, 2024
@candleindark
Copy link
Collaborator Author

candleindark commented Mar 20, 2024

It seems that these warnings only show up "because of" some imports from the datatad_registry package when writing or using a Datalad extension as illustrated below.

from datalad_registry.blueprints.api.dataset_urls.models import DatasetURLPage

from datalad_registry.tasks.utils.usage_dashboard import (
DASHBOARD_COLLECTION_URL,
DashboardCollection,
Status,
)

@yarikoptic Any idea? Something related to how Datalad sets add subcommands or extensions dynamically? It also smells circular nature to me. By the way, everything works as expected other than the unseemly warnings.

@candleindark
Copy link
Collaborator Author

Never mind, the warnings are not related to Datalad extensions. They can be recreated just by running the above import statements in a new Python console.

@yarikoptic
Copy link
Member

just address the ones appearing from datalad-registry (imp) and possibly file issues in datalad-catalog but do not spend much tim one this please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants