Skip to content

Reconcile dependencies with colab and add dockerfile #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab_20240626-060133_RC01

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Verify existing packages (optional, for debugging)
RUN python -m pip list

# Set working directory
WORKDIR /app

# Configure uv to use system Python and packages
ENV UV_SYSTEM_PYTHON=1
ENV UV_PYTHON=/usr/local/bin/python

# Copy dependency files first (better layer caching)
COPY pyproject.toml .
COPY uv.lock* .
COPY README.md .

# Install dependencies while respecting system packages
RUN uv pip install --system -r pyproject.toml

# Copy application code
COPY src .

# If you need to install your package in development mode
RUN uv pip install --system -e .

# Set Python to unbuffered mode
ENV PYTHONUNBUFFERED=1

# Reset the entrypoint to nothing
ENTRYPOINT []

# Entrypoint
CMD ["mouse-tracking-runtime"]
64 changes: 36 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,40 @@ description = "Runtime environment for mouse tracking experiments"
requires-python = ">=3.10,<3.11"
packages = ["src/mouse_tracking"]
dependencies = [
"absl-py>=2.3.0",
"click==8.1.8",
"contourpy==1.3.2",
# Core scientific computing - exact versions from container
"numpy==1.25.2",
"scipy==1.11.4",
"pandas==2.0.3",
# Computer vision and image processing
"opencv-python==4.8.0.76",
"imageio==2.31.6",
"pillow==9.4.0",
# Plotting and visualization
"matplotlib==3.7.1",
"contourpy==1.2.1",
"cycler==0.12.1",
"fonttools==4.57.0",
"h5py==3.13.0",
"imageio>=2.37.0",
"kiwisolver==1.4.8",
"matplotlib==3.10.1",
"mypy-extensions==1.0.0",
"networkx==3.4.2",
"numpy>=1.26.0,<2.0.0",
"opencv-python==4.11.0.86",
"packaging==24.2",
"pandas==2.2.3",
"pathspec==0.12.1",
"pillow==11.2.1",
"platformdirs==4.3.7",
"pydantic>=2.11.7",
"fonttools==4.53.0",
"kiwisolver==1.4.5",
# Machine learning frameworks - flexible versions to use pre-installed
"tensorflow>=2.15.0,<2.16.0",
"torch>=2.3.0,<2.4.0",
# Utilities and CLI
"click==8.1.7",
"typer>=0.12.4",
"absl-py==1.4.0",
# Data validation
"pydantic==2.7.4",
# Standard library extensions
"networkx==3.3",
"packaging==24.1",
"platformdirs==4.2.2",
"pyparsing==3.1.2",
"python-dateutil==2.8.2",
"pytz==2023.4",
"six==1.16.0",
"tzdata==2024.1",
"h5py==3.9.0",
"pydantic-settings>=2.10.1",
"pyparsing==3.2.3",
"python-dateutil==2.9.0.post0",
"pytz==2025.1",
"scipy==1.15.2",
"six==1.17.0",
"tensorflow>=2.15",
"torch>=2.0.1",
"typer>=0.16.0",
"tzdata==2025.1",
"yacs>=0.1.8",
]

[project.scripts]
Expand Down Expand Up @@ -77,9 +81,13 @@ convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Unused imports in __init__ files

[tool.pytest.ini_options]
addopts = "--benchmark-skip"

[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-benchmark>=5.1.0",
"pytest-cov>=6.1.1",
"ruff>=0.11.2",
]
Loading