Skip to content

Commit

Permalink
Revert "Try out switching from rye to uv"
Browse files Browse the repository at this point in the history
This reverts commit 7616826.
  • Loading branch information
lebrice committed Aug 23, 2024
1 parent 7616826 commit eec1563
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
27 changes: 9 additions & 18 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
"ghcr.io/devcontainers-contrib/features/apt-get-packages": {
"packages": "vim"
},
// "ghcr.io/e-gineering/devcontainer-features/rye:1": {},
"ghcr.io/va-h/devcontainers-features/uv:1": {}
},
"hostRequirements": {
"gpu": "optional"
"ghcr.io/e-gineering/devcontainer-features/rye:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
Expand Down Expand Up @@ -52,8 +48,6 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.experiments.optOutFrom": [
// Used so that `. .venv/bin/activate` is done properly when opening a terminal
// (We can often edit this activation script to load modules, etc).
"pythonTerminalEnvVarActivation"
],
"python.terminal.activateEnvInCurrentTerminal": false,
Expand All @@ -76,11 +70,12 @@
"SLURM_TMPDIR": "/tmp",
"NETWORK_DIR": "/network",
// used by rye (fixed issues with symlinked .cache dir to $SCRATCH)
"UV_LINK_MODE": "symlink",
"UV_CACHE_DIR": "/home/vscode/scratch/.cache/uv"
"UV_LINK_MODE": "symlink"
},
"mounts": [
// https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount
// Mount a directory which will contain the pdm installation cache (shared with the host machine).
// This will use $SCRATCH/.cache/pdm, otherwise
// Mount a "$SCRATCH" directory in the host to ~/scratch in the container.
"source=${localEnv:SCRATCH},target=/home/vscode/scratch,type=bind,consistency=cached",
// Mount a /network to match the /network directory on the host.
Expand All @@ -96,22 +91,18 @@
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,readonly"
],
"runArgs": [
// TODO: This should be commented when we don't have a GPU.
// Perhaps we need a different devcontainer file for with/without GPU? :(
// "--gpus",
// "all",
// "--ipc=host"
"--gpus",
"all",
"--ipc=host"
],
// create the pdm cache dir on the host machine if it doesn exist yet so the mount above
// doesn't fail.
"initializeCommand": {
// this is fine on compute nodes
"create fake SLURM_TMPDIR": "mkdir -p ${SLURM_TMPDIR:-/tmp/slurm_tmpdir}",
"create fake SLURM_TMPDIR": "mkdir -p ${SLURM_TMPDIR:-/tmp/slurm_tmpdir}", // this is fine on compute nodes
"create ssh cache dir": "mkdir -p ~/.cache/ssh"
},
"onCreateCommand": {
"pre-commit": "pre-commit install --install-hooks",
"uv sync": "uv sync --all-extras"
"pre-commit": "pre-commit install --install-hooks"
},
"updateContentCommand": {
// BUG: doesn't work atm. Perhaps some permission issues?
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ indent-width = 4
lint.select = ["E4", "E7", "E9", "F", "I", "UP"]


[tool.uv]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.3.2",
Expand All @@ -85,8 +85,8 @@ allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["project"]

# [tool.uv.scripts]
# serve-docs = "mkdocs serve"
# check_torch_gpu = "python -c 'import torch; print(torch.cuda.is_available())'"
# check_jax_gpu = "python -c 'import jax.numpy as jnp; print(jnp.zeros(1).devices())'"
# tests = "pytest -x -v"
[tool.rye.scripts]
serve-docs = "mkdocs serve"
check_torch_gpu = "python -c 'import torch; print(torch.cuda.is_available())'"
check_jax_gpu = "python -c 'import jax.numpy as jnp; print(jnp.zeros(1).devices())'"
tests = "pytest -x -v"

0 comments on commit eec1563

Please sign in to comment.