diff --git a/Dockerfile b/Dockerfile index ed72ac0e..39c56e1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,8 @@ RUN mamba env update -n base -f /tmp/environment.yml && \ echo "Installing CUDA-enabled PyTorch" && \ pip install --no-cache-dir --force-reinstall torch torchvision; \ fi && \ + # Install ipytestsuite from TestPyPI (temporary, will use PyPI once published) + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ "ipytestsuite[ai]" && \ # Clean up all package caches to reduce image size mamba clean --all -f -y && \ # Remove pip cache diff --git a/binder/environment.yml b/binder/environment.yml index 0293e453..d5b3f0d2 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -4,7 +4,7 @@ channels: - conda-forge - pytorch dependencies: - - python=3.10 + - python=3.12 - pip - pip: - numpy @@ -22,10 +22,6 @@ dependencies: - scikit-learn - attrs - multiprocess - - openai - - tenacity - - markdown2 - - python-dotenv - pillow - opencv-python - torch diff --git a/binder/postBuild b/binder/postBuild index 8f6dd066..26d20a78 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -3,3 +3,6 @@ set -ex mkdir -p ${HOME}/.ipython/profile_default cp binder/ipython_config.py ${HOME}/.ipython/profile_default/ + +# Install ipytestsuite from TestPyPI (temporary, will use PyPI once published) +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ "ipytestsuite[ai]" diff --git a/docker/environment.yml b/docker/environment.yml index 6fa594e4..fcf7038c 100644 --- a/docker/environment.yml +++ b/docker/environment.yml @@ -3,6 +3,7 @@ name: base channels: - conda-forge dependencies: + - python=3.12 - pip - pip: - numpy @@ -20,10 +21,6 @@ dependencies: - scikit-learn - attrs - multiprocess - - openai - - tenacity - - markdown2 - - python-dotenv - pillow - opencv-python - albumentations diff --git a/magic_example.ipynb b/magic_example.ipynb index 07b759cc..4061a90d 100644 --- a/magic_example.ipynb +++ b/magic_example.ipynb @@ -8,7 +8,7 @@ }, "outputs": [], "source": [ - "%reload_ext tutorial.tests.testsuite" + "%reload_ext ipytestsuite" ] }, { @@ -19,7 +19,7 @@ }, "outputs": [], "source": [ - "%%ipytest\n", + "%%ipytest --path tutorial/tests\n", "# or %%ipytest test_module_name\n", "\n", "def solution_power2(x: int) -> int:\n", @@ -89,7 +89,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.12.11" }, "vscode": { "interpreter": { diff --git a/pyproject.toml b/pyproject.toml index a40c781a..c592f16c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "python-tutorial" version = "v2025.05" description = "Jupyter-based Python programming tutorial" -requires-python = ">=3.10" +requires-python = ">=3.12" [project.optional-dependencies] dev = [ @@ -21,16 +21,13 @@ dev = [ "scikit-learn", "attrs", "multiprocess", - "openai", - "tenacity", - "markdown2", - "python-dotenv", "pillow", "opencv-python", "albumentations", "grad-cam", "plotly", - "torch==2.7.0", # pinned to last stable version as of 2025-05-14 + "torch>=2.0.0", # PyTorch 2.x series + "ipytestsuite[ai]>=0.1.0", ] # pytest @@ -93,3 +90,11 @@ indent-style = "space" # Setuptools: suppress package discovery [tool.setuptools] packages = [] + +[[tool.uv.index]] +name = "testpypi" +url = "https://test.pypi.org/simple/" +explicit = true + +[tool.uv.sources] +ipytestsuite = { index = "testpypi" }