From 12ca6e7dd489147d1564575f13b3e5c5e9a129d5 Mon Sep 17 00:00:00 2001 From: mamu Date: Fri, 17 May 2024 18:06:17 +0900 Subject: [PATCH 1/6] Add workflow dispatch --- .github/workflows/github-pages.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index 8ea807e3..714f8981 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -8,6 +8,7 @@ on: release: types: - published + workflow_dispatch: jobs: build: @@ -42,7 +43,7 @@ jobs: path: docs/build/html deploy: - if: github.event_name == 'push' + if: github.event_name != 'pull_request' needs: build permissions: pages: write From 879f884cd9803138a4a002330d4cca6e1478f960 Mon Sep 17 00:00:00 2001 From: Toshihiko Yanase Date: Fri, 17 May 2024 18:47:33 +0900 Subject: [PATCH 2/6] Add project urls. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7364407e..304256a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,9 +35,9 @@ docs = [ ] [project.urls] -homepage = "TBD" +homepage = "https://hub.optuna.org/" repository = "https://github.com/optuna/optunahub-registry" -documentation = "TBD" +documentation = "https://optuna.github.io/optunahub-registry/" bugtracker = "https://github.com/optuna/optunahub-registry/issues" [tool.setuptools.packages.find] From 5b26c11a20ee20703513d0e7defb95ac406708f3 Mon Sep 17 00:00:00 2001 From: mamu Date: Fri, 17 May 2024 18:57:16 +0900 Subject: [PATCH 3/6] Fix template header --- recipes/001_first.py | 4 ++-- template/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/001_first.py b/recipes/001_first.py index 467b53c4..111c5a08 100644 --- a/recipes/001_first.py +++ b/recipes/001_first.py @@ -132,10 +132,10 @@ def objective(trial: optuna.trial.Trial) -> float: # In the `samplers` directory, you should create a directory named after your algorithm. # In the directory, you should put the following files: # -# - `README.md`: A description of your algorithm. This file is used to create an `web page of OptunaHub `_. Let me explain the format of the `README.md` file later. +# - `README.md`: A description of your algorithm. This file is used to create an `web page of OptunaHub `_. Let me explain the format of the `README.md` file later. # - `__init__.py`: An initialization file. This file must import your impelemented sampler from `YOUR_ALGORITHM_NAME.py`. # - `LICENSE`: A license file. This file must contain the license of your algorithm. It should be the MIT license in the alpha version. -# - `images`: This is optional. A directory that contains images. You can put images that are used in the `web page of OptunaHub `_. Note that the image file named `thumbnail.png` is used as a thumbnail in the web page. If you want to put other images like `screenshot.png` and use them in the `README.md` file, please use the relative path like `images/screenshot.png`. +# - `images`: This is optional. A directory that contains images. You can put images that are used in the `web page of OptunaHub `_. Note that the image file named `thumbnail.png` is used as a thumbnail in the web page. If you want to put other images like `screenshot.png` and use them in the `README.md` file, please use the relative path like `images/screenshot.png`. # - `requirements.txt`: This is optional. A file that contains the additional dependencies of your algorithm. If there are no additional dependencies, you do not need to create this file. # - `YOUR_ALGORITHM_NAME.py`: Your implemented sampler. # diff --git a/template/README.md b/template/README.md index b2cff09b..fdbfb4dd 100644 --- a/template/README.md +++ b/template/README.md @@ -1,6 +1,3 @@ -Please read the [tutorial guide](TBD) to register your feature in OptunaHub. -You can find more detailed explanation of the following contents in the tutorial. - --- author: Please fill in the author name here. title: Please fill in the title of the feature here. @@ -10,6 +7,9 @@ optuna_versions: Please fill in the versions of Optuna in which you have confirm license: Please fill in the license name here. --- +Please read the [tutorial guide](https://optuna.github.io/optunahub-registry/recipes/001_first.html) to register your feature in OptunaHub. +You can find more detailed explanation of the following contents in the tutorial. + ## Class or Function Names Please fill in the class/function name which you implement here. From a2a1192e63d2b5305f0467192c14db4355ba125a Mon Sep 17 00:00:00 2001 From: Toshihiko Yanase Date: Fri, 17 May 2024 19:13:39 +0900 Subject: [PATCH 4/6] Rename CODE_OF_CONDUCT to CONTRIBUTING --- .github/pull_request_template.md | 4 ++-- CODE_OF_CONDUCT.md => CONTRIBUTING.md | 26 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) rename CODE_OF_CONDUCT.md => CONTRIBUTING.md (68%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3922e1fc..8ec7113e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,8 @@ ## Contributor Agreements -Please read the CODE_OF_CONDUCT.md and if you agree, please click the checkbox below. +Please read the [contributor agreements](CONTRIBUTING.md#contributor-agreements) and if you agree, please click the checkbox below. -- [ ] I agree to the code of conduct. +- [ ] I agree to the contributor agreements. ## Motivation diff --git a/CODE_OF_CONDUCT.md b/CONTRIBUTING.md similarity index 68% rename from CODE_OF_CONDUCT.md rename to CONTRIBUTING.md index f4cd64fe..7000bf2c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CONTRIBUTING.md @@ -1,9 +1,29 @@ -1. By making a contribution to this project, I certify that: +# Contribution Guidelines -(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file: +## Creating a Pull Request -(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or +When you are ready to create a pull request, please try to keep the following in mind. + +First, the **title** of your pull request should: + +- briefly describe and reflect the changes +- wrap any code with backticks +- not end with a period + +Second, the **description** of your pull request should: + +- describe the motivation +- describe the changes +- if still work-in-progress, describe remaining tasks +Finally, read [`contributor agreements`](#contributor-agreements) and if you agree, please click the checkbox + + +## Contributor Agreements + +1. By making a contribution to this project, I certify that: +(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file: +(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. 2. By making a contribution to this project, I agree that the MIT license applies to the contribution and the contribution is used by Preferred Networks (“PFN”) or third party under the MIT license. From 52e5420ebda6076a070e9cb9580d3cfa07a880af Mon Sep 17 00:00:00 2001 From: mamu Date: Fri, 17 May 2024 19:29:40 +0900 Subject: [PATCH 5/6] Add header confirmation CI --- .github/workflows/header-confirm.yaml | 20 ++++++++++++++++++++ optunahub-registry/header_confirm.py | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/header-confirm.yaml create mode 100644 optunahub-registry/header_confirm.py diff --git a/.github/workflows/header-confirm.yaml b/.github/workflows/header-confirm.yaml new file mode 100644 index 00000000..f7eef2f2 --- /dev/null +++ b/.github/workflows/header-confirm.yaml @@ -0,0 +1,20 @@ +name: Header Confirmation + +on: + push: + branches: + - main + pull_request: {} + +jobs: + header-confirm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: pip install python-frontmatter + - name: Confirm headers + run: python optunahub-registry/header_confirm.py diff --git a/optunahub-registry/header_confirm.py b/optunahub-registry/header_confirm.py new file mode 100644 index 00000000..f96735bc --- /dev/null +++ b/optunahub-registry/header_confirm.py @@ -0,0 +1,24 @@ +import os + +import frontmatter + + +def header_confirm(path: str) -> None: + post = frontmatter.load(path) + assert "author" in post.keys(), f"author is not found in {path}" + assert "title" in post.keys(), f"title is not found in {path}" + assert "description" in post.keys(), f"description is not found in {path}" + assert "tags" in post.keys(), f"tags is not found in {path}" + assert "optuna_versions" in post.keys(), f"optuna_versions is not found in {path}" + assert "license" in post.keys(), f"license is not found in {path}" + + +if __name__ == "__main__": + # Check all README files under the `package` directory. + for root, dirs, files in os.walk("package"): + for file in files: + if file == "README.md": + header_confirm(os.path.join(root, file)) + + # Check the template file. + header_confirm("template/README.md") From 10edc521e6ab8e5ef6dc9ea6e97acf75c2494519 Mon Sep 17 00:00:00 2001 From: mamu Date: Mon, 20 May 2024 11:47:03 +0900 Subject: [PATCH 6/6] Disable jekyll --- .nojekyll | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .nojekyll diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b