Skip to content

Commit e49b7a8

Browse files
committed
Drop dev-requirements.txt
Use optional dependencies in pyproject.toml instead
1 parent 9b51c74 commit e49b7a8

File tree

5 files changed

+43
-40
lines changed

5 files changed

+43
-40
lines changed

.ci/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ ARG BUILDER_GID=1000
88
ENV BUILDER_USER elastic
99
ENV BUILDER_GROUP elastic
1010

11+
WORKDIR /code/elasticsearch-serverless-python
12+
1113
# Create user
1214
RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
1315
&& useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \
14-
&& mkdir -p /code/elasticsearch-py && mkdir /code/elasticsearch-py/build \
16+
&& mkdir /code/elasticsearch-serverless-python/build \
1517
&& chown -R ${BUILDER_USER}:${BUILDER_GROUP} /code/
16-
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
17-
WORKDIR /code/elasticsearch-py
1818
USER ${BUILDER_USER}:${BUILDER_GROUP}
19-
COPY dev-requirements.txt .
19+
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
2020
RUN python -m pip install \
2121
-U --no-cache-dir \
2222
--disable-pip-version-check \
23-
nox -rdev-requirements.txt
24-
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
25-
RUN python -m pip install -U -e .
23+
.[dev]

.readthedocs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ version: 2
33
sphinx:
44
configuration: docs/sphinx/conf.py
55

6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.10"
10+
jobs:
11+
pre_install:
12+
- "python -m pip install sphinx-rtd-theme sphinx-autodoc-typehints"
13+
614
python:
715
version: "3.7"
816
install:
9-
- requirements: dev-requirements.txt
1017
- path: .
18+
extra_requirements:
19+
- "docs"

dev-requirements.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

noxfile.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131

3232
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
3333
def test(session):
34-
session.install(".")
35-
session.install("-r", "dev-requirements.txt")
34+
session.install(".[dev]")
3635

3736
junit_xml = os.path.join(
3837
SOURCE_DIR, "junit", "elasticsearch-serverless-python-junit.xml"
@@ -105,10 +104,6 @@ def lint(session):
105104

106105
@nox.session()
107106
def docs(session):
108-
session.install(
109-
"-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints"
110-
)
111-
session.install(".")
112-
session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints")
113-
107+
session.install("sphinx-rtd-theme", "sphinx-autodoc-typehints")
108+
session.install(".[docs]")
114109
session.run("sphinx-build", "docs/sphinx/", "docs/sphinx/_build", "-b", "html")

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,31 @@ async = [
5151
requests = [
5252
"requests>=2.4.0, <3.0.0",
5353
]
54+
dev = [
55+
"requests>=2, <3",
56+
"aiohttp",
57+
"pytest",
58+
"pytest-cov",
59+
"pytest-asyncio",
60+
"coverage",
61+
"jinja2",
62+
"python-dateutil",
63+
"unasync",
64+
"pyyaml>=5.4",
65+
"isort",
66+
"black",
67+
"twine",
68+
"build",
69+
"nox",
70+
"numpy",
71+
"pandas",
72+
"mapbox-vector-tile",
73+
]
74+
docs = [
75+
"sphinx-rtd-theme",
76+
"sphinx-autodoc-typehints",
77+
"sphinx",
78+
]
5479

5580
[project.urls]
5681
Documentation = "https://elasticsearch-serverless-python.readthedocs.io"

0 commit comments

Comments
 (0)