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

ipython: remove dependency tree on matplotlib #33584

Closed
wants to merge 4 commits into from

Conversation

eli-schwartz
Copy link
Contributor

git --no-pager log -pC -D origin/master..HEAD
commit 8691f0ad3009d890c24f47b1c4eb3d2616514fa3
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: Sat Oct 14 23:09:38 2023
Commit:     Eli Schwartz <eschwartz93@gmail.com>
CommitDate: Sun Oct 29 23:23:58 2023

    dev-python/ipython: remove runtime dependency on setuptools
    
    It was removed from setup.cfg in ipython 8.5 "because it is not even
    used". This historical error should be corrected in gentoo packaging as
    well.
    
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>

diff --git a/dev-python/ipython/ipython-8.14.0-r1.ebuild b/dev-python/ipython/ipython-8.14.0-r1.ebuild
index 508e90e381ff..a72f120f30ca 100644
--- a/dev-python/ipython/ipython-8.14.0-r1.ebuild
+++ b/dev-python/ipython/ipython-8.14.0-r1.ebuild
@@ -32,7 +32,6 @@ RDEPEND="
 	>=dev-python/prompt-toolkit-3.0.38[${PYTHON_USEDEP}]
 	<dev-python/prompt-toolkit-3.1[${PYTHON_USEDEP}]
 	>=dev-python/pygments-2.4.0[${PYTHON_USEDEP}]
-	dev-python/setuptools[${PYTHON_USEDEP}]
 	dev-python/stack-data[${PYTHON_USEDEP}]
 	>=dev-python/traitlets-5.0[${PYTHON_USEDEP}]
 	$(python_gen_cond_dep '
diff --git a/dev-python/ipython/ipython-8.15.0-r1.ebuild b/dev-python/ipython/ipython-8.15.0-r1.ebuild
index 508e90e381ff..a72f120f30ca 100644
--- a/dev-python/ipython/ipython-8.15.0-r1.ebuild
+++ b/dev-python/ipython/ipython-8.15.0-r1.ebuild
@@ -32,7 +32,6 @@ RDEPEND="
 	>=dev-python/prompt-toolkit-3.0.38[${PYTHON_USEDEP}]
 	<dev-python/prompt-toolkit-3.1[${PYTHON_USEDEP}]
 	>=dev-python/pygments-2.4.0[${PYTHON_USEDEP}]
-	dev-python/setuptools[${PYTHON_USEDEP}]
 	dev-python/stack-data[${PYTHON_USEDEP}]
 	>=dev-python/traitlets-5.0[${PYTHON_USEDEP}]
 	$(python_gen_cond_dep '
diff --git a/dev-python/ipython/ipython-8.16.1-r1.ebuild b/dev-python/ipython/ipython-8.16.1-r1.ebuild
index 508e90e381ff..a72f120f30ca 100644
--- a/dev-python/ipython/ipython-8.16.1-r1.ebuild
+++ b/dev-python/ipython/ipython-8.16.1-r1.ebuild
@@ -32,7 +32,6 @@ RDEPEND="
 	>=dev-python/prompt-toolkit-3.0.38[${PYTHON_USEDEP}]
 	<dev-python/prompt-toolkit-3.1[${PYTHON_USEDEP}]
 	>=dev-python/pygments-2.4.0[${PYTHON_USEDEP}]
-	dev-python/setuptools[${PYTHON_USEDEP}]
 	dev-python/stack-data[${PYTHON_USEDEP}]
 	>=dev-python/traitlets-5.0[${PYTHON_USEDEP}]
 	$(python_gen_cond_dep '

commit b6f00b2d0f30258daa0f1e484c73c447111286c1
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: Fri Oct 13 00:00:47 2023
Commit:     Eli Schwartz <eschwartz93@gmail.com>
CommitDate: Sun Oct 29 23:23:58 2023

    dev-python/ipython: remove dependency on matplotlib
    
    ipython does not use or rely on matplotlib in any way. It does contain
    imports for it, but these imports are only triggered by the act of
    typing `%matplotlib` into the interactive shell, which is an ipython
    "magic" that runs matplotlib with some enhanced context.
    
    People who do not use matplotlib don't need to have its installation
    forced, and people who do use matplotlib will have it installed before
    interactively using it, much as they do when interactively using it with
    `import matplotlib`.
    
    It is intentionally not listed as an install requirement in setup.cfg,
    although the matplotlib-inline module *is* listed as an install
    requirement. (matplotlib-inline contains the actual implementation of
    the magic, and is very lightweight, so it is not particularly
    advantageous to add a USE flag for it. Users of matplotlib won't
    automatically have the -inline module installed.)
    
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>

diff --git a/dev-python/ipython/ipython-8.15.0.ebuild b/dev-python/ipython/ipython-8.14.0-r1.ebuild
similarity index 99%
copy from dev-python/ipython/ipython-8.15.0.ebuild
copy to dev-python/ipython/ipython-8.14.0-r1.ebuild
index 06718c60a951..508e90e381ff 100644
--- a/dev-python/ipython/ipython-8.15.0.ebuild
+++ b/dev-python/ipython/ipython-8.14.0-r1.ebuild
@@ -26,7 +26,6 @@ RDEPEND="
 	dev-python/backcall[${PYTHON_USEDEP}]
 	dev-python/decorator[${PYTHON_USEDEP}]
 	>=dev-python/jedi-0.16[${PYTHON_USEDEP}]
-	dev-python/matplotlib[${PYTHON_USEDEP}]
 	dev-python/matplotlib-inline[${PYTHON_USEDEP}]
 	>=dev-python/pexpect-4.3[${PYTHON_USEDEP}]
 	dev-python/pickleshare[${PYTHON_USEDEP}]
diff --git a/dev-python/ipython/ipython-8.15.0.ebuild b/dev-python/ipython/ipython-8.15.0-r1.ebuild
similarity index 99%
copy from dev-python/ipython/ipython-8.15.0.ebuild
copy to dev-python/ipython/ipython-8.15.0-r1.ebuild
index 06718c60a951..508e90e381ff 100644
--- a/dev-python/ipython/ipython-8.15.0.ebuild
+++ b/dev-python/ipython/ipython-8.15.0-r1.ebuild
@@ -26,7 +26,6 @@ RDEPEND="
 	dev-python/backcall[${PYTHON_USEDEP}]
 	dev-python/decorator[${PYTHON_USEDEP}]
 	>=dev-python/jedi-0.16[${PYTHON_USEDEP}]
-	dev-python/matplotlib[${PYTHON_USEDEP}]
 	dev-python/matplotlib-inline[${PYTHON_USEDEP}]
 	>=dev-python/pexpect-4.3[${PYTHON_USEDEP}]
 	dev-python/pickleshare[${PYTHON_USEDEP}]
diff --git a/dev-python/ipython/ipython-8.15.0.ebuild b/dev-python/ipython/ipython-8.16.1-r1.ebuild
similarity index 99%
copy from dev-python/ipython/ipython-8.15.0.ebuild
copy to dev-python/ipython/ipython-8.16.1-r1.ebuild
index 06718c60a951..508e90e381ff 100644
--- a/dev-python/ipython/ipython-8.15.0.ebuild
+++ b/dev-python/ipython/ipython-8.16.1-r1.ebuild
@@ -26,7 +26,6 @@ RDEPEND="
 	dev-python/backcall[${PYTHON_USEDEP}]
 	dev-python/decorator[${PYTHON_USEDEP}]
 	>=dev-python/jedi-0.16[${PYTHON_USEDEP}]
-	dev-python/matplotlib[${PYTHON_USEDEP}]
 	dev-python/matplotlib-inline[${PYTHON_USEDEP}]
 	>=dev-python/pexpect-4.3[${PYTHON_USEDEP}]
 	dev-python/pickleshare[${PYTHON_USEDEP}]

commit 668f22dce878f92bb13a756cfeb3766434bc7d24
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: Thu Oct 12 23:59:40 2023
Commit:     Eli Schwartz <eschwartz93@gmail.com>
CommitDate: Sun Oct 29 23:23:57 2023

    dev-python/ipython: drop old 8.16.0
    
    unstable, superseded by a .1 point release
    
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>

diff --git a/dev-python/ipython/Manifest b/dev-python/ipython/Manifest
index 0bfa20c73b8d..ea70b965688f 100644
--- a/dev-python/ipython/Manifest
+++ b/dev-python/ipython/Manifest
@@ -1,4 +1,3 @@
 DIST ipython-8.14.0.tar.gz 5470735 BLAKE2B 9789b49b771e69439f957ff85d81f40e6511f4440e2372cac881c708503a5ce1c22e9f1fac45828ee723d1bd9b9ee4684c475d08ed96ed98396faf1400b802af SHA512 94fe14fd914fa81fdb8e370cf0fe7bfb4286be1972b4499ed96e9bf7d018e89f586f3386269e1dafc4a2bc279df7980635bd748799639d6020f52c1cc8af6702
 DIST ipython-8.15.0.tar.gz 5482758 BLAKE2B 596e87a1952995c1581e377f8306c02d1a37f29e04e7baa040a2ed78da1deea7f4de45b7af84919c47005c70f3e5fe2155a891cb3b5923e0ee76d2ff027036a5 SHA512 881b8d2caf051ee6a44af3c73f342e55eaf588ad096d0d2da08a10ee4699cb31b3550825091833848df9ed75657c9a2a1daf0b9b65ac7a3927c04a8d6e7cb1a9
-DIST ipython-8.16.0.tar.gz 5484881 BLAKE2B e5ceaf994a29edb0ccb53d6b561f0cb4dd64eefe2c57040e94c5984314e456e7752d656ece482b690c66099368906ab02565027bc7b5dc3af0d80be9a4be4c43 SHA512 b8e91137c5bfc559468985403a2fd20a4a42aa6439a1a1667fe050a07529886cee334943a00c09a34e6617a4f4583f7ca9cb840d1661946b5acc0e903c6aeda4
 DIST ipython-8.16.1.tar.gz 5485037 BLAKE2B c5429b1df9906681f9792d7bc3005a3a41f7d89f7d6c104f9826902134179f7149de0747a50f31c53d277a135d0fedd0952aa23fce3650f026ac3c1733287ecb SHA512 0feb4c14e8e7f34829cd8b6c43c91c9bb5b6c85ae60173951db4354296474945268fb8d3caedcfae8457783e6d27a6dc33b6291bf2d9a691526fc44199724887
diff --git a/dev-python/ipython/ipython-8.16.0.ebuild b/dev-python/ipython/ipython-8.16.0.ebuild
deleted file mode 100644
index 06718c60a951..000000000000

commit 99525c29796d6db4a99a00c8d10b4badb64208da
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: Thu Oct 12 23:51:32 2023
Commit:     Eli Schwartz <eschwartz93@gmail.com>
CommitDate: Sun Oct 29 23:23:57 2023

    dev-python/matplotlib-inline: drop undesirable dependency on matplotlib
    
    This python module is an ipython extension that exists solely to
    implement the `%matplotlib` magic inside of the ipython shell and
    directly interacts with the ipython extension API to do it. Despite
    this, it does NOT have an ebuild dependency on ipython itself, even
    though you cannot `import matplotlib_inline.backend_inline` without
    ipython installed.
    
    It does have a dependency on matplotlib, which is another import-time
    import.
    
    However, the setup.cfg intentionally avoids depending on either one.
    This is because both are actually internal implementation details of
    *ipython*. In turn, ipython does not wish to have a mandatory runtime
    dependency on matplotlib, all it wishes to do is have code prepared and
    ready to import matplotlib, should a user execute `%matplotlib` in the
    interactive console. In this case, it is assumed that the user has also
    installed matplotlib.
    
    Respect the upstream dependency.
    
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>

diff --git a/dev-python/matplotlib-inline/matplotlib-inline-0.1.6.ebuild b/dev-python/matplotlib-inline/matplotlib-inline-0.1.6-r1.ebuild
similarity index 77%
copy from dev-python/matplotlib-inline/matplotlib-inline-0.1.6.ebuild
copy to dev-python/matplotlib-inline/matplotlib-inline-0.1.6-r1.ebuild
index dd7ba2befbae..9abe5e6a0511 100644
--- a/dev-python/matplotlib-inline/matplotlib-inline-0.1.6.ebuild
+++ b/dev-python/matplotlib-inline/matplotlib-inline-0.1.6-r1.ebuild
@@ -17,9 +17,8 @@ SRC_URI="
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~arm64-macos ~x64-macos"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
 
 RDEPEND="
-	dev-python/matplotlib[${PYTHON_USEDEP}]
 	dev-python/traitlets[${PYTHON_USEDEP}]
 "

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @eli-schwartz
Areas affected: ebuilds
Packages affected: dev-python/ipython, dev-python/matplotlib-inline

dev-python/ipython: @gentoo/python
dev-python/matplotlib-inline: @gentoo/python

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits. labels Oct 30, 2023
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"

RDEPEND="
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's worth a comment here above RDEPEND for the lack of mpl dep.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that still necessary considering the optfeatures suggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answering my own question: that was a dumb, sleep-deprived question because we are not talking about the same package.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-10-30 03:46 UTC
Newest commit scanned: 8691f0a
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/cecc272186/output.html

optfeature "code formatting" dev-python/black
optfeature "sympyprinting" dev-python/sympy
optfeature "cythonmagic" dev-python/cython
optfeature "%lprun magic command" dev-python/line-profiler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we drop the rdep, then we should probably add mpl to the optfeature list here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, that makes a lot of sense especially considering how integrated other magic commands already are here. :)

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-10-30 12:26 UTC
Newest commit scanned: 810d1ab
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/803396c306/output.html

This python module is an ipython extension that exists solely to
implement the `%matplotlib` magic inside of the ipython shell and
directly interacts with the ipython extension API to do it. Despite
this, it does NOT have an ebuild dependency on ipython itself, even
though you cannot `import matplotlib_inline.backend_inline` without
ipython installed.

It does have a dependency on matplotlib, which is another import-time
import.

However, the setup.cfg intentionally avoids depending on either one.
This is because both are actually internal implementation details of
*ipython*. In turn, ipython does not wish to have a mandatory runtime
dependency on matplotlib, all it wishes to do is have code prepared and
ready to import matplotlib, should a user execute `%matplotlib` in the
interactive console. In this case, it is assumed that the user has also
installed matplotlib.

Respect the upstream dependency.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
unstable, superseded by a .1 point release

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
ipython does not use or rely on matplotlib at runtime in any way. It
does contain imports for it, but these imports are only triggered by the
act of typing `%matplotlib` into the interactive shell, which is an
ipython "magic" that runs matplotlib with some enhanced context.

People who do not use matplotlib don't need to have its installation
forced, and people who do use matplotlib will have it installed before
interactively using it, much as they do when interactively using it with
`import matplotlib`.

It is intentionally not listed as an install requirement in setup.cfg,
although the matplotlib-inline module *is* listed as an install
requirement. (matplotlib-inline contains the actual implementation of
the magic, and is very lightweight, so it is not particularly
advantageous to add a USE flag for it. Users of matplotlib won't
automatically have the -inline module installed.)

Per the way other magic commands work, the correct place to notify users
about the availability of these is using optfeature.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
It was removed from setup.cfg in ipython 8.5 "because it is not even
used". This historical error should be corrected in gentoo packaging as
well.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
@eli-schwartz
Copy link
Contributor Author

Updated with the comment plus revbumping and fixing up the new ipython version that was committed today.

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-10-30 19:46 UTC
Newest commit scanned: 9916ede
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/d708be1be1/output.html

@eli-schwartz eli-schwartz deleted the ipython branch October 31, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). no bug found No Bug/Closes found in the commits.
Projects
None yet
5 participants