From fb59fdd99f13f74f3cc995ca4a955bbcbd02e508 Mon Sep 17 00:00:00 2001 From: Bruno Castro-Karney Date: Fri, 10 Mar 2023 14:34:13 -0800 Subject: [PATCH 1/2] Kill sphinx_requirements.txt - readthedocs build now uses setup.py --- .readthedocs.yml | 12 +- docs/source/sphinx_requirements.txt | 273 --------------------------- setup.py | 8 +- tests/integration/test_docs_build.sh | 14 +- 4 files changed, 23 insertions(+), 284 deletions(-) delete mode 100644 docs/source/sphinx_requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml index 230558360..64c6b1e87 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,10 +5,18 @@ # Required version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.9" + python: - version: 3.8 install: - - requirements: docs/source/sphinx_requirements.txt + - method: pip + path: . + extra_requirements: + - docs + system_packages: true sphinx: fail_on_warning: false diff --git a/docs/source/sphinx_requirements.txt b/docs/source/sphinx_requirements.txt deleted file mode 100644 index ea02072ac..000000000 --- a/docs/source/sphinx_requirements.txt +++ /dev/null @@ -1,273 +0,0 @@ -# python packages to build sphinx docs for readthedocs - -sphinx==4.1 -sphinx-rtd-theme==1.1.1 -readthedocs-sphinx-ext==2.1.4 - -# These are the dependencies necessary to IMPORT the records-mover submodules -# which sphinx examines to generate the documentation. If you sphinx-build and -# get an import error, you should add the package here, then verify it works -# by running tests/integration/test_docs_build.sh -# -# Why does this file exist, when there is already a separate requirements.txt? -# Well, they're different sets of dependencies, and though we could use one -# single large set of dependencies for both, it causes some issues. -# Problematically, readthedocs only supports python3.8, while this project -# mostly uses python3.9, leading to difficulty finding compatible versions -# of every package. -# -# These dependencies are generated with `pip freeze` and then making these -# modifications: -# - remove the line containing -# "-e git+ssh://git@github.com/bluelabsio/records-mover.git" and -# - remove numpy-stubs -# - change pandas version to 1.5.2 - -alembic==1.9.2 -anyio==3.6.2 -apache-airflow==2.5.1 -apache-airflow-providers-amazon==7.1.0 -apache-airflow-providers-common-sql==1.3.3 -apache-airflow-providers-ftp==3.3.0 -apache-airflow-providers-google==6.8.0 -apache-airflow-providers-http==4.1.1 -apache-airflow-providers-imap==3.1.1 -apache-airflow-providers-sqlite==3.3.1 -apispec==3.3.2 -argcomplete==1.12.3 -asn1crypto==1.5.1 -attrs==22.2.0 -awscli==1.27.54 -Babel==2.11.0 -beautifulsoup4==4.11.1 -bleach==6.0.0 -blinker==1.5 -boto==2.49.0 -boto3==1.26.54 -botocore==1.29.54 -cachelib==0.9.0 -cachetools==5.3.0 -cattrs==22.2.0 -certifi==2022.12.7 -cffi==1.15.1 -chardet==3.0.4 -charset-normalizer==3.0.1 -click==8.1.3 -clickclick==20.10.2 -colorama==0.4.4 -colorlog==4.8.0 -config-resolver==5.1.0 -ConfigUpdater==3.1.1 -connexion==2.14.1 -coverage==7.0.5 -cron-descriptor==1.2.32 -croniter==1.3.8 -cryptography==39.0.1 -db-dtypes==1.0.5 -db-facts==4.0.0 -decorator==5.1.1 -Deprecated==1.2.13 -dill==0.3.6 -distlib==0.3.6 -dnspython==2.3.0 -docstring-parser==0.15 -docutils==0.16 -email-validator==1.3.1 -exceptiongroup==1.1.0 -filelock==3.9.0 -flake8==6.0.0 -Flask==2.2.2 -Flask-AppBuilder==4.1.4 -Flask-Babel==2.0.0 -Flask-Caching==2.0.2 -Flask-JWT-Extended==4.4.4 -Flask-Login==0.6.2 -Flask-Session==0.4.0 -Flask-SQLAlchemy==2.5.1 -Flask-WTF==1.1.1 -future==0.18.3 -google==3.0.0 -google-ads==14.0.0 -google-api-core==1.34.0 -google-api-python-client==1.8.4 -google-auth==2.16.0 -google-auth-httplib2==0.1.0 -google-auth-oauthlib==0.8.0 -google-cloud-aiplatform==1.16.1 -google-cloud-appengine-logging==1.1.3 -google-cloud-audit-log==0.2.5 -google-cloud-automl==2.8.0 -google-cloud-bigquery==2.34.4 -google-cloud-bigquery-datatransfer==3.7.0 -google-cloud-bigquery-storage==2.14.1 -google-cloud-bigtable==1.7.3 -google-cloud-build==3.9.0 -google-cloud-container==1.0.3 -google-cloud-core==2.3.2 -google-cloud-datacatalog==3.9.0 -google-cloud-dataplex==1.1.0 -google-cloud-dataproc==5.0.0 -google-cloud-dataproc-metastore==1.6.0 -google-cloud-dlp==1.0.2 -google-cloud-kms==2.12.0 -google-cloud-language==1.3.2 -google-cloud-logging==3.2.1 -google-cloud-memcache==1.4.1 -google-cloud-monitoring==2.11.0 -google-cloud-orchestration-airflow==1.4.1 -google-cloud-os-login==2.7.1 -google-cloud-pubsub==2.13.5 -google-cloud-redis==2.9.0 -google-cloud-resource-manager==1.6.0 -google-cloud-secret-manager==1.0.2 -google-cloud-spanner==1.19.3 -google-cloud-speech==1.3.4 -google-cloud-storage==1.44.0 -google-cloud-tasks==2.10.1 -google-cloud-texttospeech==1.0.3 -google-cloud-translate==1.7.2 -google-cloud-videointelligence==1.16.3 -google-cloud-vision==1.0.2 -google-cloud-workflows==1.7.1 -google-crc32c==1.5.0 -google-resumable-media==2.4.1 -googleapis-common-protos==1.58.0 -graphviz==0.20.1 -greenlet==2.0.1 -grpc-google-iam-v1==0.12.6 -grpcio==1.51.1 -grpcio-gcp==0.2.2 -grpcio-status==1.48.2 -gunicorn==20.1.0 -h11==0.14.0 -httpcore==0.16.3 -httplib2==0.21.0 -httpx==0.23.3 -idna==3.4 -importlib-metadata==6.0.0 -importlib-resources==5.10.2 -inflection==0.5.1 -iniconfig==2.0.0 -itsdangerous==2.1.2 -jaraco.classes==3.2.3 -jeepney==0.8.0 -Jinja2==3.1.2 -jmespath==1.0.1 -json-merge-patch==0.2 -jsonpath-ng==1.5.3 -jsonschema==4.17.3 -keyring==23.13.1 -lazy-object-proxy==1.9.0 -linkify-it-py==2.0.0 -lockfile==0.12.2 -looker-sdk==22.20.0 -lxml==4.9.2 -Mako==1.2.4 -Markdown==3.4.1 -markdown-it-py==2.1.0 -MarkupSafe==2.1.2 -marshmallow==3.19.0 -marshmallow-enum==1.5.1 -marshmallow-oneofschema==3.0.1 -marshmallow-sqlalchemy==0.26.1 -mccabe==0.7.0 -mdit-py-plugins==0.3.3 -mdurl==0.1.2 -mock==5.0.1 -more-itertools==9.0.0 -mypy==0.991 -mypy-boto3-appflow==1.26.53 -mypy-boto3-rds==1.26.47 -mypy-boto3-redshift-data==1.26.30 -mypy-extensions==0.4.3 -nox==2020.12.31 -numpy==1.24.1 -oauth2client==2.0.2 -oauthlib==3.2.2 -odictliteral==1.0.0 -packaging==21.3 -pandas==1.5.2 -pandas-gbq==0.17.9 -pathspec==0.9.0 -pendulum==2.1.2 -pkginfo==1.9.6 -pkgutil_resolve_name==1.3.10 -platformdirs==2.6.2 -pluggy==1.0.0 -ply==3.11 -prison==0.2.1 -proto-plus==1.18.1 -protobuf==3.20.3 -psutil==5.9.4 -psycopg2-binary==2.9.5 -py==1.11.0 -pyarrow==9.0.0 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pycodestyle==2.10.0 -pycparser==2.21 -pydata-google-auth==1.5.0 -pyflakes==3.0.1 -Pygments==2.14.0 -PyJWT==2.6.0 -PyMySQL==1.0.2 -pyOpenSSL==23.0.0 -pyparsing==3.0.9 -pyrsistent==0.19.3 -pytest==7.2.1 -pytest-cov==4.0.0 -python-daemon==2.3.2 -python-dateutil==2.8.2 -python-nvd3==0.15.0 -python-slugify==7.0.0 -pytz==2022.7.1 -pytzdata==2020.1 -PyYAML==5.4.1 -readme-renderer==37.3 -redshift-connector==2.0.909 -requests==2.28.2 -requests-oauthlib==1.3.1 -requests-toolbelt==0.10.1 -rfc3986==1.5.0 -rich==13.2.0 -rsa==4.7.2 -s3-concat==0.1.9 -s3transfer==0.6.0 -scramp==1.4.4 -SecretStorage==3.3.3 -setproctitle==1.3.2 -six==1.16.0 -smart-open==6.3.0 -sniffio==1.3.0 -soupsieve==2.3.2.post1 -SQLAlchemy==1.4.46 -sqlalchemy-bigquery==1.5.0 -SQLAlchemy-JSONField==1.0.1.post0 -sqlalchemy-redshift==0.8.12 -sqlalchemy-stubs==0.4 -SQLAlchemy-Utils==0.39.0 -sqlalchemy-vertica-python==0.5.10 -sqlparse==0.4.3 -tabulate==0.9.0 -tenacity==6.3.1 -termcolor==2.2.0 -text-unidecode==1.3 -timeout-decorator==0.5.0 -tomli==2.0.1 -twine==4.0.2 -types-mock==5.0.0.2 -types-pytz==2022.7.1.0 -typing-inspect==0.8.0 -typing_extensions==4.4.0 -uc-micro-py==1.0.1 -unicodecsv==0.14.1 -uritemplate==3.0.1 -urllib3==1.26.14 -vertica-python==1.2.0 -virtualenv==20.17.1 -watchtower==2.0.1 -webencodings==0.5.1 -Werkzeug==2.2.3 -wrapt==1.14.1 -WTForms==3.0.1 -zipp==3.11.0 diff --git a/setup.py b/setup.py index 66d0f95ab..c863d6976 100755 --- a/setup.py +++ b/setup.py @@ -261,10 +261,10 @@ def initialize_options(self) -> None: ) docs_dependencies = [ - 'sphinx>=3', # used to generate and upload docs - - # sphinx-autodoc-typehints requires 3 or better per - # https://github.com/agronholm/sphinx-autodoc-typehints/pull/138 - 'sphinx-rtd-theme', # used to style docs for readthedocs.io + 'sphinx>=5', # used to generate and upload docs - + # need 5.0 or later for compatibility with other packages + 'sphinx-rtd-theme>=1', # used to style docs for readthedocs.io + 'readthedocs-sphinx-ext>=2' # also used by readthedocs 'recommonmark', # used to be able to use sphinx with markdown ] + ( # needed for readthedocs.io to be able to evaluate modules with diff --git a/tests/integration/test_docs_build.sh b/tests/integration/test_docs_build.sh index 00c85e8b4..3a283df7b 100755 --- a/tests/integration/test_docs_build.sh +++ b/tests/integration/test_docs_build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e if [[ $1 == "--help" ]] then @@ -9,7 +9,7 @@ then elif [[ $1 != "--no-pyenv" ]] then echo "Creating virtualenv..." - export PYENV_VERSION=3.8.16 + export PYENV_VERSION=3.9.1 TEST_VENV_NAME=test-docs-sphinx-build @@ -20,11 +20,15 @@ then . ${PYENV_ROOT}/versions/${TEST_VENV_NAME}/bin/activate fi +echo "Upgrading pip..." +pip install --upgrade pip + echo "Installing sphinx dependencies..." -SCRIPT_DIR=$(dirname $0) -DOCS_DIR=${SCRIPT_DIR}/../../docs +SCRIPT_DIR="$(dirname $0)" +ROOT_DIR="${SCRIPT_DIR}/../.." +DOCS_DIR="${ROOT_DIR}/docs" -pip install -r ${DOCS_DIR}/source/sphinx_requirements.txt +pip install .[docs] cd ${DOCS_DIR} make clean From a89af8f918d6dbd4de7130a263ce52bd224c2112 Mon Sep 17 00:00:00 2001 From: Bruno Castro-Karney Date: Fri, 10 Mar 2023 14:55:34 -0800 Subject: [PATCH 2/2] missing comma --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c863d6976..89ef60991 100755 --- a/setup.py +++ b/setup.py @@ -264,7 +264,7 @@ def initialize_options(self) -> None: 'sphinx>=5', # used to generate and upload docs - # need 5.0 or later for compatibility with other packages 'sphinx-rtd-theme>=1', # used to style docs for readthedocs.io - 'readthedocs-sphinx-ext>=2' # also used by readthedocs + 'readthedocs-sphinx-ext>=2', # also used by readthedocs 'recommonmark', # used to be able to use sphinx with markdown ] + ( # needed for readthedocs.io to be able to evaluate modules with