Skip to content

Commit

Permalink
🗑️ Remove requirements directory (#1945)
Browse files Browse the repository at this point in the history
* Remove requirements directory

* Remove reference to requirements

* Update the readthedocs config to pass extra requirements

Signed-off-by: Samet Akcay <[email protected]>

* Remove setup.py file

Signed-off-by: Samet Akcay <[email protected]>

* Update docs readme file

Signed-off-by: Samet Akcay <[email protected]>

* Update readthedocs config

Signed-off-by: Samet Akcay <[email protected]>

* Add docs requirements to pyproject.toml file

Signed-off-by: Samet Akcay <[email protected]>

* Revert full dependencies

Signed-off-by: Samet Akcay <[email protected]>

* Install jsonargparse as full

---------

Signed-off-by: Samet Akcay <[email protected]>
  • Loading branch information
samet-akcay authored Apr 3, 2024
1 parent 7de541d commit 0cd338d
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 209 deletions.
12 changes: 3 additions & 9 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,11 @@ RUN conda install python=3.10
## Anomalib Development Env
#########################################################

FROM python_base_cuda11.4 as anomalib_development_env
FROM python_base_cuda as anomalib_development_env

# Install all anomalib requirements
COPY ./requirements/installer.txt /tmp/anomalib/requirements/installer.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/installer.txt
COPY ./pyproject.toml /tmp/anomalib/pyproject.toml
RUN pip install --no-cache-dir .[full]

COPY ./requirements/openvino.txt /tmp/anomalib/requirements/openvino.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/openvino.txt

# Install other requirements related to development
COPY ./requirements/dev.txt /tmp/anomalib/requirements/dev.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/dev.txt

WORKDIR /home/user
7 changes: 2 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ formats:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
- requirements: requirements/core.txt
- requirements: requirements/loggers.txt
- requirements: requirements/notebooks.txt
- requirements: requirements/openvino.txt
- method: pip
path: .
extra_requirements:
- dev
15 changes: 11 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,24 @@ Set up your development environment to start contributing. This involves install
conda activate anomalib_dev
```

2. Install the base and development requirements:
2. Install the development requirements:

```bash
pip install -r requirements/installer.txt -r requirements/dev.txt
anomalib install -v
# Option I: Via anomalib install
anomalib install --option dev

#Option II: Via pip install
pip install -e .[dev]
```

Optionally, for a full installation with all dependencies:

```bash
pip install -e .[all]
# Option I: via anomalib install
anomalib install --option full

# Option II: via pip install
pip install -e .[full]
```

3. Install and configure pre-commit hooks:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Installing the library with pip is the easiest way to get started with anomalib.
pip install anomalib
```

This will install Anomalib CLI using the [installer](requirements/installer.txt) dependencies. Anomalib CLI is a command line interface for training, inference, benchmarking, and hyperparameter optimization. If you want to use the library as a Python package, you can install the library with the following command:
This will install Anomalib CLI using the [dependencies](/pyproject.toml) in the `pyproject.toml` file. Anomalib CLI is a command line interface for training, inference, benchmarking, and hyperparameter optimization. If you want to use the library as a Python package, you can install the library with the following command:

```bash
# Get help for the installation arguments
Expand Down Expand Up @@ -92,7 +92,7 @@ cd anomalib
pip install -e .
```

This will install Anomalib CLI using the [installer](requirements/installer.txt) dependencies. Anomalib CLI is a command line interface for training, inference, benchmarking, and hyperparameter optimization. If you want to use the library as a Python package, you can install the library with the following command:
This will install Anomalib CLI using the [dependencies](/pyproject.toml) in the `pyproject.toml` file. Anomalib CLI is a command line interface for training, inference, benchmarking, and hyperparameter optimization. If you want to use the library as a Python package, you can install the library with the following command:

```bash
# Get help for the installation arguments
Expand Down
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ This is the source code for the Anomalib documentation. It is built using sphinx

## Installation

To install the dependencies, run the following command:
To install the dependencies, run the following command from the project root:

```bash
pip install -r requirements.txt
pip install .[docs]
```

## Build

To build the documentation, run the following command:

```bash
cd docs
sphinx-build -b html source build
```
15 changes: 11 additions & 4 deletions docs/source/markdown/guides/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ Set up your development environment to start contributing. This involves install
conda activate anomalib_dev
```

Install the base and development requirements:
Install the development requirements:

```bash
pip install -r requirements/installer.txt -r requirements/dev.txt
anomalib install -v
# Option I: Via anomalib install
anomalib install --option dev

#Option II: Via pip install
pip install -e .[dev]
```

Optionally, for a full installation with all dependencies:

```bash
pip install -e .[all]
# Option I: via anomalib install
anomalib install --option full

# Option II: via pip install
pip install -e .[full]
```

2. Install and configure pre-commit hooks:
Expand Down
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [{ name = "Intel OpenVINO" }]
dependencies = [
"omegaconf>=2.1.1",
"rich>=13.5.2",
"jsonargparse==4.27.7",
"jsonargparse[all]>=4.27.7",
"docstring_parser", # CLI help-formatter
"rich_argparse", # CLI help-formatter
]
Expand Down Expand Up @@ -47,7 +47,17 @@ loggers = [
"wandb==0.12.17",
]
notebooks = ["gitpython", "ipykernel", "ipywidgets", "notebook"]
dev = [
docs = [
"myst-parser",
"nbsphinx",
"pandoc",
"sphinx<8.0", # 7.0 breaks readthedocs builds.
"sphinx_autodoc_typehints",
"sphinx_book_theme",
"sphinx-copybutton",
"sphinx_design",
]
test = [
"pre-commit",
"pytest",
"pytest-cov",
Expand All @@ -58,6 +68,7 @@ dev = [
"tox",
]
full = ["anomalib[core,openvino,loggers,notebooks]"]
dev = ["anomalib[full,docs,test]"]

[project.scripts]
anomalib = "anomalib.cli.cli:main"
Expand Down
13 changes: 0 additions & 13 deletions requirements/core.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/installer.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements/loggers.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/notebooks.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements/openvino.txt

This file was deleted.

125 changes: 0 additions & 125 deletions setup.py

This file was deleted.

30 changes: 13 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ deps =
pytest-order
flaky
nbmake
-r{toxinidir}/requirements/installer.txt
-r{toxinidir}/requirements/core.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/loggers.txt
-r{toxinidir}/requirements/notebooks.txt

commands =
; 1. Run Coverage First.
; 0. Install Anomalib first.
pip install .[full]

; 1. Run Coverage.
pytest tests/integration tests/unit \
--cov=anomalib \
--cov-report=xml:{toxworkdir}/coverage.xml \
Expand All @@ -57,12 +55,12 @@ deps =
coverage
pytest
flaky
-r{toxinidir}/requirements/installer.txt
-r{toxinidir}/requirements/core.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/loggers.txt
-r{toxinidir}/requirements/notebooks.txt

commands =
; 0. Install Anomalib first.
pip install .[full]

; 1. Run Coverage for the nightly tests.
coverage erase
coverage run --include=anomalib/* -m pytest tests/legacy/nightly/
coverage report -m --fail-under=33
Expand All @@ -79,13 +77,11 @@ allowlist_externals =
*trivy*
cat
install_command = pip install --no-cache-dir {opts} {packages}
deps =
-r{toxinidir}/requirements/installer.txt
-r{toxinidir}/requirements/core.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/loggers.txt
-r{toxinidir}/requirements/notebooks.txt
commands =
; 0. Install Anomalib first.
pip install .[full]

; 1. Run Trivy Scan.
bash -c "pip freeze > requirements.txt"
curl -L0 {env:TRIVY_DOWNLOAD_URL} -o {toxworkdir}/trivy.tar.gz
tar -xzf {toxworkdir}/trivy.tar.gz -C {toxworkdir}
Expand Down

0 comments on commit 0cd338d

Please sign in to comment.