From 4456a12bd2d505c3e70edf9dec9df8c3b0c160ce Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 11 Aug 2023 14:00:10 -0500 Subject: [PATCH 01/16] Update maintainer info --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 738c195..d0face2 100644 --- a/setup.py +++ b/setup.py @@ -62,10 +62,10 @@ long_description=long_description, long_description_content_type="text/x-rst", version=package_version, - author="Josh Mock", - author_email="joshua.mock@elastic.co", - maintainer="Josh Mock", - maintainer_email="joshua.mock@elastic.co", + author="Elastic Clients Team", + author_email="clients-team@elastic.co", + maintainer="Elastic Clients Team", + maintainer_email="clients-team@elastic.co", project_urls={ "Documentation": "https://elasticsearch-serverless-python.readthedocs.io", "Source Code": "https://github.com/elastic/elasticsearch-serverless-python", From 9501d8c6809191dddd854c5f5f9609d8fda9e387 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 11 Aug 2023 14:00:32 -0500 Subject: [PATCH 02/16] Add a pyproject.toml Using Hatch https://hatch.pypa.io/ --- pyproject.toml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4051493 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "elasticsearch-serverless" +dynamic = ["version"] +description = "Python client for Elasticsearch Serverless" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7, <4" +authors = [ + { name = "Elastic Clients Team", email = "clients-team@elastic.co" }, +] +maintainers = [ + { name = "Elastic Clients Team", email = "clients-team@elastic.co" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "elastic-transport>=8,<9", +] + +[project.optional-dependencies] +async = [ + "aiohttp>=3,<4", +] +requests = [ + "requests>=2.4.0, <3.0.0", +] + +[project.urls] +Documentation = "https://elasticsearch-serverless-python.readthedocs.io" +Homepage = "https://github.com/elastic/elasticsearch-serverless-python" +"Issue Tracker" = "https://github.com/elastic/elasticsearch-serverless-python/issues" +"Source Code" = "https://github.com/elastic/elasticsearch-serverless-python" + +[tool.hatch.version] +path = "elasticsearch_serverless/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/elasticsearch_serverless", +] From cb2b023abdf28b30eaea63e7f2b4f7d50245a3fe Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 11 Aug 2023 14:10:57 -0500 Subject: [PATCH 03/16] Migrate setup.cfg into pyproject.toml Only flake8 does not support pyproject.toml so it stays for now --- pyproject.toml | 15 +++++++++++++++ setup.cfg | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4051493..bc54ca0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,3 +55,18 @@ path = "elasticsearch_serverless/__init__.py" include = [ "/elasticsearch_serverless", ] + +[tool.pytest] +junit_family = "legacy" +addopts = "-vvv -p no:logging --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc" + +[tool.isort] +profile = "black" + +[tool.coverage.report] +exclude_lines = [ + "raise NotImplementedError*", +] + +[tool.mypy] +ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg index a527b5b..403f26a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,16 +1,2 @@ [flake8] ignore = E203, E266, E501, W503 - -[tool:pytest] -junit_family=legacy -addopts = -vvv -p no:logging --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc - -[tool:isort] -profile=black - -[report] -exclude_lines= - raise NotImplementedError* - -[mypy] -ignore_missing_imports = True From 4f0c1d69ae82533b662db10f0b58e12382bedde5 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 11 Aug 2023 14:11:24 -0500 Subject: [PATCH 04/16] Drop unneeded setup.py --- setup.py | 99 -------------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index d0face2..0000000 --- a/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import re -from os.path import abspath, dirname, join - -from setuptools import find_packages, setup - -package_name = "elasticsearch_serverless" -base_dir = abspath(dirname(__file__)) - -with open(join(base_dir, package_name, "_version.py")) as f: - package_version = re.search( - r"__versionstr__\s+=\s+[\"\']([^\"\']+)[\"\']", f.read() - ).group(1) - -with open(join(base_dir, "README.rst")) as f: - # Remove reST raw directive from README as they're not allowed on PyPI - # Those blocks start with a newline and continue until the next newline - mode = None - lines = [] - for line in f: - if line.startswith(".. raw::"): - mode = "ignore_nl" - elif line == "\n": - mode = "wait_nl" if mode == "ignore_nl" else None - if mode is None: - lines.append(line) - - long_description = "".join(lines) - - -packages = [ - package - for package in find_packages(where=".", exclude=("test_elasticsearch_serverless*",)) - if package == package_name or package.startswith(package_name + ".") -] - -install_requires = ["elastic-transport>=8,<9"] -async_requires = ["aiohttp>=3,<4"] - -setup( - name=package_name, - description="Python client for Elasticsearch Serverless", - license="Apache-2.0", - url="https://github.com/elastic/elasticsearch-serverless-python", - long_description=long_description, - long_description_content_type="text/x-rst", - version=package_version, - author="Elastic Clients Team", - author_email="clients-team@elastic.co", - maintainer="Elastic Clients Team", - maintainer_email="clients-team@elastic.co", - project_urls={ - "Documentation": "https://elasticsearch-serverless-python.readthedocs.io", - "Source Code": "https://github.com/elastic/elasticsearch-serverless-python", - "Issue Tracker": "https://github.com/elastic/elasticsearch-serverless-python/issues", - }, - packages=packages, - package_data={"elasticsearch_serverless": ["py.typed", "*.pyi"]}, - include_package_data=True, - zip_safe=False, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - python_requires=">=3.7, <4", - install_requires=install_requires, - extras_require={ - "requests": ["requests>=2.4.0, <3.0.0"], - "async": async_requires, - }, -) From 18bfb724ecf38d72fa1533388ec42cfc19c10b64 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 11 Aug 2023 14:11:32 -0500 Subject: [PATCH 05/16] YAML linter fix --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 9a0b445..28bf890 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,3 +1,4 @@ +--- version: 2 sphinx: configuration: docs/sphinx/conf.py From 9801cc981e40e98b3f4498ede7b3000ec93801f0 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 15 Aug 2023 11:49:08 -0500 Subject: [PATCH 06/16] pyproject.toml cleanup --- MANIFEST.in | 2 +- noxfile.py | 2 +- pyproject.toml | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 5069744..d0b2e32 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,7 +4,7 @@ include MANIFEST.in include README.rst include NOTICE include CHANGELOG.md -include setup.py +include pyproject.toml recursive-include elasticsearch_serverless* py.typed *.pyi recursive-include docs/sphinx * diff --git a/noxfile.py b/noxfile.py index 31e3cba..44bffc9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,11 +22,11 @@ SOURCE_DIR = os.path.dirname(os.path.abspath(__file__)) SOURCE_FILES = ( "docs/sphinx/conf.py", - "setup.py", "noxfile.py", "elasticsearch_serverless/", "test_elasticsearch_serverless/", "utils/", + "pyproject.toml", ) diff --git a/pyproject.toml b/pyproject.toml index bc54ca0..f3d118c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,16 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] +keywords = [ + "elasticsearch", + "elastic", + "kibana", + "mapping", + "REST", + "search", + "client", + "index", +] dependencies = [ "elastic-transport>=8,<9", ] @@ -49,7 +59,8 @@ Homepage = "https://github.com/elastic/elasticsearch-serverless-python" "Source Code" = "https://github.com/elastic/elasticsearch-serverless-python" [tool.hatch.version] -path = "elasticsearch_serverless/__init__.py" +path = "elasticsearch_serverless/_version.py" +pattern = "__versionstr__ = \"(?P[^\"]+)\"" [tool.hatch.build.targets.sdist] include = [ @@ -58,7 +69,7 @@ include = [ [tool.pytest] junit_family = "legacy" -addopts = "-vvv -p no:logging --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc" +addopts = "-vvv -p no:logging --cov-report=term-missing --cov=elasticsearch_serverless --cov-config=.pyproject.toml" [tool.isort] profile = "black" From 55e4190d867932b6bcda7273ff3edb1c78974e6d Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 15 Aug 2023 11:54:35 -0500 Subject: [PATCH 07/16] Don't try to lint pyproject.toml Duh. --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 44bffc9..c6d0219 100644 --- a/noxfile.py +++ b/noxfile.py @@ -26,7 +26,6 @@ "elasticsearch_serverless/", "test_elasticsearch_serverless/", "utils/", - "pyproject.toml", ) From 105e571405c8638627a03bae9dfef05952379ec7 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 15 Aug 2023 12:40:12 -0500 Subject: [PATCH 08/16] Drop automation for version-bumping Not needed if we're not aligning versions with the Elastic stack for serverless. See https://github.com/elastic/clients-team/issues/618 --- .ci/make.sh | 7 +--- pyproject.toml | 4 -- utils/bump-version.py | 85 ------------------------------------------- 3 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 utils/bump-version.py diff --git a/.ci/make.sh b/.ci/make.sh index 7b0d227..0850858 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -152,12 +152,7 @@ if [[ "$CMD" == "assemble" ]]; then fi if [[ "$CMD" == "bump" ]]; then - docker run \ - --rm -v $repo:/code/elasticsearch-serverless-python \ - $product \ - /bin/bash -c "python /code/elasticsearch-serverless-python/utils/bump-version.py $VERSION" - - exit 0 + echo "TODO" fi if [[ "$CMD" == "codegen" ]]; then diff --git a/pyproject.toml b/pyproject.toml index f3d118c..51d1c4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,10 +58,6 @@ Homepage = "https://github.com/elastic/elasticsearch-serverless-python" "Issue Tracker" = "https://github.com/elastic/elasticsearch-serverless-python/issues" "Source Code" = "https://github.com/elastic/elasticsearch-serverless-python" -[tool.hatch.version] -path = "elasticsearch_serverless/_version.py" -pattern = "__versionstr__ = \"(?P[^\"]+)\"" - [tool.hatch.build.targets.sdist] include = [ "/elasticsearch_serverless", diff --git a/utils/bump-version.py b/utils/bump-version.py deleted file mode 100644 index a5ff868..0000000 --- a/utils/bump-version.py +++ /dev/null @@ -1,85 +0,0 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -"""Command line tool which changes the branch to be -ready to build and test the given Elastic stack version. -""" - -import re -import sys -from pathlib import Path - -SOURCE_DIR = Path(__file__).absolute().parent.parent - - -def find_and_replace(path, pattern, replace): - # Does a find and replace within a file path and complains - # if the given pattern isn't found in the file. - with open(path, "r") as f: - old_data = f.read() - - if re.search(pattern, old_data, flags=re.MULTILINE) is None: - print(f"Didn't find the pattern {pattern!r} in {path!s}") - exit(1) - - new_data = re.sub(pattern, replace, old_data, flags=re.MULTILINE) - with open(path, "w") as f: - f.truncate() - f.write(new_data) - - -def main(): - if len(sys.argv) != 2: - print("usage: utils/bump-version.py [stack version]") - exit(1) - - stack_version = sys.argv[1] - try: - python_version = re.search(r"^([0-9][0-9\.]*[0-9]+)", stack_version).group(1) - except AttributeError: - print(f"Couldn't match the given stack version {stack_version!r}") - exit(1) - - # Pad the version value with .0 until there - # we have the major, minor, and patch. - for _ in range(3): - if len(python_version.split(".")) >= 3: - break - python_version += ".0" - - find_and_replace( - path=SOURCE_DIR / "elasticsearch_serverless/_version.py", - pattern=r"__versionstr__ = \"[0-9]+[0-9\.]*[0-9](?:\+dev)?\"", - replace=f'__versionstr__ = "{python_version}"', - ) - - # These values should always be the 'major.minor-SNAPSHOT' - major_minor_version = ".".join(python_version.split(".")[:2]) - find_and_replace( - path=SOURCE_DIR / ".ci/test-matrix.yml", - pattern=r'STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"', - replace=f'STACK_VERSION:\n - "{major_minor_version}.0-SNAPSHOT"', - ) - find_and_replace( - path=SOURCE_DIR / ".github/workflows/unified-release.yml", - pattern=r'STACK_VERSION:\s+"[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"', - replace=f'STACK_VERSION: "{major_minor_version}-SNAPSHOT"', - ) - - -if __name__ == "__main__": - main() From 9b51c74191826d489f2dc2a21b569fee4aec67b0 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 15 Aug 2023 12:54:20 -0500 Subject: [PATCH 09/16] Make version static --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 51d1c4a..c474e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "elasticsearch-serverless" -dynamic = ["version"] +version = "0.1.0" description = "Python client for Elasticsearch Serverless" readme = "README.rst" license = "Apache-2.0" From e49b7a8dcb36a50e626845029ab2082c655dd976 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Wed, 16 Aug 2023 14:33:44 -0500 Subject: [PATCH 10/16] Drop dev-requirements.txt Use optional dependencies in pyproject.toml instead --- .ci/Dockerfile | 12 +++++------- .readthedocs.yml | 11 ++++++++++- dev-requirements.txt | 24 ------------------------ noxfile.py | 11 +++-------- pyproject.toml | 25 +++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 40 deletions(-) delete mode 100644 dev-requirements.txt diff --git a/.ci/Dockerfile b/.ci/Dockerfile index 5dd6687..49dfd7a 100644 --- a/.ci/Dockerfile +++ b/.ci/Dockerfile @@ -8,18 +8,16 @@ ARG BUILDER_GID=1000 ENV BUILDER_USER elastic ENV BUILDER_GROUP elastic +WORKDIR /code/elasticsearch-serverless-python + # Create user RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \ && useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \ - && mkdir -p /code/elasticsearch-py && mkdir /code/elasticsearch-py/build \ + && mkdir /code/elasticsearch-serverless-python/build \ && chown -R ${BUILDER_USER}:${BUILDER_GROUP} /code/ -COPY --chown=$BUILDER_USER:$BUILDER_GROUP . . -WORKDIR /code/elasticsearch-py USER ${BUILDER_USER}:${BUILDER_GROUP} -COPY dev-requirements.txt . +COPY --chown=$BUILDER_USER:$BUILDER_GROUP . . RUN python -m pip install \ -U --no-cache-dir \ --disable-pip-version-check \ - nox -rdev-requirements.txt -COPY --chown=$BUILDER_USER:$BUILDER_GROUP . . -RUN python -m pip install -U -e . + .[dev] diff --git a/.readthedocs.yml b/.readthedocs.yml index 28bf890..6ffa4ca 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,8 +3,17 @@ version: 2 sphinx: configuration: docs/sphinx/conf.py +build: + os: ubuntu-22.04 + tools: + python: "3.10" + jobs: + pre_install: + - "python -m pip install sphinx-rtd-theme sphinx-autodoc-typehints" + python: version: "3.7" install: - - requirements: dev-requirements.txt - path: . + extra_requirements: + - "docs" diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index f8360eb..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,24 +0,0 @@ -elastic-transport>=8.0.0b1, <9 -requests>=2, <3 -aiohttp -pytest -pytest-cov -pytest-asyncio -coverage -sphinx -jinja2 -python-dateutil -unasync -pyyaml>=5.4 -isort -black -twine -build -nox - -# No wheels for Python 3.10 yet! -numpy; python_version<"3.10" -pandas; python_version<"3.10" - -# Testing the 'search_mvt' API response -mapbox-vector-tile; python_version<"3.10" diff --git a/noxfile.py b/noxfile.py index c6d0219..6c88b74 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,8 +31,7 @@ @nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def test(session): - session.install(".") - session.install("-r", "dev-requirements.txt") + session.install(".[dev]") junit_xml = os.path.join( SOURCE_DIR, "junit", "elasticsearch-serverless-python-junit.xml" @@ -105,10 +104,6 @@ def lint(session): @nox.session() def docs(session): - session.install( - "-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints" - ) - session.install(".") - session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints") - + session.install("sphinx-rtd-theme", "sphinx-autodoc-typehints") + session.install(".[docs]") session.run("sphinx-build", "docs/sphinx/", "docs/sphinx/_build", "-b", "html") diff --git a/pyproject.toml b/pyproject.toml index c474e8c..7219af3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,31 @@ async = [ requests = [ "requests>=2.4.0, <3.0.0", ] +dev = [ + "requests>=2, <3", + "aiohttp", + "pytest", + "pytest-cov", + "pytest-asyncio", + "coverage", + "jinja2", + "python-dateutil", + "unasync", + "pyyaml>=5.4", + "isort", + "black", + "twine", + "build", + "nox", + "numpy", + "pandas", + "mapbox-vector-tile", +] +docs = [ + "sphinx-rtd-theme", + "sphinx-autodoc-typehints", + "sphinx", +] [project.urls] Documentation = "https://elasticsearch-serverless-python.readthedocs.io" From 96e5519b4d2ea4428fe36a2d86343bab28b91df3 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Wed, 16 Aug 2023 14:44:31 -0500 Subject: [PATCH 11/16] Get docs builds running correctly --- docs/sphinx/api.rst | 4 ++-- docs/sphinx/conf.py | 2 +- docs/sphinx/exceptions.rst | 2 +- docs/sphinx/index.rst | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/api.rst b/docs/sphinx/api.rst index 60fc550..e989557 100644 --- a/docs/sphinx/api.rst +++ b/docs/sphinx/api.rst @@ -17,12 +17,12 @@ arguments are required for all Elasticsearch ------------- -.. py:module:: elasticsearch +.. py:module:: elasticsearch_serverless .. autoclass:: Elasticsearch :members: -.. py:module:: elasticsearch.client +.. py:module:: elasticsearch_serverless.client Async Search ------------ diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 3ef4f44..f7b9ff8 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -35,7 +35,7 @@ master_doc = "index" # General information about the project. -project = "Python Elasticsearch client" +project = "Python Elasticsearch serverless client" copyright = "%d, Elasticsearch B.V" % datetime.date.today().year version = elasticsearch_serverless.__versionstr__ diff --git a/docs/sphinx/exceptions.rst b/docs/sphinx/exceptions.rst index 32c01d6..914c64b 100644 --- a/docs/sphinx/exceptions.rst +++ b/docs/sphinx/exceptions.rst @@ -3,7 +3,7 @@ Exceptions & Warnings ===================== -.. py:module:: elasticsearch +.. py:module:: elasticsearch_serverless API Errors ---------- diff --git a/docs/sphinx/index.rst b/docs/sphinx/index.rst index db23a87..db5743a 100644 --- a/docs/sphinx/index.rst +++ b/docs/sphinx/index.rst @@ -1,7 +1,7 @@ -Python Elasticsearch Client -=========================== +Python Elasticsearch Serverless Client +====================================== -Official low-level client for Elasticsearch. Its goal is to provide common +Official low-level client for Elasticsearch serverless. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable. From f108a36c6587e0e2fece67db23ec29a4593e7884 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 17 Aug 2023 10:15:58 -0500 Subject: [PATCH 12/16] Drop unneeded python version from RTD config --- .readthedocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 6ffa4ca..7939f4c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -12,7 +12,6 @@ build: - "python -m pip install sphinx-rtd-theme sphinx-autodoc-typehints" python: - version: "3.7" install: - path: . extra_requirements: From 16c972f8aa242195dc159578bd2ba01ad2ea1f1d Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 17 Aug 2023 10:34:00 -0500 Subject: [PATCH 13/16] Drop unneeded pre-install job for RTD --- .readthedocs.yml | 3 --- noxfile.py | 1 - pyproject.toml | 4 ++-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 7939f4c..bde08ba 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,9 +7,6 @@ build: os: ubuntu-22.04 tools: python: "3.10" - jobs: - pre_install: - - "python -m pip install sphinx-rtd-theme sphinx-autodoc-typehints" python: install: diff --git a/noxfile.py b/noxfile.py index 6c88b74..fa9e23e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -104,6 +104,5 @@ def lint(session): @nox.session() def docs(session): - session.install("sphinx-rtd-theme", "sphinx-autodoc-typehints") session.install(".[docs]") session.run("sphinx-build", "docs/sphinx/", "docs/sphinx/_build", "-b", "html") diff --git a/pyproject.toml b/pyproject.toml index 7219af3..24b6fe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,9 +72,9 @@ dev = [ "mapbox-vector-tile", ] docs = [ - "sphinx-rtd-theme", + "sphinx-rtd-theme>=1.2.2", "sphinx-autodoc-typehints", - "sphinx", + "sphinx==6.2.1", ] [project.urls] From b5600f93e7bcd2f9bd6099d8ce663f1a9ea8a585 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 17 Aug 2023 11:04:00 -0500 Subject: [PATCH 14/16] Migrate MANIFEST.in rules into pyproject.toml --- MANIFEST.in | 14 -------------- pyproject.toml | 7 +++++++ 2 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index d0b2e32..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,14 +0,0 @@ -include CONTRIBUTING.md -include LICENSE -include MANIFEST.in -include README.rst -include NOTICE -include CHANGELOG.md -include pyproject.toml -recursive-include elasticsearch_serverless* py.typed *.pyi -recursive-include docs/sphinx * - -prune docs/sphinx/_build -prune test_elasticsearch_serverless -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] diff --git a/pyproject.toml b/pyproject.toml index 24b6fe9..80ef924 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,13 @@ Homepage = "https://github.com/elastic/elasticsearch-serverless-python" [tool.hatch.build.targets.sdist] include = [ "/elasticsearch_serverless", + "/CHANGELOG.md", + "/CONTRIBUTING.md", + "/LICENSE", + "/NOTICE", + "/README.rst", + "/setup.cfg", + "/docs/sphinx", ] [tool.pytest] From f2e091d5b72983113f15b5e6432394099c4914c9 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 17 Aug 2023 11:05:11 -0500 Subject: [PATCH 15/16] Update docs/sphinx/conf.py Co-authored-by: Quentin Pradet --- docs/sphinx/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index f7b9ff8..be1274a 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -35,7 +35,7 @@ master_doc = "index" # General information about the project. -project = "Python Elasticsearch serverless client" +project = "Python Elasticsearch Serverless client" copyright = "%d, Elasticsearch B.V" % datetime.date.today().year version = elasticsearch_serverless.__versionstr__ From 177e9abe39b62896b9ffb23fde015d8bf3796695 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 17 Aug 2023 11:05:36 -0500 Subject: [PATCH 16/16] Update docs/sphinx/index.rst Co-authored-by: Quentin Pradet --- docs/sphinx/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/index.rst b/docs/sphinx/index.rst index db5743a..96b8dda 100644 --- a/docs/sphinx/index.rst +++ b/docs/sphinx/index.rst @@ -1,7 +1,7 @@ Python Elasticsearch Serverless Client ====================================== -Official low-level client for Elasticsearch serverless. Its goal is to provide common +Official low-level client for Elasticsearch Serverless. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable.