From bddbb2749b34b2d7c12159286b535064d5c4878e Mon Sep 17 00:00:00 2001 From: Nitai Heeb Date: Tue, 3 Sep 2024 14:20:31 +0200 Subject: [PATCH] less prints --- src/hermes/commands/deposit/invenio.py | 9 +++------ src/hermes/commands/init/github_secrets.py | 5 ----- src/hermes/commands/init/tmp_hermes_github_to_zenodo.yml | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/hermes/commands/deposit/invenio.py b/src/hermes/commands/deposit/invenio.py index 8307b3b5..0e744ae3 100644 --- a/src/hermes/commands/deposit/invenio.py +++ b/src/hermes/commands/deposit/invenio.py @@ -263,18 +263,15 @@ def __init__(self, command: HermesDepositCommand, ctx: CodeMetaContext, client=N self.invenio_ctx = None self.config = getattr(self.command.settings, self.platform_name) - _log.error(f"Token Secret: {self.config.auth_token}") - _log.error(f"Client is none: {str(client is None)}") - if client is None: auth_token = self.config.auth_token # If auth_token is a refresh-token, get the auth-token from that. if str(auth_token).startswith("REFRESH_TOKEN:"): - _log.error(f"Getting token from refresh_token {auth_token}") + _log.debug(f"Getting token from refresh_token {auth_token}") get_token_from_refresh_token(auth_token.split("REFRESH_TOKEN:")[1]) - _log.error(f"Token: {os.environ.get('ZENODO_TOKEN')}") - _log.error(f"Refresh Token: {os.environ.get('ZENODO_TOKEN_REFRESH')}") + _log.debug(f"Token: {os.environ.get('ZENODO_TOKEN')}") + _log.debug(f"Refresh Token: {os.environ.get('ZENODO_TOKEN_REFRESH')}") auth_token = os.environ.get('ZENODO_TOKEN') if not auth_token: raise DepositionUnauthorizedError("No valid auth token given for deposition platform") diff --git a/src/hermes/commands/init/github_secrets.py b/src/hermes/commands/init/github_secrets.py index 1d1d23d3..64c1f1fd 100644 --- a/src/hermes/commands/init/github_secrets.py +++ b/src/hermes/commands/init/github_secrets.py @@ -27,10 +27,6 @@ def create_secret(project_url: str, secret_name: str, secret_value, token = ""): public_key_url = f"{repo_url}/actions/secrets/public-key" secrets_url = f"{repo_url}/actions/secrets/{secret_name}" - print(repo_url) - print(public_key_url) - print(secrets_url) - # Headers for GitHub API requests headers = { 'Authorization': f'token {token}', @@ -43,7 +39,6 @@ def create_secret(project_url: str, secret_name: str, secret_value, token = ""): public_key_data = response.json() key_id = public_key_data['key_id'] public_key = public_key_data['key'] - print(f"Public Key Data {public_key_data}") else: raise Exception(f"Failed to retrieve public key: {response.status_code} {response.text}") diff --git a/src/hermes/commands/init/tmp_hermes_github_to_zenodo.yml b/src/hermes/commands/init/tmp_hermes_github_to_zenodo.yml index 62074328..00c63254 100644 --- a/src/hermes/commands/init/tmp_hermes_github_to_zenodo.yml +++ b/src/hermes/commands/init/tmp_hermes_github_to_zenodo.yml @@ -92,7 +92,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.10' - - run: pip install hermes + - run: pip install git+https://github.com/softwarepub/hermes.git@feature/init-command # ADAPT # If you want to publish artifacts (e.g., a zipped snapshot of your repository),