From 71ead5629015acfefa29ca3fc33fa36bdb3ddf71 Mon Sep 17 00:00:00 2001 From: RobertSamoilescu Date: Fri, 6 Dec 2024 11:28:50 +0000 Subject: [PATCH] Fixed docs (#1035) * Fixed build_docs step * Increased buf_size * Use lualatex * Increase buf size dynamically * Reverted Makefile * Changed readthedocs image * Bumped docs dependencies * Reverted ci to test everything * Removed comments on docs dependencies * Updated CONTRIBUTING.md --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 10 ++++++++-- requirements/docs.txt | 12 +++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1536090e1..d30024e7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: runs-on: ubuntu-latest container: - image: readthedocs/build:ubuntu-22.04-2022.03.15 + image: readthedocs/build:ubuntu-24.04-2024.06.17 options: --user root steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aecc9b7d7..e542782d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,9 +34,15 @@ errors, the commit will fail and you will see the changes that need to be made. We use `pytest` to run tests. Because `alibi` uses some TensorFlow 1.x constructs, to run all tests you need to invoke `pytest` twice as follows: ```bash -pytest -m tf1 alibi -pytest -m "not tf1 alibi" +TF_USE_LEGACY_KERAS=1 pytest -m "tf1" alibi +pytest -m "not tf1" alibi ``` + +or run directly: +```bash +make test +``` + [see also here](https://github.com/SeldonIO/alibi/blob/4d4f49e07263b20a25f552a8485844dc12281074/.github/workflows/ci.yml#L46-L47). It is not necessary to run the whole test suite locally for every PR as this can take a long time, it is enough to run `pytest` only on the affected test files or test functions. The whole test suite is run in CI on every PR. diff --git a/requirements/docs.txt b/requirements/docs.txt index a2d20bdeb..ba6eb8a1c 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,12 +1,12 @@ # dependencies for building docs, separate from dev.txt as this is also used for builds on readthedocs.org # core dependencies -sphinx>=4.2.0, <8.0.0 -sphinx-autodoc-typehints>=1.12.0, <1.21 # limited due to https://github.com/tox-dev/sphinx-autodoc-typehints/issues/260 -sphinx-rtd-theme>=1.0.0, <2.0.0 +sphinx>=4.2.0, <8.2.0 +sphinx-autodoc-typehints>=1.12.0, <2.6.0 +sphinx-rtd-theme>=1.0.0, <3.1.0 myst-parser>=1.0, <3.0 -sphinxcontrib-apidoc>=0.3.0, <0.5.0 +sphinxcontrib-apidoc>=0.3.0, <0.6.0 nbsphinx>=0.8.5, <0.10.0 -sphinx_design==0.5.0 # Pinning for now as sphinx_design is v.new and still in flux. +sphinx_design==0.6.1 # Pinning for now as sphinx_design is v.new and still in flux. ipykernel>=5.1.0, <7.0.0 # required for executing notebooks via nbsphinx ipython>=7.2.0, <9.0.0 # required for executing notebooks nbsphinx # dependencies required for imports to work and docs to render properly (as mocking doesn't work well) @@ -16,3 +16,5 @@ shap>=0.40.0, <0.44.0 # https://github.com/SeldonIO/alibi/issues/333 # pandoc==2.9.2.1 # NB: as this is not a Python library, it should be installed manually on the system or via a package manager such as `conda` # alibi dependencies (these are installed on ReadTheDocs so are not mocked) typing-extensions>=3.7.4.3 +#AttributeError: `np.obj2sctype` was removed in the NumPy 2.0 release. Use `np.dtype(obj).type` instead. +numpy<2.0.0 \ No newline at end of file