Skip to content

BF: Address datalad DeprecationWarnings for compatibility with datalad PR #7793, make compatible with boto3 by use of datalad interfaces#149

Merged
yarikoptic merged 5 commits intomasterfrom
bf-deprecations
Mar 12, 2026
Merged

BF: Address datalad DeprecationWarnings for compatibility with datalad PR #7793, make compatible with boto3 by use of datalad interfaces#149
yarikoptic merged 5 commits intomasterfrom
bf-deprecations

Conversation

@yarikoptic
Copy link
Copy Markdown
Member

  • Replace assure_* with ensure_* (assure_ variants emit DeprecationWarning)
  • Remove six dependency: iteritems→.items(), string_types→str, text_type→str, PY3 guard removed, add_metaclass→metaclass=, from six import next removed
  • Replace from mock import with from unittest.mock import (stdlib)
  • Replace subdatasets(fulfilled=True) with subdatasets(state='present')
  • Replace deprecated AnnexRepo.get_file_key() with get_file_annexinfo()
  • Fix finalize() return-without-yield bug: when aggregate_metadata is unavailable, bare return dropped pipeline data preventing tag/cleanup/yield
  • Replace distutils.version.LooseVersion with looseversion package
  • Remove mock from test dependencies, add looseversion to install_requires
  • Update tox.ini filterwarnings for datalad-deprecated internal warnings

yarikoptic and others added 5 commits March 10, 2026 12:46
…d PR #7793

- Replace assure_* with ensure_* (assure_ variants emit DeprecationWarning)
- Remove six dependency: iteritems→.items(), string_types→str, text_type→str,
  PY3 guard removed, add_metaclass→metaclass=, `from six import next` removed
- Replace `from mock import` with `from unittest.mock import` (stdlib)
- Replace subdatasets(fulfilled=True) with subdatasets(state='present')
- Replace deprecated AnnexRepo.get_file_key() with get_file_annexinfo()
- Fix finalize() return-without-yield bug: when aggregate_metadata is
  unavailable, bare `return` dropped pipeline data preventing tag/cleanup/yield
- Replace distutils.version.LooseVersion with looseversion package
- Remove mock from test dependencies, add looseversion to install_requires
- Update tox.ini filterwarnings for datalad-deprecated internal warnings

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
- Drop EOL Python 3.7 and 3.8 from test matrix
- Add Python 3.12 and 3.13 to test matrix
- Update release workflow to use Python 3.13
- Fix typo: aggrement -> agreement in cfgs/common.cfg

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
The standalone mock package is no longer a dependency (unittest.mock
is standard since Python 3.3), so external_versions['mock'] returns
None causing a TypeError on comparison.

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
boto (last release 2018) is broken on Python 3.12+ due to its vendored
six. Make the import conditional so the rest of the test suite and
non-S3 pipelines work on modern Python. S3 crawling will raise a clear
ImportError at runtime if boto is not available.

Also mark boto dependency as python_version<"3.12" in setup.py.

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
boto (last release 2018) is broken on Python 3.12+ due to its vendored
six.  Replace all boto usage with boto3 via datalad's new S3Downloader
client API:

- Remove boto.s3.key.Key/Prefix/DeleteMarker imports
- Add _list_bucket() helper that paginates list_object_versions /
  list_objects_v2 and yields tagged dicts with '_type' key
- Update get_key_url() to accept entry dict + bucket_name
- Update get_version_for_key() to work with dicts and datetime objects
- Update crawl_s3.__call__() to use downloader.client / ._bucket_name,
  dict-based type checks, and inline FileStatus construction
- Handle ParamValidationError when authenticating with bucket-only URL
- Add boto3 as explicit core dependency in setup.py
- Add type annotations to all new/modified functions

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
@yarikoptic yarikoptic added the minor Increment the minor version when merged label Mar 12, 2026
@yarikoptic yarikoptic changed the title BF: Address datalad DeprecationWarnings for compatibility with datalad PR #7793 BF: Address datalad DeprecationWarnings for compatibility with datalad PR #7793, make compatible with boto3 by use of datalad interfaces Mar 12, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 39.70588% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.58%. Comparing base (2b7ef42) to head (1b824b4).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
datalad_crawler/nodes/s3.py 18.82% 69 Missing ⚠️
datalad_crawler/pipelines/gh.py 0.00% 4 Missing ⚠️
datalad_crawler/pipelines/xnat.py 20.00% 4 Missing ⚠️
datalad_crawler/nodes/annex.py 70.00% 1 Missing and 2 partials ⚠️
datalad_crawler/pipelines/crcns.py 0.00% 1 Missing ⚠️
datalad_crawler/pipelines/tests/test_gh.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
- Coverage   77.51%   76.58%   -0.93%     
==========================================
  Files          60       58       -2     
  Lines        4731     4733       +2     
  Branches      689      596      -93     
==========================================
- Hits         3667     3625      -42     
- Misses        902      947      +45     
+ Partials      162      161       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yarikoptic yarikoptic added the release Create a release when this pr is merged label Mar 12, 2026
@yarikoptic yarikoptic merged commit bf7c4c6 into master Mar 12, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged release Create a release when this pr is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant