cthoyt / zenodo-client

A tool for automated uploading and version management of scientific data to Zenodo
MIT License
25 stars 5 forks source link

"zenodo_client update" not usable #17

Closed mikegerber closed 1 year ago

mikegerber commented 1 year ago

We are having troubling with CLI:

zenodo_client update 12345678 some-file.dat

is not working and I believe that the @main.group should read @main.command here https://github.com/cthoyt/zenodo-client/blob/main/src/zenodo_client/cli.py#L46. Replacing that the command is at least doing something (still getting a 403 though, and I am not sure what the problem is.)

mikegerber commented 1 year ago

👀 @JoergLeh

cthoyt commented 1 year ago

~Is there a stack trace associated with this issue?~ ohh I see the problem. Do you want to submit a small PR to fix this?

mikegerber commented 1 year ago

I'd rather not, I never used the software and I am unable to make it work at the moment :)

[You fixed it already while I was typing]

mikegerber commented 1 year ago

@cthoyt Is zenodo_client update working for you now? I am not sure if our 403 is a problem with Zenodo/the token or the software.

cthoyt commented 1 year ago

I've uploaded a new version to PyPI (corresponding to https://github.com/cthoyt/zenodo-client/releases/tag/v0.3.2). Please let me know if that works. If you have any ideas on how to improve automated testing for this repository, they would be appreciated (I don't have the bandwidth to run CLI commands by hand to test this)

mikegerber commented 1 year ago

I'm unfortunately just a bystander - helping a colleague out with my Python know-how and have never in my life uploaded to Zenodo myself - but I'll think about it. With this stuff it's a it hard as you'd need to mock the API to do proper testing.

mikegerber commented 1 year ago

@JoergLeh Could you try updating, testing again and open a new issue if it still fails?

pyenv activate zenodo_client
pip install -U zenodo_client
# Check version
zenodo_client update ... etc ...
cthoyt commented 1 year ago

At a second glance, it appears that past me actually wrote tests for the whole lifecycle: https://github.com/cthoyt/zenodo-client/blob/main/tests/test_lifecycle.py

I think I added the CLI as an afterthought and never use it myself - but it seems like the update functions are well-tested!

joergleh commented 1 year ago

@mikegerber updated to zenodo_client-0.3.2, tested and failed again; got the response:

raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: FORBIDDEN for url: https://zenodo.org/api/deposit/depositions/7767404/actions/newversion?access_token=MY_ZENODO_TOKEN
cthoyt commented 1 year ago

Are you able to check that your authentication works properly using the given token?