From 16c41ea84b7b59f8242aa3642feb6b88edf1b1ff Mon Sep 17 00:00:00 2001 From: smokestacklightnin <125844868+smokestacklightnin@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:46:53 -0700 Subject: [PATCH] Store documentation requirements in `requirements-docs.txt` --- .github/workflows/cd-docs.yml | 2 +- requirements-docs.txt | 8 ++++++++ setup.py | 15 ++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 requirements-docs.txt diff --git a/.github/workflows/cd-docs.yml b/.github/workflows/cd-docs.yml index 9a211fb34..36a0cb949 100644 --- a/.github/workflows/cd-docs.yml +++ b/.github/workflows/cd-docs.yml @@ -39,7 +39,7 @@ jobs: mkdocs-material- - name: Install Dependencies - run: pip install mkdocs mkdocs-material mkdocstrings[python] griffe-inherited-docstrings mkdocs-autorefs black mkdocs-jupyter mkdocs-caption + run: pip install -r requirements-docs.txt - name: Deploy to GitHub Pages run: mkdocs gh-deploy --force diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 000000000..2c76c4f30 --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,8 @@ +mkdocs +mkdocs-material +mkdocstrings[python] +griffe-inherited-docstrings +mkdocs-autorefs +black +mkdocs-jupyter +mkdocs-caption diff --git a/setup.py b/setup.py index fd0d9c432..6084cc1b5 100644 --- a/setup.py +++ b/setup.py @@ -129,6 +129,11 @@ def run(self): with open('README.md') as fp: _LONG_DESCRIPTION = fp.read() +# Get documentation build requirements +with open("requirements-docs.txt", "r") as fp: + docs_reqs = fp.readlines() +docs_reqs = [req.replace("\n", "") for req in docs_reqs] + setup( name='ml-metadata', version=__version__, @@ -167,15 +172,7 @@ def run(self): 'six>=1.10,<2', ], # TODO: Pin versions for docs - extras_require={"docs": ["mkdocs", - "mkdocs-material", - "mkdocstrings[python]", - "griffe-inherited-docstrings", - "mkdocs-autorefs", - "black", - "mkdocs-caption" - ] - } + extras_require={"docs": docs_reqs} python_requires='>=3.9,<4', packages=find_packages(), include_package_data=True,