Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make docker dependency optional #768

Closed
andreer opened this issue May 10, 2024 · 6 comments
Closed

Make docker dependency optional #768

andreer opened this issue May 10, 2024 · 6 comments
Assignees

Comments

@andreer
Copy link
Member

andreer commented May 10, 2024

Suggestion: make docker (and pontentially more) dependencies optional, in the case where pyvespa is only being used as a client library to an existing vespa setup.

@thomasht86
Copy link
Collaborator

Is it mostly to make the package lighter, or have you encountered any issues with regards to the docker dependency?
If only the first, considering the small size of the docker-package: https://pypi.org/project/docker/7.0.0/#files, i think it would not justify much effort.
If the latter, it would be easy to make a lightweight option (pip install pyvespa[no-docker]).
Then we wouldn't need to change anything in CI etc.

@tokle tokle added this to the soon milestone May 15, 2024
@tokle
Copy link
Member

tokle commented May 15, 2024

Suggestion: pip install pyvespa[no-docker]

@thomasht86
Copy link
Collaborator

thomasht86 commented May 15, 2024

Upon further investigation, I found that the suggestion contradicts the related PEP, and thus is not supported in pyproject.toml by default.

For projects which are packages, extras are a common solution for defining development dependencies, but even under these circumstances they have downsides:

  • Because an extra defines optional additional dependencies, it is not possible to install an extra without installing the current package and its dependencies.
  • Because they are user-installable, extras are part of the public interface for packages. Because extras are published, package developers often are concerned about ensuring that their development extras are not confused with user-facing extras.

I could still make it happen, by adding back a setup.py, but it doesn't feel like a good practice.

Given the small size of the docker dependency (259kB), is it worth it? @andreer @jobergum

@jobergum
Copy link
Member

no

@thomasht86
Copy link
Collaborator

Checked whether the docker-package introduced many other dependencies as well, but it does not.

pip show docker

Name: docker
Version: 7.0.0
Summary: A Python library for the Docker Engine API.
Home-page: https://github.com/docker/docker-py
Author: 
Author-email: 
License: Apache License 2.0
Location: /Users/thomas/.pyenv/versions/3.11.8/envs/pyvespa-build/lib/python3.11/site-packages
Requires: packaging, requests, urllib3
Required-by: pyvespa

Ok to close the issue?

@thomasht86 thomasht86 removed this from the soon milestone May 21, 2024
@jobergum
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants