Skip to content

Commit 1fabf64

Browse files
authored
Update project to use uv (#186)
1 parent cbdcf21 commit 1fabf64

8 files changed

Lines changed: 145 additions & 22 deletions

File tree

‎.github/workflows/Python.yml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
14-
13+
ci:
1514
runs-on: ubuntu-latest
1615

1716
steps:
@@ -20,10 +19,15 @@ jobs:
2019
uses: actions/setup-python@v6
2120
with:
2221
python-version: "3.14"
23-
- name: Install dependencies
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v9
24+
with:
25+
enable-cache: true
26+
- name: Install just
27+
uses: extractions/setup-just@v3
28+
- name: Setup environment
2429
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
30+
just sync
2731
- name: Lint
2832
run: |
2933
just lint

‎.vscode/settings.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"python.linting.enabled": true,
55
"python.linting.flake8Args": [
66
"--max-line-length=120",
7-
],
7+
]
88
}

‎Brewfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
brew "just"
2+
brew "uv"

‎README.md‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ to prevent obscuring the function and logic of the algorithms / data-structures.
3737

3838
## Project Setup
3939

40-
### Local development
40+
### Local Development Installation
4141

42-
* Install `pyenv`
43-
* Install current Python version: `pyenv install 3.12`
44-
* Set global Python version: `pyenv global 3.12`
45-
* Initialize virtual environment: `python -m venv .venv`
46-
* Activate: `source .venv/bin/activate`
47-
* Install packages: `pip install -r requirements.txt`
42+
Note: Project uses `uv` and `just` to manage project configuration and commands
43+
44+
* Install dependencies via Homebrew - `brew bundle install`
45+
* Sync project - `just sync`
4846

4947
### VS Code Dev Container
5048

@@ -54,5 +52,6 @@ to prevent obscuring the function and logic of the algorithms / data-structures.
5452

5553
## Project Commands
5654

57-
* Lint project - `flake8`
58-
* Run Unit Tests - `pytest`
55+
* Lint project - `just lint`
56+
* Sync uv environment - `just sync`
57+
* Run Unit Tests - `just test`

‎justfile‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
lint:
2-
ruff check . --fix && ruff format .
2+
uv run ruff check . --fix
3+
uv run ruff format .
4+
sync:
5+
uv sync --all-groups
36
test:
4-
pytest
7+
uv run pytest

‎pyproject.toml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
[project]
2+
name = "python-ds-algorithms"
3+
version = "0.0.1"
4+
requires-python = ">=3.14"
5+
6+
dependencies = []
7+
8+
[dependency-groups]
9+
dev = ["pytest", "ruff>=0.16.0"]
10+
111
[tool.ruff]
212
line-length = 100
3-
target-version = "py312"
13+
target-version = "py314"
414

515
[tool.ruff.lint]
616
select = ["E", "F", "W", "I", "N", "D"] # Choose your rule categories
@@ -11,4 +21,4 @@ extend-ignore = ["E501"] # Line too long (handled by formatter)
1121
"tests/*" = ["D"] # Ignore docstring (D) errors in tests
1222

1323
[tool.ruff.format]
14-
quote-style = "double"
24+
quote-style = "double"

‎requirements.txt‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎uv.lock‎

Lines changed: 108 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)