ipython / ipython_genutils

Vestigial IPython utilities: DO NOT USE
Other
11 stars 22 forks source link

0.2.0: pytest based test suite is failing #18

Open kloczek opened 3 years ago

kloczek commented 3 years ago
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-ipython_genutils-0.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-ipython_genutils-0.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/ipython_genutils-0.2.0
plugins: flaky-3.6.1, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0, expect-1.1.0, cov-2.11.1, mock-3.5.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, hypothesis-6.8.1, pyfakefs-4.4.0, freezegun-0.4.2
collected 17 items

ipython_genutils/tests/test_importstring.py ...                                                                                                                      [ 17%]
ipython_genutils/tests/test_path.py ..FFFFsF                                                                                                                         [ 64%]
ipython_genutils/tests/test_tempdir.py ..                                                                                                                            [ 76%]
ipython_genutils/tests/test_text.py ....                                                                                                                             [100%]

================================================================================= FAILURES =================================================================================
___________________________________________________________________ TestLinkOrCopy.test_link_successful ____________________________________________________________________

args = (<ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc6d3610>,), kwargs = {}

    def skipper_func(*args, **kwargs):
        """Skipper for normal test functions."""
        if skip_val():
            raise nose.SkipTest(get_msg(f,msg))
        else:
>           return f(*args, **kwargs)

ipython_genutils/testing/decorators.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ipython_genutils/tests/test_path.py:64: in test_link_successful
    dst = self.dst("target")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc6d3610>, args = ('target',)

    def dst(self, *args):
>       return os.path.join(self.tempdir.name, *args)
E       AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'

ipython_genutils/tests/test_path.py:47: AttributeError
____________________________________________________________________ TestLinkOrCopy.test_link_into_dir _____________________________________________________________________

args = (<ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc816460>,), kwargs = {}

    def skipper_func(*args, **kwargs):
        """Skipper for normal test functions."""
        if skip_val():
            raise nose.SkipTest(get_msg(f,msg))
        else:
>           return f(*args, **kwargs)

ipython_genutils/testing/decorators.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ipython_genutils/tests/test_path.py:70: in test_link_into_dir
    dst = self.dst("some_dir")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc816460>, args = ('some_dir',)

    def dst(self, *args):
>       return os.path.join(self.tempdir.name, *args)
E       AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'

ipython_genutils/tests/test_path.py:47: AttributeError
____________________________________________________________________ TestLinkOrCopy.test_target_exists _____________________________________________________________________

args = (<ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc6af0a0>,), kwargs = {}

    def skipper_func(*args, **kwargs):
        """Skipper for normal test functions."""
        if skip_val():
            raise nose.SkipTest(get_msg(f,msg))
        else:
>           return f(*args, **kwargs)

ipython_genutils/testing/decorators.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ipython_genutils/tests/test_path.py:78: in test_target_exists
    dst = self.dst("target")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc6af0a0>, args = ('target',)

    def dst(self, *args):
>       return os.path.join(self.tempdir.name, *args)
E       AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'

ipython_genutils/tests/test_path.py:47: AttributeError
_______________________________________________________________________ TestLinkOrCopy.test_no_link ________________________________________________________________________

args = (<ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc80ca30>,), kwargs = {}

    def skipper_func(*args, **kwargs):
        """Skipper for normal test functions."""
        if skip_val():
            raise nose.SkipTest(get_msg(f,msg))
        else:
>           return f(*args, **kwargs)

ipython_genutils/testing/decorators.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ipython_genutils/tests/test_path.py:88: in test_no_link
    dst = self.dst("target")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc80ca30>, args = ('target',)

    def dst(self, *args):
>       return os.path.join(self.tempdir.name, *args)
E       AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'

ipython_genutils/tests/test_path.py:47: AttributeError
______________________________________________________________________ TestLinkOrCopy.test_link_twice ______________________________________________________________________

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc68c8b0>

    def test_link_twice(self):
        # Linking the same file twice shouldn't leave duplicates around.
        # See https://github.com/ipython/ipython/issues/6450
>       dst = self.dst('target')

ipython_genutils/tests/test_path.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipython_genutils.tests.test_path.TestLinkOrCopy object at 0x7f95fc68c8b0>, args = ('target',)

    def dst(self, *args):
>       return os.path.join(self.tempdir.name, *args)
E       AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'

ipython_genutils/tests/test_path.py:47: AttributeError
========================================================================= short test summary info ==========================================================================
SKIPPED [1] ../../../../../usr/lib/python3.8/site-packages/_pytest/unittest.py:355: Skipping test: test_windows. This test only runs under Windows
FAILED ipython_genutils/tests/test_path.py::TestLinkOrCopy::test_link_successful - AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'
FAILED ipython_genutils/tests/test_path.py::TestLinkOrCopy::test_link_into_dir - AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'
FAILED ipython_genutils/tests/test_path.py::TestLinkOrCopy::test_target_exists - AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'
FAILED ipython_genutils/tests/test_path.py::TestLinkOrCopy::test_no_link - AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'
FAILED ipython_genutils/tests/test_path.py::TestLinkOrCopy::test_link_twice - AttributeError: 'TestLinkOrCopy' object has no attribute 'tempdir'
================================================================= 5 failed, 11 passed, 1 skipped in 0.25s ==================================================================
kloczek commented 3 years ago

Actually more important is that ipython_genutils is still using nose which is for python 2.x and is already outdated and unmaintained. https://nose.readthedocs.io/en/latest/

+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=1097984068
rootdir: /home/tkloczko/rpmbuild/BUILD/ipython_genutils-0.2.0
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0, checkdocs-2.7.1
collected 4 items / 3 errors / 1 selected

================================================================================== ERRORS ==================================================================================
_______________________________________________________ ERROR collecting ipython_genutils/tests/test_importstring.py _______________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipython_genutils-0.2.0/ipython_genutils/tests/test_importstring.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipython_genutils/tests/test_importstring.py:6: in <module>
    import nose.tools as nt
E   ModuleNotFoundError: No module named 'nose'
___________________________________________________________ ERROR collecting ipython_genutils/tests/test_path.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipython_genutils-0.2.0/ipython_genutils/tests/test_path.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipython_genutils/tests/test_path.py:11: in <module>
    import nose.tools as nt
E   ModuleNotFoundError: No module named 'nose'
___________________________________________________________ ERROR collecting ipython_genutils/tests/test_text.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipython_genutils-0.2.0/ipython_genutils/tests/test_text.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipython_genutils/tests/test_text.py:13: in <module>
    import nose.tools as nt
E   ModuleNotFoundError: No module named 'nose'
========================================================================= short test summary info ==========================================================================
ERROR ipython_genutils/tests/test_importstring.py
ERROR ipython_genutils/tests/test_path.py
ERROR ipython_genutils/tests/test_text.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 3 errors in 0.37s =============================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
Carreau commented 3 years ago

I think it will likely be easier to remove usage of ipython_genutils upstream than to fix this repo. If you have specific packages that needs dependency on ipython_genutils to be remove faster than other, you can list them here, and we'll do what we can.

kloczek commented 3 years ago

Just checked what is using ipython-genutils

[tkloczko@barrel SPECS]$ grep 'python3dist(ipython-genutils)' *
python-ipyparallel.spec:BuildRequires:  python3dist(ipython-genutils)
python-notebook.spec:BuildRequires:     python3dist(ipython-genutils)
python-traitlets.spec:BuildRequires:    python3dist(ipython-genutils)

Simple what I'm tryig to archive is have set of packages without nose run-time or build-time dependencies.

Carreau commented 3 years ago

I'll open issues on relevant repositories, we can likely make a new minor release of all the above projects that do not requires this package.

I know there are other packages that require ipython_genutils, but we can make those a priority.

Carreau commented 3 years ago

master of ipyparallel should not require ipython_genutils anymore, I believe this will be part of the next major version (7.0.0) that I guess might be released soon.

kloczek commented 3 years ago

master of ipyparallel should not require ipython_genutils anymore, I believe this will be part of the next major version (7.0.0) that I guess might be released soon.

If may I suggest move away from nose as well because of https://nose.readthedocs.io/en/latest/ https://github.com/schollii/nose2pytest/ may be useful on that.

Carreau commented 3 years ago

+1 thanks, I've been using vim macros, but that is helpful. We have some custom plugins that might need manual work.

opoplawski commented 2 years ago

Fedora packages with ipython_genutils deps:

python3-ipywidgets-0:7.6.4-2.fc36.noarch
python3-nbformat-0:5.0.8-6.fc36.noarch
python3-notebook-0:6.4.8-1.fc36.noarch
python3-qtconsole-0:5.2.2-2.fc36.noarch
kloczek commented 2 years ago
[tkloczko@ss-desktop SPECS.fedora]$ grep nose python-ipython_genutils.spec
# Don't use deprecated unittest aliases trough nose, they are removed in Python 3.11
BuildRequires:  python%{python3_pkgversion}-nose
nosetests-%{python3_version} -v
- Use nosetests

As you see Fedora package uses nose.

Carreau commented 2 years ago

IPython 8 which has been published two weeks ago does no rely on nose or ipython_genutils anymore. I would though wait for IPython 8.1.0 there are a couple of things to fix.

Carreau commented 2 years ago

You may still want to try to package 8.0 as a number of things have changed in setup.py (we are trying to get rid of it), and it also now requires stack_data. 8.0 also has black as a dependency but that will be most likely removed in 8.1.

Carreau commented 11 months ago

https://github.com/jupyter/qtconsole/pull/586 should remove the last usage of it from qtconsole, so AFAICT once the above is merged and released, nothing should use ipython_genuils.

Let me know if that is not the case.