Skip to content

Commit

Permalink
Use Astral uv
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Dec 2, 2024
1 parent 7669791 commit 034fc13
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 27 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/project_euler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install pytest and pytest-cov
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade numpy pytest pytest-cov
- run: pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
- run: uv sync --group=euler-validate
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
validate-solutions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install pytest and requests
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade numpy pytest requests
- run: pytest scripts/validate_solutions.py
- run: uv sync --group=euler-validate
- run: uv run pytest scripts/validate_solutions.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 20 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,25 @@ dependencies = [
"xgboost>=2.1.3",
]

optional-dependencies.docs = [
"myst-parser",
"sphinx-autoapi",
"sphinx-pyproject",
[dependency-groups]
dev = [
"pytest>=8.3.4",
"pytest-cov>=6",
]
docs = [
"myst-parser>=4",
"sphinx-autoapi>=3.4",
"sphinx-pyproject>=0.3",
]
lint = [
"codespell>=2.3",
"ruff>=0.8.1",
]
euler-validate = [
"numpy>=2.1.3",
"pytest>=8.3.4",
"pytest-cov>=6",
"requests>=2.32.3",
]

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

[tool.codespell]
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
skip = "./.*,*.json,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"

[tool.pyproject-fmt]
max_supported_python = "3.13"
skip = "./.*,*.json,*.lock,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"

[tool.pytest.ini_options]
markers = [
Expand Down
Loading

0 comments on commit 034fc13

Please sign in to comment.