Skip to content

Commit 034fc13

Browse files
committed
Use Astral uv
1 parent 7669791 commit 034fc13

File tree

3 files changed

+175
-27
lines changed

3 files changed

+175
-27
lines changed

.github/workflows/project_euler.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,21 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18+
- uses: astral-sh/setup-uv@v4
1819
- uses: actions/setup-python@v5
1920
with:
2021
python-version: 3.x
21-
- name: Install pytest and pytest-cov
22-
run: |
23-
python -m pip install --upgrade pip
24-
python -m pip install --upgrade numpy pytest pytest-cov
25-
- run: pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
22+
- run: uv sync --group=euler-validate
23+
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
2624
validate-solutions:
2725
runs-on: ubuntu-latest
2826
steps:
2927
- uses: actions/checkout@v4
28+
- uses: astral-sh/setup-uv@v4
3029
- uses: actions/setup-python@v5
3130
with:
3231
python-version: 3.x
33-
- name: Install pytest and requests
34-
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install --upgrade numpy pytest requests
37-
- run: pytest scripts/validate_solutions.py
32+
- run: uv sync --group=euler-validate
33+
- run: uv run pytest scripts/validate_solutions.py
3834
env:
3935
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

+20-8
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,25 @@ dependencies = [
3030
"xgboost>=2.1.3",
3131
]
3232

33-
optional-dependencies.docs = [
34-
"myst-parser",
35-
"sphinx-autoapi",
36-
"sphinx-pyproject",
33+
[dependency-groups]
34+
dev = [
35+
"pytest>=8.3.4",
36+
"pytest-cov>=6",
37+
]
38+
docs = [
39+
"myst-parser>=4",
40+
"sphinx-autoapi>=3.4",
41+
"sphinx-pyproject>=0.3",
42+
]
43+
lint = [
44+
"codespell>=2.3",
45+
"ruff>=0.8.1",
46+
]
47+
euler-validate = [
48+
"numpy>=2.1.3",
49+
"pytest>=8.3.4",
50+
"pytest-cov>=6",
51+
"requests>=2.32.3",
3752
]
3853

3954
[tool.ruff]
@@ -150,10 +165,7 @@ lint.pylint.max-statements = 88 # default: 50
150165

151166
[tool.codespell]
152167
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
153-
skip = "./.*,*.json,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
154-
155-
[tool.pyproject-fmt]
156-
max_supported_python = "3.13"
168+
skip = "./.*,*.json,*.lock,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
157169

158170
[tool.pytest.ini_options]
159171
markers = [

0 commit comments

Comments
 (0)