Skip to content

Commit

Permalink
Merge pull request #1648 from consideRatio/pr/update-pycurl-requireme…
Browse files Browse the repository at this point in the history
…nt-handling

maint: refactoring around pycurl as an optional dependency
  • Loading branch information
consideRatio committed Apr 19, 2023
2 parents d677034 + 8dc97b8 commit 8738813
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ jobs:
- name: Setup Python package dependencies
run: |
pip install -r dev-requirements.txt -r testing/local-binder-local-hub/requirements.txt
pip install .
pip install ".[pycurl]"
- name: Setup JupyterHub NPM dependencies
run: npm install -g configurable-http-proxy
Expand Down
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jsonschema
jupyter-repo2docker>=2021.08.0
jupyter_packaging>=0.10.4,<2
jupyterhub
pycurl
pytest
pytest-asyncio
pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ continue.
requirements locally.

```bash
python3 -m pip install -e . -r dev-requirements.txt
python3 -m pip install -e ".[pycurl]" -r dev-requirements.txt
```

1. Install the JupyterHub Helm chart by itself into your Kubernetes cluster
Expand Down
10 changes: 4 additions & 6 deletions helm-chart/images/binderhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ ARG PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
pip install build \
&& pip wheel --wheel-dir=/tmp/wheels \
. \
pycurl \
-r helm-chart/images/binderhub/requirements.txt
-r helm-chart/images/binderhub/requirements.txt \
.


# The final stage
Expand Down Expand Up @@ -63,9 +62,8 @@ ARG PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
--mount=type=cache,from=build-stage,source=/tmp/wheels,target=/tmp/wheels \
pip install --find-links=/tmp/wheels/ \
binderhub \
pycurl \
-r /tmp/requirements.txt
-r /tmp/requirements.txt \
binderhub

# verify success of previous step
RUN python -c "import pycurl, binderhub.app"
Expand Down
6 changes: 6 additions & 0 deletions helm-chart/images/binderhub/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ jupyterhub==3.*
kubernetes==9.*

# binderhub's dependencies
#
# We can't put ".[pycurl]" here directly as when we freeze this into
# requirements.txt using ci/refreeze, its declaring "binderhub @ file:///io"
# which is a problem as its an absolute path.
#
pycurl
-r ../../../requirements.txt
2 changes: 2 additions & 0 deletions helm-chart/images/binderhub/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ pyasn1-modules==0.2.8
# via google-auth
pycparser==2.21
# via cffi
pycurl==7.45.2
# via -r helm-chart/images/binderhub/requirements.in
pyjwt==2.6.0
# via -r helm-chart/images/binderhub/../../../requirements.txt
pyopenssl==23.1.1
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# About pycurl:
# - pycurl is an optional dependency which improves performance
# - pycurl requires both `curl-config` and `gcc` to be available when installing
# it from source.
# - the reason we do not list pycurl here is that it is not needed when our
# code is imported to generate the documentation and it is tricky to install
# in the ReadTheDocs build environment.
docker
escapism
jinja2
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@
include_package_data=True,
install_requires=requirements,
extras_require={
# optional dependency which improves performance
# pycurl is an optional dependency which improves performance
#
# - pycurl requires both `curl-config` and `gcc` to be available when
# installing it from source.
# - pycurl should always be used in production, but it's not relevant
# for building documentation which inspects the source code.
#
"pycurl": ["pycurl"],
},
)

0 comments on commit 8738813

Please sign in to comment.