Skip to content

Commit 41c98e5

Browse files
committed
Use just uv instead of uv and poetry
1 parent 3e48bed commit 41c98e5

File tree

10 files changed

+38
-63
lines changed

10 files changed

+38
-63
lines changed

.github/workflows/build_docs.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,20 @@ jobs:
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 --extras dev --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 add "numpy${{ matrix.numpy-version}}"
36+
- name: Run pytest
37+
run: uv run 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

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ dev = [
4444
"sphinx-autodoc-typehints>=2.4.0; python_version>='3.10'",
4545
]
4646

47-
[tool.poetry]
48-
requires-poetry = ">=2.0"
49-
packages = [{ include = "bayes_opt" }]
50-
5147
[build-system]
52-
requires = ["poetry-core>=2.0"]
53-
build-backend = "poetry.core.masonry.api"
48+
requires = ["uv_build>=0.7.21,<0.8.0"]
49+
build-backend = "uv_build"
50+
51+
[tool.uv.build-backend]
52+
module-name = "bayes_opt"
53+
module-root = ""
5454

5555
[tool.coverage.report]
5656
exclude_lines = [

scripts/check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env sh
22
set -ex
33

4-
poetry run ruff format --check bayes_opt tests
5-
poetry run ruff check bayes_opt tests
4+
uv run ruff format --check bayes_opt tests
5+
uv run ruff check bayes_opt tests

scripts/check_precommit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env sh
22
set -ex
33

4-
poetry run pre-commit install
5-
poetry run pre-commit run --all-files --show-diff-on-failure
4+
uv run pre-commit install
5+
uv run pre-commit run --all-files --show-diff-on-failure

scripts/format.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env sh
22
set -ex
33

4-
poetry run ruff format bayes_opt tests
5-
poetry run ruff check bayes_opt --fix
6-
4+
uv run ruff format bayes_opt tests
5+
uv run ruff check bayes_opt --fix

0 commit comments

Comments
 (0)