Skip to content

Commit 1ed36e9

Browse files
committed
Updated
2 parents c873f96 + 14786ff commit 1ed36e9

38 files changed

+1269
-1429
lines changed

.github/workflows/build_docs.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,25 @@ concurrency:
1313

1414
jobs:
1515
build-docs-and-publish:
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-latest
1717
permissions:
1818
contents: write
1919
steps:
2020
- uses: actions/checkout@v3
21-
- name: Setup Python
22-
uses: actions/setup-python@v3
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
2323
with:
24-
python-version: '3.10'
24+
python-version: "3.10"
2525
- name: Get tag
2626
uses: olegtarasov/[email protected]
2727
- name: Install pandoc
2828
run: sudo apt-get install -y pandoc
29-
- name: Install Poetry
30-
uses: snok/install-poetry@v1
31-
with:
32-
version: 'latest'
3329
- name: Install package and test dependencies
34-
run: |
35-
poetry install --with dev,nbtools
30+
run: uv sync --extra dev
3631
- name: build sphinx docs
3732
run: |
3833
cd docsrc
39-
poetry run make github
34+
uv run make github
4035
- name: Determine directory to publish docs to
4136
id: docs-publish-dir
4237
uses: jannekem/run-python-script-action@v1

.github/workflows/format_and_lint.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Set up Python 3.9
17-
uses: actions/setup-python@v3
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
1818
with:
1919
python-version: "3.9"
20-
- name: Install Poetry
21-
uses: snok/install-poetry@v1
22-
with:
23-
version: 'latest'
2420
- name: Install dependencies
25-
run: |
26-
poetry install --with dev
21+
run: uv sync --extra dev
2722
- name: Run pre-commit
28-
run : poetry run pre-commit run --all-files --show-diff-on-failure --color=always
23+
run: uv run pre-commit run --all-files --show-diff-on-failure --color=always
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will upload a Python Package using poetry when a release is created
1+
# This workflow will upload a Python Package using uv when a release is created
22
# Note that you must manually update the version number in pyproject.toml before attempting this.
33

44
name: Upload Python Package
@@ -14,10 +14,10 @@ jobs:
1414
deploy:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Build and publish to pypi
19-
uses: JRubics/[email protected]
20-
with:
21-
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
22-
# python_version: "3.10"
23-
# poetry_version: "==1.8" # can lock versions if we want
17+
- uses: actions/checkout@v4
18+
- uses: astral-sh/setup-uv@v6
19+
- run: uv build
20+
- name: Publish to pypi
21+
env:
22+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
23+
run: uv publish --token "$PYPI_API_TOKEN"

.github/workflows/run_tests.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
1+
# This workflow will install Python dependencies and run tests in multiple versions of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

44
name: tests
@@ -25,31 +25,16 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v3
28-
- name: Set up Python
29-
uses: actions/setup-python@v3
28+
- name: Install uv and set the python version
29+
uses: astral-sh/setup-uv@v6
3030
with:
3131
python-version: ${{ matrix.python-version }}
32-
- name: Install the latest version of uv
33-
uses: astral-sh/setup-uv@v5
34-
with:
35-
version: "latest"
36-
- name: Install Poetry
37-
uses: snok/install-poetry@v1
38-
with:
39-
version: 'latest'
4032
- name: Install test dependencies
4133
run: |
42-
poetry self add poetry-plugin-export
43-
poetry export -f requirements.txt --with dev,nbtools --without-hashes --output requirements-dev.txt
44-
echo "numpy${{ matrix.numpy-version }}" >> constraints.txt
45-
uv pip compile requirements-dev.txt --output-file requirements.txt \
46-
--python-version ${{ matrix.python-version }} \
47-
--override constraints.txt
48-
poetry run pip install -r requirements.txt
49-
poetry install --only-root
50-
- name: Test with pytest
51-
run: |
52-
poetry run pytest --cov-report xml --cov=bayes_opt/
34+
uv sync --extra dev
35+
uv pip install "numpy${{ matrix.numpy-version}}"
36+
- name: Run pytest
37+
run: uv run --no-sync pytest --cov-report xml --cov=bayes_opt/
5338
- name: Upload coverage to Codecov
5439
uses: codecov/codecov-action@v4
5540
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ docsrc/static/*
3737
docsrc/README.md
3838

3939
poetry.lock
40+
uv.lock
4041

4142
# Add log files and optimizer state files to gitignore
4243
examples/logs.log

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ repos:
66
name: ruff-format
77
args: [--check]
88
repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.6.6
9+
rev: v0.12.3

bayes_opt/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55
import importlib.metadata
66

77
from bayes_opt import acquisition
8-
from bayes_opt.bayesian_optimization import BayesianOptimization, Events
8+
from bayes_opt.bayesian_optimization import BayesianOptimization
99
from bayes_opt.constraint import ConstraintModel
1010
from bayes_opt.domain_reduction import SequentialDomainReductionTransformer
11-
from bayes_opt.logger import JSONLogger, ScreenLogger
11+
from bayes_opt.logger import ScreenLogger
1212
from bayes_opt.target_space import TargetSpace
1313

1414
__version__ = importlib.metadata.version("bayesian-optimization")
1515

1616

1717
__all__ = [
18-
"acquisition",
1918
"BayesianOptimization",
20-
"TargetSpace",
2119
"ConstraintModel",
22-
"Events",
2320
"ScreenLogger",
24-
"JSONLogger",
2521
"SequentialDomainReductionTransformer",
22+
"TargetSpace",
23+
"acquisition",
2624
]

0 commit comments

Comments
 (0)