Skip to content

Commit b73c20f

Browse files
committed
Fix github workflow files to use uv
1 parent 6361ef5 commit b73c20f

5 files changed

Lines changed: 125 additions & 87 deletions

File tree

.github/workflows/code_checks.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: code checks
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
push:
@@ -8,7 +11,7 @@ on:
811
- .pre-commit-config.yaml
912
- .github/workflows/code_checks.yml
1013
- '**.py'
11-
- poetry.lock
14+
- uv.lock
1215
- pyproject.toml
1316
- '**.ipynb'
1417
pull_request:
@@ -18,7 +21,7 @@ on:
1821
- .pre-commit-config.yaml
1922
- .github/workflows/code_checks.yml
2023
- '**.py'
21-
- poetry.lock
24+
- uv.lock
2225
- pyproject.toml
2326
- '**.ipynb'
2427

@@ -27,22 +30,26 @@ jobs:
2730
runs-on: ubuntu-latest
2831
steps:
2932
- uses: actions/checkout@v4.2.2
30-
- name: Install and configure Poetry
31-
uses: snok/install-poetry@v1
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
3236
with:
33-
virtualenvs-create: true
34-
virtualenvs-in-project: true
35-
- uses: actions/setup-python@v5.6.0
37+
enable-cache: true
38+
39+
- name: "Set up Python"
40+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
3641
with:
37-
python-version: '3.10'
38-
cache: 'poetry'
42+
python-version-file: ".python-version"
43+
44+
- name: Install the project
45+
run: uv sync --all-extras --dev
46+
3947
- name: Install dependencies and check code
4048
run: |
41-
poetry env use '3.10'
4249
source .venv/bin/activate
43-
poetry install --with test --all-extras
4450
pre-commit run --all-files
45-
# - name: pip-audit (gh-action-pip-audit)
46-
# uses: pypa/gh-action-pip-audit@v1.0.8
47-
# with:
48-
# virtual-environment: .venv/
51+
52+
- name: pip-audit (gh-action-pip-audit)
53+
uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266
54+
with:
55+
virtual-environment: .venv/

.github/workflows/docs_build.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: docs (build)
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
pull_request:
@@ -11,7 +14,7 @@ on:
1114
- '**.ipynb'
1215
- '**.js'
1316
- '**.html'
14-
- poetry.lock
17+
- uv.lock
1518
- pyproject.toml
1619
- '**.rst'
1720
- '**.md'
@@ -20,28 +23,31 @@ jobs:
2023
build:
2124
runs-on: ubuntu-latest
2225
steps:
23-
- uses: actions/checkout@v4.2.2
24-
- name: Install dependencies, build docs and coverage report
25-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
26-
- uses: actions/setup-python@v5.6.0
26+
- name: Checkout code
27+
uses: actions/checkout@v4.2.2
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
31+
with:
32+
enable-cache: true
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
2736
with:
28-
python-version: '3.10'
29-
cache: 'poetry'
30-
- run: |
31-
python3 -m pip install --upgrade pip && python3 -m pip install poetry
32-
poetry env use '3.10'
33-
source $(poetry env info --path)/bin/activate
34-
poetry install --with docs,test
35-
cd docs && rm -rf source/reference/api/_autosummary && make html
36-
# cd .. && coverage run -m pytest -m "not integration_test" && coverage xml && coverage report -m
37+
python-version-file: ".python-version"
38+
39+
- name: Install the project
40+
run: uv sync --all-extras --dev
41+
42+
- name: Build docs
43+
run: |
44+
cd docs && rm -rf source/reference/api/_autosummary && uv run make html
45+
# cd .. && uv run coverage run -m pytest -m "not integration_test" && uv run coverage xml && uv run coverage report -m
46+
3747
# - name: Upload coverage to Codecov
38-
# uses: Wandalen/wretry.action@v1.4.4
48+
# uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
3949
# with:
40-
# action: codecov/codecov-action@v4.0.1
41-
# with: |
42-
# token: ${{ secrets.CODECOV_TOKEN }}
43-
# file: ./coverage.xml
44-
# name: codecov-umbrella
45-
# fail_ci_if_error: true
46-
# attempt_limit: 5
47-
# attempt_delay: 30000
50+
# token: ${{ secrets.CODECOV_TOKEN }}
51+
# slug: VectorInstitute/AtomGen
52+
# fail_ci_if_error: true
53+
# verbose: true

.github/workflows/docs_deploy.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: docs
2+
permissions:
3+
contents: write
4+
pull-requests: write
25

36
on:
47
push:
@@ -14,7 +17,7 @@ on:
1417
- '**.ipynb'
1518
- '**.html'
1619
- '**.js'
17-
- poetry.lock
20+
- uv.lock
1821
- pyproject.toml
1922
- '**.rst'
2023
- '**.md'
@@ -23,33 +26,37 @@ jobs:
2326
deploy:
2427
runs-on: ubuntu-latest
2528
steps:
26-
- uses: actions/checkout@v4.2.2
29+
- name: Checkout code
30+
uses: actions/checkout@v4.2.2
2731
with:
2832
submodules: 'true'
29-
- name: Install dependencies, build docs and coverage report
30-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
31-
- uses: actions/setup-python@v5.6.0
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
36+
with:
37+
enable-cache: true
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
3241
with:
33-
python-version: '3.10'
34-
cache: 'poetry'
35-
- run: |
36-
python3 -m pip install --upgrade pip && python3 -m pip install poetry
37-
poetry env use '3.10'
38-
source $(poetry env info --path)/bin/activate
39-
poetry install --with docs,test
40-
cd docs && rm -rf source/reference/api/_autosummary && make html
41-
# cd .. && coverage run -m pytest -m "not integration_test" && coverage xml && coverage report -m
42+
python-version-file: ".python-version"
43+
44+
- name: Install the project
45+
run: uv sync --all-extras --dev
46+
47+
- name: Build docs
48+
run: |
49+
cd docs && rm -rf source/reference/api/_autosummary && uv run make html
50+
# cd .. && uv run coverage run -m pytest -m "not integration_test" && uv run coverage xml && uv run coverage report -m
51+
4252
# - name: Upload coverage to Codecov
43-
# uses: Wandalen/wretry.action@v1.4.4
53+
# uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
4454
# with:
45-
# action: codecov/codecov-action@v4.0.1
46-
# with: |
47-
# token: ${{ secrets.CODECOV_TOKEN }}
48-
# file: ./coverage.xml
49-
# name: codecov-umbrella
50-
# fail_ci_if_error: true
51-
# attempt_limit: 5
52-
# attempt_delay: 30000
55+
# token: ${{ secrets.CODECOV_TOKEN }}
56+
# slug: VectorInstitute/AtomGen
57+
# fail_ci_if_error: true
58+
# verbose: true
59+
5360
- name: Deploy to Github pages
5461
uses: JamesIves/github-pages-deploy-action@v4.7.3
5562
with:
Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: integration tests
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
push:
@@ -12,7 +15,7 @@ on:
1215
- .github/workflows/integration_tests.yml
1316
- '**.py'
1417
- '**.ipynb'
15-
- poetry.lock
18+
- uv.lock
1619
- pyproject.toml
1720
- '**.rst'
1821
- '**.md'
@@ -27,7 +30,7 @@ on:
2730
- .github/workflows/integration_tests.yml
2831
- '**.py'
2932
- '**.ipynb'
30-
- poetry.lock
33+
- uv.lock
3134
- pyproject.toml
3235
- '**.rst'
3336
- '**.md'
@@ -37,25 +40,29 @@ jobs:
3740
runs-on: ubuntu-latest
3841
steps:
3942
- uses: actions/checkout@v4.2.2
40-
- name: Install poetry
41-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
42-
- uses: actions/setup-python@v5.6.0
43+
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
46+
with:
47+
enable-cache: true
48+
49+
- name: "Set up Python"
50+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
4351
with:
44-
python-version: '3.10'
52+
python-version-file: ".python-version"
53+
54+
- name: Install the project
55+
run: uv sync --all-extras --dev
56+
4557
- name: Install dependencies and check code
4658
run: |
47-
poetry env use '3.10'
48-
source $(poetry env info --path)/bin/activate
49-
poetry install --with docs,test
50-
# coverage run -m pytest -m integration_test && coverage xml && coverage report -m
51-
# - name: Upload coverage to Codecov
52-
# uses: Wandalen/wretry.action@v1.4.4
53-
# with:
54-
# action: codecov/codecov-action@v4.0.1
55-
# with: |
56-
# token: ${{ secrets.CODECOV_TOKEN }}
57-
# file: ./coverage.xml
58-
# name: codecov-umbrella
59-
# fail_ci_if_error: true
60-
# attempt_limit: 5
61-
# attempt_delay: 30000
59+
uv run pytest -m "integration_test" --cov atomgen --cov-report=xml tests
60+
61+
# Uncomment this once this repo is configured on Codecov
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
slug: VectorInstitute/AtomGen
67+
fail_ci_if_error: true
68+
verbose: true

.github/workflows/publish.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: publish package
2+
permissions:
3+
contents: read
4+
id-token: write
25

36
on:
47
release:
@@ -12,14 +15,22 @@ jobs:
1215
run: |
1316
sudo apt-get update
1417
sudo apt-get install libcurl4-openssl-dev libssl-dev
18+
1519
- uses: actions/checkout@v4.2.2
16-
- name: Install poetry
17-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
18-
- uses: actions/setup-python@v5.6.0
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb
23+
with:
24+
enable-cache: true
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
1928
with:
20-
python-version: '3.10'
29+
python-version-file: ".python-version"
30+
2131
- name: Build package
22-
run: poetry build
32+
run: uv build
33+
2334
- name: Publish package
2435
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
2536
with:

0 commit comments

Comments
 (0)