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

remove pylatexenc as required dependency #2417

Closed
ajavadia opened this issue May 14, 2019 · 2 comments · Fixed by #2451
Closed

remove pylatexenc as required dependency #2417

ajavadia opened this issue May 14, 2019 · 2 comments · Fixed by #2451

Comments

@ajavadia
Copy link
Member

What is the expected enhancement?

pylatexenc is used in a relatively minor place for formatting latex_drawer's strings. Given that everything associated with latex drawing is optional itself, this part should also be optional and not a core dependency of terra.

@mtreinish
Copy link
Member

Well that's not entirely the case, we also have pillow in requirements which is also only used for latex drawing. The thing which is optional is the external dependencies like pdflatex and the latex requirements (because we don't have a mechanism to require them). I'd actually argue that pillow should be optional but not pylatexenc, mostly because pylatexenc is used by the latex_source backend which has no other external dependencies and just returns a string.

@ajavadia
Copy link
Member Author

pillow should also be optional.
This was the point of creating a text drawer so that we could make the dependencies light. Terra is very much usable without them.
I think all of these should be part of the extra visualization requirements -- along with matplotlib, nxpd, ipywidgets, pydot that are already there.

mtreinish added a commit to mtreinish/qiskit-core that referenced this issue May 18, 2019
The pylatexenc and pillow requirements are only used in the latex and
latex_source circuit drawers. Since this isn't used by everyone and is a
non-default circuit drawer there is no reason we should force our users
to install these by default. This commit updates the requirements list
and setup.py to make these 2 requirements optional and included in the
visualization setuptools extras to ease installation. If the packages
are not installed it will raise an ImportError with a detailed exception
explaining how to install the missing dependency.

Fixes Qiskit#2417
nonhermitian pushed a commit that referenced this issue May 21, 2019
* Make pylatexenc and pillow optional

The pylatexenc and pillow requirements are only used in the latex and
latex_source circuit drawers. Since this isn't used by everyone and is a
non-default circuit drawer there is no reason we should force our users
to install these by default. This commit updates the requirements list
and setup.py to make these 2 requirements optional and included in the
visualization setuptools extras to ease installation. If the packages
are not installed it will raise an ImportError with a detailed exception
explaining how to install the missing dependency.

Fixes #2417

* Fix lint

* Fix lint again
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
* Make pylatexenc and pillow optional

The pylatexenc and pillow requirements are only used in the latex and
latex_source circuit drawers. Since this isn't used by everyone and is a
non-default circuit drawer there is no reason we should force our users
to install these by default. This commit updates the requirements list
and setup.py to make these 2 requirements optional and included in the
visualization setuptools extras to ease installation. If the packages
are not installed it will raise an ImportError with a detailed exception
explaining how to install the missing dependency.

Fixes Qiskit#2417

* Fix lint

* Fix lint again
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

Successfully merging a pull request may close this issue.

2 participants