From 2cb628e851beeeaa71fce9963f44e26921679327 Mon Sep 17 00:00:00 2001 From: mamu Date: Mon, 27 May 2024 14:40:55 +0900 Subject: [PATCH 1/2] Remove unnecessary auth --- recipes/001_first.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/recipes/001_first.py b/recipes/001_first.py index 00937f9e..f8f53788 100644 --- a/recipes/001_first.py +++ b/recipes/001_first.py @@ -29,10 +29,8 @@ # First of all, import `optuna`, `optunahub`, and other required modules. from __future__ import annotations -import os from typing import Any -from github import Auth import matplotlib.pyplot as plt import numpy as np import optuna @@ -47,10 +45,7 @@ # `force_reload=True` argument forces downloading the sampler from the registry. # If we set `force_reload` to `False`, we use the cached data in our local storage if available. -SimpleSampler = optunahub.load_module( - "samplers/simple", - auth=Auth.Token(os.environ["SECRET_GITHUB_TOKEN"]), -).SimpleSampler +SimpleSampler = optunahub.load_module("samplers/simple").SimpleSampler class MySampler(SimpleSampler): # type: ignore From fd2960e90a98c61a1b7474e9ac205f294e035634 Mon Sep 17 00:00:00 2001 From: mamu Date: Mon, 27 May 2024 14:46:34 +0900 Subject: [PATCH 2/2] Do not use secret --- .github/workflows/github-pages.yaml | 5 +---- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index 714f8981..37aba443 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -21,17 +21,14 @@ jobs: with: python-version: 3.11 - name: Install - env: - SECRET_GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN }} run: | python -m pip install -U pip pip install --progress-bar off . pip install --progress-bar off PyGitHub - pip install --progress-bar off git+https://${SECRET_GITHUB_TOKEN}@github.com/optuna/optunahub.git + pip install --progress-bar off git+https://github.com/optuna/optunahub.git pip install --progress-bar off ".[docs]" - name: Build env: - SECRET_GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN }} OPTUNAHUB_NO_ANALYTICS: 1 run: | cd docs diff --git a/pyproject.toml b/pyproject.toml index 614ecce7..b4c75bef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ docs = [ "sphinx-gallery", "matplotlib", "optuna", - # "optunahub", + "optunahub", ] [project.urls]