Skip to content
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

fix: pip-compile on windows #139

Merged
merged 10 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
WIP
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
  • Loading branch information
SdgJlbl committed Jun 9, 2023
commit 92d028bce50c6fb20a69301d42781b7c91d66753
3 changes: 3 additions & 0 deletions .github/workflows/main-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pr-validation:
Expand Down
4 changes: 3 additions & 1 deletion substrafl/remote/register/manage_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Utility functions to manage dependencies (building wheels, compiling requirement...)
"""
from __future__ import annotations

import logging
import os
import re
Expand Down Expand Up @@ -165,7 +167,7 @@ def get_pypi_dependencies_versions(lib_modules: List) -> List[str]:
return [f"{lib_module.__name__}=={lib_module.__version__}" for lib_module in lib_modules]


def compile_requirements(dependency_list: List[str], *, operation_dir: Path, sub_dir: Path) -> None:
def compile_requirements(dependency_list: List[str | Path], *, operation_dir: Path, sub_dir: Path) -> None:
"""Compile a list of requirements using pip-compile to generate a set of fully pinned third parties requirements

Writes down a `requirements.in` file with the list of explicit dependencies, then generates a `requirements.txt`
Expand Down
7 changes: 4 additions & 3 deletions tests/dependency/test_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import tempfile
import uuid
from pathlib import Path
from unittest.mock import MagicMock
from unittest.mock import patch

import numpy as np
import pytest
Expand Down Expand Up @@ -299,14 +297,17 @@ def train(
utils.wait(client, train_task)

@pytest.mark.docker_only
@patch("substrafl.remote.register.register.local_lib_wheels", MagicMock(return_value=["INSTALL IN EDITABLE MODE"]))
def test_force_editable_mode(
self,
mocker,
monkeypatch,
network,
session_dir,
dummy_algo_class,
):
mocker.patch("substrafl.remote.register.register.local_lib_wheels", return_value=["INSTALL IN EDITABLE MODE"])
mocker.patch("substrafl.remote.register.register.compile_requirements")

client = network.clients[0]
algo_deps = Dependency(pypi_dependencies=["pytest"], editable_mode=False)

Expand Down
1 change: 1 addition & 0 deletions tests/remote/register/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def test_latest_substratools_image_selection(use_latest, monkeypatch, default_pe
assert "latest" not in str(lines[1])


@pytest.mark.skipif(sys.platform.startswith("win"), reason="does not run on windows")
def test_create_dockerfile(tmp_path, mocker, local_installable_module):
mocker.patch("substrafl.remote.register.register._get_base_docker_image", return_value="substratools-mocked")
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
Expand Down