Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

DOC: Add Read the Docs config file #720

Merged
merged 21 commits into from
Jul 7, 2022
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
Move pip requirements to text file
  • Loading branch information
fepegar authored and peterhessey committed Jul 7, 2022
commit 00fb779b0721a94e581302a5a99f3047e2a3e1e9
1 change: 1 addition & 0 deletions InnerEye/Common/fixed_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def repository_parent_directory(path: Optional[PathOrString] = None) -> Path:
INNEREYE_PACKAGE_NAME = "InnerEye"
# Child paths to include in a registered model that live outside InnerEye/.
ENVIRONMENT_YAML_FILE_NAME = "environment.yml"
PIP_REQUIREMENTS_FILE_NAME = "requirements.txt"

DEFAULT_AML_UPLOAD_DIR = "outputs"
DEFAULT_RESULT_IMAGE_NAME = "segmentation.nii.gz"
Expand Down
62 changes: 62 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
azure-mgmt-resource==12.1.0
azure-mgmt-datafactory==1.1.0
azure-storage-blob==12.6.0
azureml-mlflow==1.36.0
azureml-sdk==1.36.0
azureml-tensorboard==1.36.0
conda-merge==0.1.5
cryptography==3.3.2
cucim==21.10.1; platform_system=="Linux"
dataclasses-json==0.5.2
docker==4.3.1
flake8==3.8.3
gitpython==3.1.7
gputil==1.4.0
h5py==2.10.0
ipython==7.31.1
imageio==2.15.0
InnerEye-DICOM-RT==1.0.1
joblib==0.16.0
jupyter==1.0.0
jupyter-client==6.1.5
lightning-bolts==0.4.0
matplotlib==3.3.0
mlflow==1.23.1
monai==0.6.0
mypy==0.910
mypy-extensions==0.4.3
numba==0.51.2
numpy==1.19.1
numba==0.51.2
opencv-python-headless==4.5.1.48
pandas==1.1.0
papermill==2.2.2
param==1.9.3
pillow==9.0.0
psutil==5.7.2
pydicom==2.0.0
pyflakes==2.2.0
PyJWT==1.7.1
pytest==6.0.1
pytest-cov==2.10.1
pytest-forked==1.3.0
pytest-xdist==1.34.0
pytorch-lightning==1.5.5
rich==10.13.0
rpdb==0.1.6
ruamel.yaml==0.16.12
runstats==1.8.0
scikit-image==0.17.2
scikit-learn==0.23.2
scipy==1.5.2
seaborn==0.10.1
simpleitk==1.2.4
six==1.15.0
stopit==1.1.2
tabulate==0.8.7
tensorboard==2.3.0
tensorboardX==2.1
torchio==0.18.74
torchmetrics==0.6.0
umap-learn==0.5.2
yacs==0.1.8
16 changes: 3 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import os
import shutil
from pathlib import Path
from typing import List
from typing import List, Optional

import ruamel.yaml
import setuptools
from ruamel.yaml.comments import CommentedMap

from InnerEye.Common import fixed_paths
from InnerEye.Common.common_util import namespace_to_path
Expand Down Expand Up @@ -45,7 +43,7 @@ def _get_innereye_packages() -> List[str]:
return [x for x in setuptools.find_namespace_packages(str(package_root)) if x.startswith(INNEREYE_PACKAGE_NAME)]


def _get_source_packages(exclusions: List[str] = None) -> List[str]:
def _get_source_packages(exclusions: Optional[List[str]] = None) -> List[str]:
exclusions = [] if not exclusions else exclusions
return [x for x in _get_innereye_packages() if not any([e in x for e in exclusions])]

Expand Down Expand Up @@ -92,15 +90,7 @@ def _get_child_package(root: str, child: str) -> str:
and not os.path.exists(os.path.join(str(package_root), INNEREYE_PACKAGE_NAME, file)):
raise FileNotFoundError(f"File {file} in package data does not exist")

with open(package_root / fixed_paths.ENVIRONMENT_YAML_FILE_NAME, "r") as env_file:
yaml_contents = ruamel.yaml.round_trip_load(env_file)
env_dependencies = yaml_contents["dependencies"]
pip_list = None
for d in env_dependencies:
if isinstance(d, CommentedMap) and "pip" in d:
pip_list = list(d["pip"])
if not pip_list:
raise ValueError("Expected there is a 'pip' section in the environment file?")
pip_list = (package_root / fixed_paths.PIP_REQUIREMENTS_FILE_NAME).read_text().splitlines()

git_prefix = "git+"
required_packages = []
Expand Down