Skip to content

Conversation

@TomNicholas
Copy link
Member

I tried to run the ci/release_contributors.py script using uv, but got a weird error

tom@Toms-MacBook-Air xarray % uv run python ci/release_contributors.py
<class 'list'>
Traceback (most recent call last):
  File "/Users/tom/Documents/Work/Code/xarray/ci/release_contributors.py", line 51, in <module>
    main()
    ~~~~^^
  File "/Users/tom/Documents/Work/Code/xarray/ci/release_contributors.py", line 15, in main
    most_recent_release = last(repo.tags)
  File "/Users/tom/Documents/Work/Code/xarray/.venv/lib/python3.13/site-packages/toolz/itertoolz.py", line 407, in last
    return tail(1, seq)[0]
           ~~~~^^^^^^^^
  File "/Users/tom/Documents/Work/Code/xarray/.venv/lib/python3.13/site-packages/toolz/itertoolz.py", line 342, in tail
    return seq[-n:]
           ~~~^^^^^
  File "/Users/tom/Documents/Work/Code/xarray/.venv/lib/python3.13/site-packages/git/util.py", line 1208, in __getitem__
    raise ValueError("Index should be an int or str")
ValueError: Index should be an int or str

It seems to be a bug in the way toolz.last handles the type returned by repo.tags, because that type is iterable but not actually a list. I don't know which exact versions of dependencies this happens with, but I can fix it by just explicitly casting to a list, so this PR does that.

FYI @keewis

@TomNicholas TomNicholas added the CI Continuous Integration tools label Jul 3, 2025
@TomNicholas TomNicholas merged commit c192846 into pydata:main Jul 3, 2025
17 of 18 checks passed
@TomNicholas TomNicholas deleted the fix_release_contributors_script branch July 3, 2025 15:35
@keewis
Copy link
Collaborator

keewis commented Jul 3, 2025

it looks like this is an inconsistency between toolz and cytoolz: I had been using cytoolz (which works), but if I only have toolz installed it fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration tools topic-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants