You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This installs NVIDIA GPU-Accelerated Portfolio Optimization in editable mode along with development tools like `black`, `isort`, `flake8`, and `pre-commit`.
64
+
This automatically creates a virtual environment and installs the project in editable mode along with development tools like `black`, `isort`, `flake8`, and `pre-commit`.
61
65
62
66
4.**Set Up Pre-commit Hooks**
63
67
64
68
```bash
65
-
pre-commit install
69
+
uv run pre-commit install
66
70
```
67
71
68
72
This will automatically run code formatting and linting checks before each commit.
@@ -74,7 +78,8 @@ For a consistent development environment with all GPU dependencies:
74
78
```bash
75
79
docker run --gpus all -it --rm -v $(pwd):/workspace nvcr.io/nvidia/pytorch:25.08-py3
76
80
cd /workspace
77
-
pip install -e ".[dev]"
81
+
curl -LsSf https://astral.sh/uv/install.sh | sh
82
+
uv sync --extra dev
78
83
```
79
84
80
85
## Coding Standards
@@ -97,8 +102,8 @@ All code must be formatted with:
97
102
Run formatters before committing:
98
103
99
104
```bash
100
-
black .
101
-
isort .
105
+
uv run black .
106
+
uv run isort .
102
107
```
103
108
104
109
Or let pre-commit hooks handle it automatically.
@@ -108,7 +113,7 @@ Or let pre-commit hooks handle it automatically.
108
113
We use `flake8` for linting. Run it with:
109
114
110
115
```bash
111
-
flake8 src/
116
+
uv run flake8 src/
112
117
```
113
118
114
119
### Documentation
@@ -151,13 +156,13 @@ We encourage comprehensive testing of all new features and bug fixes.
151
156
152
157
```bash
153
158
# Run all tests
154
-
pytest
159
+
uv run pytest
155
160
156
161
# Run specific test file
157
-
pytest tests/test_cvar_optimizer.py
162
+
uv run pytest tests/test_cvar_optimizer.py
158
163
159
164
# Run with coverage
160
-
pytest --cov=src --cov-report=html
165
+
uv run pytest --cov=src --cov-report=html
161
166
```
162
167
163
168
### Writing Tests
@@ -220,10 +225,10 @@ Explain what changes were made and why.
**Note:** The PyTorch container already includes CUDA and other GPU dependencies. This installation adds the optimization and ML libraries (cuOpt, cuML).
132
+
**Note:** The PyTorch container already includes CUDA and other GPU dependencies. This installation adds the optimization and ML libraries (cuOpt, cuML). The `uv sync` command automatically creates a virtual environment and installs all dependencies from `uv.lock`.
0 commit comments