Skip to content

Commit 9f50f6d

Browse files
committed
Switch to uv.lock for dependency management
- Replace requirements.txt files with uv.lock - Update Makefile to use 'uv sync' instead of pip-compile workflow - Simplify dependency management with 'uv lock' and 'uv sync --all-extras' - Update test and lint commands to use 'uv run' - Remove old requirements.txt, requirements-dev.txt, requirements-test.txt files - Update README documentation to reflect uv.lock workflow - Version bump to 2.2.4
1 parent a20ca32 commit 9f50f6d

File tree

10 files changed

+1415
-439
lines changed

10 files changed

+1415
-439
lines changed

Makefile

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: setup compile-deps sync-deps clean test lint init-tools local-dev first-time-setup update-deps dev-setup sync-all first-time-local-setup
1+
.PHONY: setup sync clean test lint update-lock local-dev first-time-setup dev-setup sync-all first-time-local-setup
22

33
# Environment variable for local SDK path (optional)
44
SOCKET_SDK_PATH ?= ../socketdev
@@ -16,44 +16,37 @@ first-time-local-setup:
1616
$(MAKE) clean
1717
$(MAKE) USE_LOCAL_SDK=true dev-setup
1818

19-
# Update dependencies after changing pyproject.toml
20-
update-deps: compile-deps sync-deps
19+
# Update lock file after changing pyproject.toml
20+
update-lock:
21+
uv lock
2122

2223
# Setup for local development
2324
dev-setup: clean local-dev setup
2425

2526
# Sync all dependencies after pulling changes
26-
sync-all: sync-deps
27+
sync-all: sync
2728

2829
# === Implementation targets ===
2930

30-
# Creates virtual environment and installs uv
31-
init-tools:
32-
python3 -m venv .venv
33-
. .venv/bin/activate && pip install uv
34-
3531
# Installs dependencies needed for local development
3632
# Currently: socketdev from test PyPI or local path
37-
local-dev: init-tools
33+
local-dev:
3834
ifeq ($(USE_LOCAL_SDK),true)
39-
. .venv/bin/activate && uv pip install -e $(SOCKET_SDK_PATH)
35+
uv add --editable $(SOCKET_SDK_PATH)
4036
endif
4137

42-
# Creates/updates requirements.txt files with locked versions based on pyproject.toml
43-
compile-deps: local-dev
44-
. .venv/bin/activate && uv pip compile --output-file=requirements.txt pyproject.toml
45-
. .venv/bin/activate && uv pip compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
46-
. .venv/bin/activate && uv pip compile --extra=test --output-file=requirements-test.txt pyproject.toml
47-
48-
# Creates virtual environment and installs dependencies from pyproject.toml
49-
setup: compile-deps
50-
. .venv/bin/activate && uv pip install -e ".[dev,test]"
38+
# Creates virtual environment and installs dependencies from uv.lock
39+
setup: update-lock
40+
uv sync --all-extras
41+
ifeq ($(USE_LOCAL_SDK),true)
42+
uv add --editable $(SOCKET_SDK_PATH)
43+
endif
5144

52-
# Installs exact versions from requirements.txt into your virtual environment
53-
sync-deps:
54-
. .venv/bin/activate && uv pip sync requirements.txt requirements-dev.txt requirements-test.txt
45+
# Installs exact versions from uv.lock into your virtual environment
46+
sync:
47+
uv sync --all-extras
5548
ifeq ($(USE_LOCAL_SDK),true)
56-
. .venv/bin/activate && uv pip install -e $(SOCKET_SDK_PATH)
49+
uv add --editable $(SOCKET_SDK_PATH)
5750
endif
5851

5952
# Removes virtual environment and cache files
@@ -62,8 +55,8 @@ clean:
6255
find . -type d -name "__pycache__" -exec rm -rf {} +
6356

6457
test:
65-
pytest
58+
uv run pytest
6659

6760
lint:
68-
ruff check .
69-
ruff format --check .
61+
uv run ruff check .
62+
uv run ruff format --check .

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,19 +392,17 @@ make sync-all
392392
High-level workflows:
393393
- `make first-time-setup`: Complete setup using PyPI packages
394394
- `make first-time-local-setup`: Complete setup for local SDK development
395-
- `make update-deps`: Update requirements.txt files and sync dependencies
395+
- `make update-lock`: Update uv.lock file after changing pyproject.toml
396396
- `make sync-all`: Sync dependencies after pulling changes
397397
- `make dev-setup`: Setup for local development (included in first-time-local-setup)
398398
399399
Implementation targets:
400-
- `make init-tools`: Creates virtual environment and installs uv
401400
- `make local-dev`: Installs dependencies needed for local development
402-
- `make compile-deps`: Generates requirements.txt files with locked versions
403-
- `make setup`: Creates virtual environment and installs dependencies
404-
- `make sync-deps`: Installs exact versions from requirements.txt
401+
- `make setup`: Creates virtual environment and installs dependencies from uv.lock
402+
- `make sync`: Installs exact versions from uv.lock
405403
- `make clean`: Removes virtual environment and cache files
406-
- `make test`: Runs pytest suite
407-
- `make lint`: Runs ruff for code formatting and linting
404+
- `make test`: Runs pytest suite using uv run
405+
- `make lint`: Runs ruff for code formatting and linting using uv run
408406
409407
### Environment Variables
410408

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.2.3"
9+
version = "2.2.4"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

requirements-dev.lock

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

requirements-dev.txt

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

0 commit comments

Comments
 (0)