From 19ef31a2d190b45a59e425511dc7a07904c6a2d2 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Thu, 4 Jan 2024 14:33:41 -0500 Subject: [PATCH 01/10] Happy new year --- LICENSE | 2 +- bayeso/__init__.py | 6 +++--- docs/conf.py | 4 ++-- setup.py | 5 +++-- tests/common/test_version.py | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/LICENSE b/LICENSE index afdc550..e21135c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2023 Jungtaek Kim +Copyright (c) 2017-2024 Jungtaek Kim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bayeso/__init__.py b/bayeso/__init__.py index b29cf33..12addba 100644 --- a/bayeso/__init__.py +++ b/bayeso/__init__.py @@ -1,9 +1,9 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: November 28, 2022 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: January 4, 2024 # """BayesO is a simple, but essential Bayesian optimization package, implemented in Python.""" -__version__ = '0.5.5' +__version__ = '0.6.0' diff --git a/docs/conf.py b/docs/conf.py index 5be90ee..aa88e51 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,11 +20,11 @@ # -- Project information ----------------------------------------------------- project = 'BayesO' -copyright = '2017-2023, Jungtaek Kim and Seungjin Choi' +copyright = '2017-2024, Jungtaek Kim and Seungjin Choi' author = 'Jungtaek Kim and Seungjin Choi' # The short X.Y version -version = '0.5.5' +version = '0.6.0' # The full version, including alpha/beta/rc tags release = '{} alpha'.format(version) diff --git a/setup.py b/setup.py index 1eafb73..5c18002 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ import sys from pathlib import Path + if (sys.version_info.major == 3 and sys.version_info.minor == 7) or\ (sys.version_info.major == 3 and sys.version_info.minor == 8) or\ (sys.version_info.major == 3 and sys.version_info.minor == 9) or\ @@ -31,9 +32,9 @@ setup( name='bayeso', - version='0.5.5', + version='0.6.0', author='Jungtaek Kim', - author_email='jtkim@postech.ac.kr', + author_email='jungtaek.kim.mail@gmail.com', url='https://bayeso.org', license='MIT', description='Simple, but essential Bayesian optimization package', diff --git a/tests/common/test_version.py b/tests/common/test_version.py index 81e0145..eae0819 100644 --- a/tests/common/test_version.py +++ b/tests/common/test_version.py @@ -1,11 +1,11 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: November 28, 2022 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: January 4, 2024 # """test_import""" -STR_VERSION = '0.5.5' +STR_VERSION = '0.6.0' def test_version_bayeso(): import bayeso From 07a345512137879ccd0e4e1f1bfe4def6817b1dc Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:46:33 -0400 Subject: [PATCH 02/10] Add pyproject.toml --- pyproject.toml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7470d93 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,74 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools", +] + +[tool.setuptools] +packages = [ + "bayeso", + "bayeso.bo", + "bayeso.gp", + "bayeso.tp", + "bayeso.trees", + "bayeso.wrappers", + "bayeso.utils", +] + +[project] +name = "bayeso" +version = "0.6.0" +authors = [ + {name = "Jungtaek Kim", email = "jungtaek.kim.mail@gmail.com"}, +] +description = "Simple, but essential Bayesian optimization package" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "numpy", + "scipy", + "cma", + "tqdm", +] +license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python :: 3", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] + +[project.urls] +Homepage = "https://bayeso.org" +Source = "https://github.com/jungtaekkim/bayeso" +Issues = "https://github.com/jungtaekkim/bayeso/issues" + +[project.optional-dependencies] +dev = [ + "pytest", + "pytest-benchmark", + "pytest-timeout", + "pytest-cov", + "coveralls", + "sphinx", + "sphinx_rtd_theme", + "jupyter", + "jupytext", + "pylint", + "wheel", + "build", + "twine", +] + +optional = [ + "scipydirect", + "matplotlib", + "bayeso-benchmarks", +] + +examples = [ + "xgboost", + "scikit-learn", +] From 223093b7a4e3ff108e25300d6e607b287d8228fc Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:47:11 -0400 Subject: [PATCH 03/10] Remove requirements*.txt --- requirements-dev.txt | 10 ---------- requirements-examples.txt | 2 -- requirements-optional.txt | 3 --- requirements.txt | 4 ---- 4 files changed, 19 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements-examples.txt delete mode 100644 requirements-optional.txt delete mode 100644 requirements.txt diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index dbbfad8..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,10 +0,0 @@ -pytest -pytest-benchmark -pytest-timeout -coveralls -sphinx -sphinx_rtd_theme -jupyter -pylint -jupytext -twine diff --git a/requirements-examples.txt b/requirements-examples.txt deleted file mode 100644 index c67f162..0000000 --- a/requirements-examples.txt +++ /dev/null @@ -1,2 +0,0 @@ -xgboost -scikit-learn diff --git a/requirements-optional.txt b/requirements-optional.txt deleted file mode 100644 index aef7cb7..0000000 --- a/requirements-optional.txt +++ /dev/null @@ -1,3 +0,0 @@ -scipydirect -matplotlib -bayeso-benchmarks diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e1ac1e0..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy -scipy -cma -tqdm From 26233fb37fe166bda15e918074d5f6df2bcb9421 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:47:21 -0400 Subject: [PATCH 04/10] Update README.md --- README.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 16f3155..a99740d 100644 --- a/README.md +++ b/README.md @@ -33,22 +33,22 @@ $ pip install bayeso * Using source code (for developer installation) -To install `bayeso` from source code, command +To install `bayeso` from source code, command the following in the `bayeso` root. ```shell -$ pip install . +pip install . ``` -in the `bayeso` root. * Using source code (for editable development mode) -To use editable development mode, command +To use editable development mode, command the following in the `bayeso` root. ```shell -$ pip install -r requirements.txt -$ python setup.py develop +pip install -e . ``` -in the `bayeso` root. + +If you want to install the packages required for optional features, development, and examples, you can simply add `[optional]`, `[dev]`, and `[examples]`. +For example, `pip install .[dev]` or `pip install -e .[dev]`. * Uninstallation @@ -58,14 +58,6 @@ If you would like to uninstall `bayeso`, command it. $ pip uninstall bayeso ``` -## Required Packages -Mandatory pacakges are inlcuded in `requirements.txt`. -The following `requirements` files include the package list, the purpose of which is described as follows. - -* `requirements-optional.txt`: It is an optional package list, but it needs to be installed to execute some features of `bayeso`. -* `requirements-dev.txt`: It is for developing the `bayeso` package. -* `requirements-examples.txt`: It needs to be installed to execute the examples included in the `bayeso` repository. - ## Supported Python Version We test our package in the following versions. From 59d45ad7aad115311eff8191c9f0ca82bec3c690 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:47:43 -0400 Subject: [PATCH 05/10] Update publish_new_release.txt and pytest.yml --- .github/workflows/pytest.yml | 9 ++++----- MANIFEST.in | 2 -- publish_new_release.txt | 21 +++++++++------------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 105a613..766838f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,14 +18,13 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install this project and its dependencies run: | - python -m pip install --upgrade pip setuptools - pip install pytest pytest-cov pytest-timeout + pip install --upgrade pip + pip install .[dev] + pip list - name: Run pytest run: | - set -e - pip install -e .[test] pytest tests/common --cov shell: bash - uses: AndreMiras/coveralls-python-action@v20201129 diff --git a/MANIFEST.in b/MANIFEST.in index 8d6df54..73f5145 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,2 @@ include CODE_OF_CONDUCT.md include LICENSE -include requirements.txt -include requirements-optional.txt diff --git a/publish_new_release.txt b/publish_new_release.txt index a5bd272..15eb92e 100644 --- a/publish_new_release.txt +++ b/publish_new_release.txt @@ -1,29 +1,26 @@ +# 0. (If needed) Install setuptools, wheel, build, and twine. + # 1. Merge a working branch to the main branch first. # 2. Clone the main branch in a new clean directory. -# 3. (If needed) Install setuptools and wheel. - -# 4. Create wheel and source files. -python2 setup.py sdist bdist_wheel (deprecated) -python3 setup.py sdist bdist_wheel - -# 5. (If needed) Install twine. +# 3. Create wheel and source files. +python3 -m build -# 6. Upload wheel and source files to the PyPI repository. -twine upload dist/* +# 4. Upload wheel and source files to the PyPI repository. +python3 -m twine upload dist/* -# 7. (Optional) Upload to Anaconda repository. +# 5. (Optional) Upload to Anaconda repository. ~/anaconda3/bin/anaconda upload dist/*.tar.gz # or anaconda upload dist/*.tar.gz -# 8. Publish a new release at GitHub. +# 6. Publish a new release at GitHub. ## Create a tag at GitHub. ## Make sure that it is created in the main branch. ## Assign the tag to a new release. ## The name convention of tags is "v0.5.5". ## Upload the wheel and source files, which can be downloaded from the PyPI repository, together. -# 9. Check out Zenodo or upload the release on Zenodo. +# 7. Check out Zenodo or upload the release on Zenodo. ## To upload the release, download a ZIP file from a particular tag. From fba34b9c2a8f00f523acecf3889e2a2d21fe199b Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:52:37 -0400 Subject: [PATCH 06/10] Remove setup.py --- setup.py | 56 -------------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 5c18002..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -from setuptools import setup -import os -import sys -from pathlib import Path - - -if (sys.version_info.major == 3 and sys.version_info.minor == 7) or\ - (sys.version_info.major == 3 and sys.version_info.minor == 8) or\ - (sys.version_info.major == 3 and sys.version_info.minor == 9) or\ - (sys.version_info.major == 3 and sys.version_info.minor == 10) or\ - (sys.version_info.major == 3 and sys.version_info.minor == 11): - print(f'[SETUP] bayeso supports Python {sys.version_info.major}.{sys.version_info.minor} version in this system.') -else: - sys.exit(f'[ERROR] bayeso does not support Python {sys.version_info.major}.{sys.version_info.minor} version in this system.') - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() - -path_requirements = 'requirements.txt' -list_packages = [ - 'bayeso', - 'bayeso.bo', - 'bayeso.gp', - 'bayeso.tp', - 'bayeso.trees', - 'bayeso.wrappers', - 'bayeso.utils' -] - -with open(path_requirements) as f: - required = f.read().splitlines() - -setup( - name='bayeso', - version='0.6.0', - author='Jungtaek Kim', - author_email='jungtaek.kim.mail@gmail.com', - url='https://bayeso.org', - license='MIT', - description='Simple, but essential Bayesian optimization package', - long_description=long_description, - long_description_content_type='text/markdown', - packages=list_packages, - python_requires='>=3.7, <4', - install_requires=required, - classifiers=[ - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: MIT License', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] -) From 6f9904ee4a91e49639c5cecad5e0d71f4b60e8db Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 16:52:47 -0400 Subject: [PATCH 07/10] Update pylint.yml --- .github/workflows/pylint.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 554e0bf..0eab482 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -19,11 +19,11 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install this project and its dependencies run: | - python -m pip install --upgrade pip setuptools - pip install pylint - pip install . + pip install --upgrade pip + pip install .[dev] + pip list - name: Analyze the code with pylint run: | pylint --rcfile=.pylintrc bayeso/ From fdd1a6e5677aad032f9f13199bf1d6ba634a28e0 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 17:00:10 -0400 Subject: [PATCH 08/10] Update .readthedocs.yml --- .readthedocs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index f3ece1e..fe8ef9b 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -15,6 +15,5 @@ formats: python: install: - - requirements: requirements.txt - - requirements: requirements-optional.txt - - requirements: requirements-dev.txt + - method: pip + path: .[dev] From b4efbb907a970dc5a63ea252ca42ac16e3fa6cbb Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 17:09:37 -0400 Subject: [PATCH 09/10] Update installation.rst --- docs/getting_started/installation.rst | 32 ++++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/docs/getting_started/installation.rst b/docs/getting_started/installation.rst index 9f7b274..3190ec9 100644 --- a/docs/getting_started/installation.rst +++ b/docs/getting_started/installation.rst @@ -18,26 +18,33 @@ Compiling from Source ===================== It is for developer installation. -To install **bayeso** from source code, command +To install **bayeso** from source code, command it in the **bayeso** root. .. code-block:: console $ pip install . -in the **bayeso** root. - Compiling from Source (Editable) ================================ It is for editable development mode. -To use editable development mode, command +To use editable development mode, command it in the **bayeso** root. + +.. code-block:: console + + $ pip install -e . + +If you want to install the packages required for optional features, development, and examples, +you can simply add **[optional]**, **[dev]**, and **[examples]**. +For example, you can command it for installing the packages required for development. .. code-block:: console + $ pip install .[dev] - $ pip install -r requirements.txt - $ python setup.py develop +or -in the **bayeso** root. +.. code-block:: console + $ pip install -e .[dev] Uninstalling ============ @@ -47,14 +54,3 @@ If you would like to uninstall **bayeso**, command it. .. code-block:: console $ pip uninstall bayeso - -Required Packages -================= - -Mandatory pacakges are inlcuded in **requirements.txt**. -The following **requirements** files include the package list, the purpose of which is described as follows. - -- **requirements-optional.txt**: It is an optional package list, but it needs to be installed to execute some features of **bayeso**. -- **requirements-dev.txt**: It is for developing the **bayeso** package. -- **requirements-examples.txt**: It needs to be installed to execute the examples included in the **bayeso** repository. - From a744dccec31ca171f2a8a74e2970d8cce25965b4 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 17:12:26 -0400 Subject: [PATCH 10/10] Update installation.rst --- docs/getting_started/installation.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/getting_started/installation.rst b/docs/getting_started/installation.rst index 3190ec9..ebfc032 100644 --- a/docs/getting_started/installation.rst +++ b/docs/getting_started/installation.rst @@ -39,11 +39,13 @@ you can simply add **[optional]**, **[dev]**, and **[examples]**. For example, you can command it for installing the packages required for development. .. code-block:: console + $ pip install .[dev] or .. code-block:: console + $ pip install -e .[dev] Uninstalling