Skip to content

Commit 0cd338d

Browse files
authored
🗑️ Remove requirements directory (#1945)
* 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]>
1 parent 7de541d commit 0cd338d

15 files changed

+58
-209
lines changed

.ci/Dockerfile

+3-9
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,11 @@ RUN conda install python=3.10
5959
## Anomalib Development Env
6060
#########################################################
6161

62-
FROM python_base_cuda11.4 as anomalib_development_env
62+
FROM python_base_cuda as anomalib_development_env
6363

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

68-
COPY ./requirements/openvino.txt /tmp/anomalib/requirements/openvino.txt
69-
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/openvino.txt
70-
71-
# Install other requirements related to development
72-
COPY ./requirements/dev.txt /tmp/anomalib/requirements/dev.txt
73-
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/dev.txt
7468

7569
WORKDIR /home/user

.readthedocs.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ formats:
2929
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3030
python:
3131
install:
32-
- requirements: docs/requirements.txt
33-
- requirements: requirements/core.txt
34-
- requirements: requirements/loggers.txt
35-
- requirements: requirements/notebooks.txt
36-
- requirements: requirements/openvino.txt
3732
- method: pip
3833
path: .
34+
extra_requirements:
35+
- dev

CONTRIBUTING.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,24 @@ Set up your development environment to start contributing. This involves install
4646
conda activate anomalib_dev
4747
```
4848

49-
2. Install the base and development requirements:
49+
2. Install the development requirements:
5050

5151
```bash
52-
pip install -r requirements/installer.txt -r requirements/dev.txt
53-
anomalib install -v
52+
# Option I: Via anomalib install
53+
anomalib install --option dev
54+
55+
#Option II: Via pip install
56+
pip install -e .[dev]
5457
```
5558

5659
Optionally, for a full installation with all dependencies:
5760

5861
```bash
59-
pip install -e .[all]
62+
# Option I: via anomalib install
63+
anomalib install --option full
64+
65+
# Option II: via pip install
66+
pip install -e .[full]
6067
```
6168

6269
3. Install and configure pre-commit hooks:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Installing the library with pip is the easiest way to get started with anomalib.
5252
pip install anomalib
5353
```
5454

55-
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:
55+
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:
5656

5757
```bash
5858
# Get help for the installation arguments
@@ -92,7 +92,7 @@ cd anomalib
9292
pip install -e .
9393
```
9494

95-
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:
95+
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:
9696

9797
```bash
9898
# Get help for the installation arguments

docs/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ This is the source code for the Anomalib documentation. It is built using sphinx
66

77
## Installation
88

9-
To install the dependencies, run the following command:
9+
To install the dependencies, run the following command from the project root:
1010

1111
```bash
12-
pip install -r requirements.txt
12+
pip install .[docs]
1313
```
1414

1515
## Build
1616

1717
To build the documentation, run the following command:
1818

1919
```bash
20+
cd docs
2021
sphinx-build -b html source build
2122
```

docs/source/markdown/guides/developer/contributing.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@ Set up your development environment to start contributing. This involves install
2222
conda activate anomalib_dev
2323
```
2424

25-
Install the base and development requirements:
25+
Install the development requirements:
2626

2727
```bash
28-
pip install -r requirements/installer.txt -r requirements/dev.txt
29-
anomalib install -v
28+
# Option I: Via anomalib install
29+
anomalib install --option dev
30+
31+
#Option II: Via pip install
32+
pip install -e .[dev]
3033
```
3134

3235
Optionally, for a full installation with all dependencies:
3336

3437
```bash
35-
pip install -e .[all]
38+
# Option I: via anomalib install
39+
anomalib install --option full
40+
41+
# Option II: via pip install
42+
pip install -e .[full]
3643
```
3744

3845
2. Install and configure pre-commit hooks:

pyproject.toml

+13-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authors = [{ name = "Intel OpenVINO" }]
1818
dependencies = [
1919
"omegaconf>=2.1.1",
2020
"rich>=13.5.2",
21-
"jsonargparse==4.27.7",
21+
"jsonargparse[all]>=4.27.7",
2222
"docstring_parser", # CLI help-formatter
2323
"rich_argparse", # CLI help-formatter
2424
]
@@ -47,7 +47,17 @@ loggers = [
4747
"wandb==0.12.17",
4848
]
4949
notebooks = ["gitpython", "ipykernel", "ipywidgets", "notebook"]
50-
dev = [
50+
docs = [
51+
"myst-parser",
52+
"nbsphinx",
53+
"pandoc",
54+
"sphinx<8.0", # 7.0 breaks readthedocs builds.
55+
"sphinx_autodoc_typehints",
56+
"sphinx_book_theme",
57+
"sphinx-copybutton",
58+
"sphinx_design",
59+
]
60+
test = [
5161
"pre-commit",
5262
"pytest",
5363
"pytest-cov",
@@ -58,6 +68,7 @@ dev = [
5868
"tox",
5969
]
6070
full = ["anomalib[core,openvino,loggers,notebooks]"]
71+
dev = ["anomalib[full,docs,test]"]
6172

6273
[project.scripts]
6374
anomalib = "anomalib.cli.cli:main"

requirements/core.txt

-13
This file was deleted.

requirements/dev.txt

-8
This file was deleted.

requirements/installer.txt

-5
This file was deleted.

requirements/loggers.txt

-6
This file was deleted.

requirements/notebooks.txt

-4
This file was deleted.

requirements/openvino.txt

-3
This file was deleted.

setup.py

-125
This file was deleted.

tox.ini

+13-17
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ deps =
3030
pytest-order
3131
flaky
3232
nbmake
33-
-r{toxinidir}/requirements/installer.txt
34-
-r{toxinidir}/requirements/core.txt
35-
-r{toxinidir}/requirements/openvino.txt
36-
-r{toxinidir}/requirements/loggers.txt
37-
-r{toxinidir}/requirements/notebooks.txt
3833

3934
commands =
40-
; 1. Run Coverage First.
35+
; 0. Install Anomalib first.
36+
pip install .[full]
37+
38+
; 1. Run Coverage.
4139
pytest tests/integration tests/unit \
4240
--cov=anomalib \
4341
--cov-report=xml:{toxworkdir}/coverage.xml \
@@ -57,12 +55,12 @@ deps =
5755
coverage
5856
pytest
5957
flaky
60-
-r{toxinidir}/requirements/installer.txt
61-
-r{toxinidir}/requirements/core.txt
62-
-r{toxinidir}/requirements/openvino.txt
63-
-r{toxinidir}/requirements/loggers.txt
64-
-r{toxinidir}/requirements/notebooks.txt
58+
6559
commands =
60+
; 0. Install Anomalib first.
61+
pip install .[full]
62+
63+
; 1. Run Coverage for the nightly tests.
6664
coverage erase
6765
coverage run --include=anomalib/* -m pytest tests/legacy/nightly/
6866
coverage report -m --fail-under=33
@@ -79,13 +77,11 @@ allowlist_externals =
7977
*trivy*
8078
cat
8179
install_command = pip install --no-cache-dir {opts} {packages}
82-
deps =
83-
-r{toxinidir}/requirements/installer.txt
84-
-r{toxinidir}/requirements/core.txt
85-
-r{toxinidir}/requirements/openvino.txt
86-
-r{toxinidir}/requirements/loggers.txt
87-
-r{toxinidir}/requirements/notebooks.txt
8880
commands =
81+
; 0. Install Anomalib first.
82+
pip install .[full]
83+
84+
; 1. Run Trivy Scan.
8985
bash -c "pip freeze > requirements.txt"
9086
curl -L0 {env:TRIVY_DOWNLOAD_URL} -o {toxworkdir}/trivy.tar.gz
9187
tar -xzf {toxworkdir}/trivy.tar.gz -C {toxworkdir}

0 commit comments

Comments
 (0)