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 dependency on nose (port to pytest) #17

Open
mcepl opened this issue Jan 11, 2021 · 14 comments
Open

Remove dependency on nose (port to pytest) #17

mcepl opened this issue Jan 11, 2021 · 14 comments

Comments

@mcepl
Copy link

mcepl commented Jan 11, 2021

I am a maintainer of Python packages in openSUSE, and I am on my crusade of eliminating nose1 from our distribution. When I look at its repository on https://github.com/nose-devs/nose, the last release 1.3.7 was on 2 Jun 2015, and even the last commit on the master branch was on 4 Mar 2016.

This patch eliminates dependency on nose, which has been unnecessary for a long time. Resulting test suite depends on pytest, which is currently perfectly developed and maintained.

@Carreau
Copy link
Member

Carreau commented Jan 12, 2021

Many thanks for working on this. I'll try to integrate this and might do a release. Thought it may take some time. Another possibility would be to finish removing usage of this package from the dependees.

@mcepl
Copy link
Author

mcepl commented Jan 12, 2021

I work for SUSE, which means we are working on hundreds of packages, so I cannot concentrate on one particular package for too long … my current enemy is nose, and so I eliminate it. Concerning dependees, given this whole package has been already deprecated, it seems weird how stubbornly it refuses to die.

@Carreau
Copy link
Member

Carreau commented Jan 12, 2021

Concerning dependees, given this whole package has been already deprecated, it seems weird how stubbornly it refuses to die.

Sorry, this was not a comment for you to do this; I am a maintainer of (all?) the direct dependees that use ipython_genutils, and more a comment that I might go the route of removing ipython_genutils as a dependencies from those (so you can drop ipython_genutils from your list of packages) instead of publishing a new release if ipython_genutils. I might also do both depending on the timeline.

Updating the dependees might also be a better route as some of them still require nose1 IIRC (which is one of the things i've also been getting rid of progressively).

To be clearer, I have commit rights to remove and publish new version of the following packages to not use ipython_genutils:

ipython
ipykernel
ipyparallel
ipython_genutils
jupyter_client
jupyter_console
jupyter_core
jupyter_server
nbconvert
nbformat
notebook
qtconsole
traitlets

A few of those also directly use nose, and I'll try to remove nose usage as well, but will take time.

@mcepl
Copy link
Author

mcepl commented Jan 12, 2021

Looking through openSUSE packages and it seems to me that some packages you mentioned really don’t require nose:

@Carreau
Copy link
Member

Carreau commented Jan 12, 2021

Yeah, my concern is that some of the test are skipped on pytest. I'll see what I can do to help with this migration. Feel free to drop links to upstream issue I'm happy to mention there when the upstream patches have been merged or releases have been done.

@mcepl
Copy link
Author

mcepl commented Mar 2, 2021

@Carreau
Copy link
Member

Carreau commented Mar 7, 2021

jupyter/jupyter_client#622 might also help to remove genutils as a dependencies of Jupyter_client.

@opoplawski
Copy link

Any more progress here? We're probably not going to introduce nose into EPEL9. Still a number of packages using ipython_genutils.

@mcepl
Copy link
Author

mcepl commented Jan 29, 2022

Any more progress here? We're probably not going to introduce nose into EPEL9. Still a number of packages using ipython_genutils.

https://build.opensuse.org/package/view_file/devel:languages:python:jupyter/python-ipython_genutils/denose.patch?expand=1
works still just fine for us.

Our ipython packages don’t need nose anymore.

@hroncok
Copy link
Contributor

hroncok commented Dec 3, 2024

https://build.opensuse.org/package/view_file/devel:languages:python:jupyter/python-ipython_genutils/denose.patch?expand=1 works still just fine for us.

This runs fewer tests (16+1 skip -> 11+1 skip).

I get:

ipython_genutils/tests/test_path.py:33: PytestCollectionWarning: cannot collect test class 'TestLinkOrCopy' because it has a __init__ constructor (from: ipython_genutils/tests/test_path.py)

This fixes it:

diff --git a/ipython_genutils/tests/test_path.py b/ipython_genutils/tests/test_path.py
index cecabc6..0f1a0bb 100644
--- a/ipython_genutils/tests/test_path.py
+++ b/ipython_genutils/tests/test_path.py
@@ -31,17 +31,13 @@ def test_ensure_dir_exists():
 
 
 class TestLinkOrCopy(object):
-    def __init__(self):
-        self.tempdir = None
-        self.src = None
-
-    def setUp(self):
+    def setup_method(self):
         self.tempdir = tempfile.TemporaryDirectory()
         self.src = self.dst("src")
         with open(self.src, "w") as f:
             f.write("Hello, world!")
 
-    def tearDown(self):
+    def teardown_method(self):
         self.tempdir.cleanup()
 
     def dst(self, *args):

@Carreau
Copy link
Member

Carreau commented Dec 4, 2024

Which package are you using which depends in ipython_genutil ? it is likely it is still mark as a dependency but should not be for ~7 years.

@mcepl
Copy link
Author

mcepl commented Dec 4, 2024

@Carreau
Copy link
Member

Carreau commented Dec 4, 2024

It looks like sage and spyder (in a vendored dependency that needs update) still reference it.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Dec 4, 2024
@Carreau
Copy link
Member

Carreau commented Dec 5, 2024

$ conda repoquery whoneeds  -c conda-forge ipython_genutils

Can help find the current conda packages that list ipytho_genutils as a dependency; it is worth looking as wether they are actual dependencies, and wether the latest versions still use it.

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