diff --git a/.readthedocs.yml b/.readthedocs.yml index e18aa465..1679eaee 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,8 +10,10 @@ build: tools: python: "3.8" jobs: + pre_install: # Lock version of torch at 1.11 + - pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html pre_build: - - python -m setuptools_scm + - python -m setuptools_scm # Get correct version number # Build documentation in the docs/ directory with Sphinx sphinx: @@ -26,4 +28,7 @@ sphinx: # Optionally set the version of Python and requirements required to build your docs python: install: - - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - docs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3e9fcee..20143b73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,8 +9,7 @@ linting, testing, and building the documentation, run the following: ```bash git clone https://github.com/cornellius-gp/linear_operator.git cd linear_operator -pip install -e .[dev,test] -pip install -r docs/requirements.txt +pip install -e ".[dev,docs,test]" pre-commit install ``` diff --git a/README.md b/README.md index c52657a5..7231e9f9 100644 --- a/README.md +++ b/README.md @@ -394,14 +394,7 @@ If you are contributing a pull request, it is best to perform a manual installat ```sh git clone https://github.com/cornellius-gp/linear_operator.git cd linear_operator -pip install -e .[dev,test] -``` - -To generate the documentation locally, you will also need to run the following command -from the linear_operator folder: - -```sh -pip install -r docs/requirements.txt +pip install -e ".[dev,docs,test]" ``` diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 53755c7c..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -jaxtyping>=0.2.9 -myst-parser -setuptools_scm -sphinx -sphinx_rtd_theme -sphinx-autodoc-typehints -six -uncompyle6 diff --git a/setup.py b/setup.py index 163bd914..4cf95ef0 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,16 @@ def find_version(*file_paths): python_requires=">=3.8", install_requires=install_requires, extras_require={ - "dev": ["ufmt", "twine", "pre-commit"], + "dev": ["pre-commit", "setuptools_scm", "ufmt", "twine"], + "docs": [ + "myst-parser", + "setuptools_scm", + "sphinx", + "six", + "sphinx_rtd_theme", + "sphinx-autodoc-typehints", + "uncompyle6", + ], "test": ["flake8==5.0.4", "flake8-print==5.0.0", "pytest"], }, test_suite="test",