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

Remove --dry-run CLI option and references #326

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

samleonard
Copy link

@samleonard samleonard commented Apr 21, 2024

Overview

Closes #208.

What problem does this address?

The --dry-run option does not adequately simulate running the archiver, so it's better to rely on the --auto-publish option.

What did you change in this PR?

I removed all references to the --dry-run option.

Testing

How did you make sure this worked? How can a reviewer verify this?

To find all references to the flag I searched the repository for "dry".

I was not able to run any tests because the dependencies currently have a conflict. This repo stipulates "ruff>=0.3,<0.4" but the pudl repository recently updated ruff to 4.1.

Let me know if there are any testing steps I should take!

To-do list

Tasks

Edit tasklist title
Beta Give feedback Tasklist Tasks, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. add other TODO items here if necessary! questions that need to answered, decisions that need to be made, tests that need to be run, etc.
    Options
  2. Update relevant documentation - like comments, docstrings, README, release notes, etc.
    Options
  3. Review the PR yourself and call out any questions or issues you have
    Options

@jdangerx
Copy link
Member

Thanks, this does look like it should do the trick! Let's fix the ruff thing too - I think we should be totally fine to update ruff to >=0.4, <0.5 here. Then I think you should be able to install the environment and actually try things out!

You'll also need API tokens to test the Zenodo interactions. You should be able to create your own account on the Zenodo sandbox and get your API tokens that way - let me know if you run into hiccups there!

@samleonard
Copy link
Author

@jdangerx

I got my environment set up by adding running the following

conda env create -f environment.yml
conda init zsh # I needed this since I am new to conda
source ~/.zshrc # reload shell for conda init to take effect
conda activate pudl-cataloger
pip install .

Weirdly I then had to manually copy the zenodo_doi.yml file into /.../miniforge/base/envs/pudl-cataloger/lib/python3.12/site-packages/pudl_archiver/utils.py. Not sure what I did wrong.

For my api keys I created an account on the zenodo sandbox, went to Settings -> Applications -> Personal access tokens and created a token with publish and upload access, then exported that token value as ZENODO_SANDBOX_TOKEN_UPLOAD and ZENODO_SANDBOX_TOKEN_PUBLISH in my shell environment.

Running pudl_archiver --sandbox --datasets eia176 --dry-run prints the usage message, as expected.

Running the same command without --dry-run encounters the following error:

2024-05-01 15:06:48 [    INFO] catalystcoop.pudl_archiver.utils:57 Error while executing <coroutine object ZenodoAPIClient._make_requester.<locals>.requester.<locals>.run_request at 0x17e40fe20> (try #6, retry in 64s): <class 'pudl_archiver.depositors.zenodo.depositor.ZenodoClientError'> - ZenodoClientError(status=403, message=Permission denied., errors=None)

Not sure what I did wrong to cause that either.

I'm new to basically all of these tools so apologies if the solutions are obvious!

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

Successfully merging this pull request may close these issues.

Remove --dry-run option in favor of --auto-publish
3 participants