thebjorn / pydeps

Python Module Dependency graphs
https://pydeps.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
1.77k stars 112 forks source link

Support Python 3.10 #95

Closed sagitter closed 3 years ago

sagitter commented 3 years ago

Hi all.

Please, support Python-3.10 if you can (Fedora bugzilla ticket #1897245):

+ pytest-3.10 -k 'not test_file and not test_file_pylib and not test_file_pyliball and not test_relative_imports_same_name_with_std and not test_relative_imports_same_name_with_std_future and not test_pydeps_colors'
============================= test session starts ==============================
platform linux -- Python 3.10.0b3, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /builddir/build/BUILD/pydeps-1.9.13
collected 37 items / 6 deselected / 31 selected
tests/test_cli.py F                                                      [  3%]
tests/test_colors.py .....                                               [ 19%]
tests/test_cycles.py F                                                   [ 22%]
tests/test_dep2dot.py F                                                  [ 25%]
tests/test_dot.py .....                                                  [ 41%]
tests/test_externals.py F                                                [ 45%]
tests/test_funny_names.py F                                              [ 48%]
tests/test_json.py F                                                     [ 51%]
tests/test_py2dep.py F                                                   [ 54%]
tests/test_relative_imports.py FFFF                                      [ 67%]
tests/test_render_context.py ...                                         [ 77%]
tests/test_skinny_package.py F                                           [ 80%]
tests/test_skip.py FFFFFF                                                [100%]
=================================== FAILURES ===================================
_________________________________ test_output __________________________________
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_output0')
    def test_output(tmpdir):
        files = """
            unrelated: []
            foo:
                - __init__.py
                - a.py: |
                    from bar import b
            bar:
                - __init__.py
                - b.py
        """
        with create_files(files) as workdir:
            assert os.getcwd() == workdir

            outname = os.path.join('unrelated', 'foo.svg')
            assert not os.path.exists(outname)
>           pydeps(fname='foo', **empty('--noshow', output=outname))
tests/test_cli.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pydeps/pydeps.py:150: in pydeps
    return _pydeps(inp, **_args)
pydeps/pydeps.py:32: in _pydeps
    dep_graph = py2depgraph.py2dep(trgt, **kw)
pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
__________________________________ test_cycle __________________________________
    def test_cycle():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import a
        """
        with create_files(files, cleanup=False) as workdir:
            print("WORKDIR:", workdir)
>           deps = simpledeps('relimp')
tests/test_cycles.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
----------------------------- Captured stdout call -----------------------------
TMPDIR = /tmp/tmp3u89ph15
WORKDIR: /tmp/tmp3u89ph15
_________________________________ test_dep2dot _________________________________
    def test_dep2dot():
        files = """
            foo:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('foo', '-LDEBUG -vv') == {
                'foo.b -> foo.a'
            }
tests/test_dep2dot.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
----------------------------- Captured stdout call -----------------------------
Namespace(debug=False, no_config=False, version=False, log=None, find_package=False, fname='foo', verbose=2, output=None, format='svg', display=None, no_show=False, show_deps=False, show_raw_deps=False, show_dot=False, nodot=None, no_output=False, show_cycles=False, debug_mf=0, noise_level=200, max_bacon=2, pylib=False, pylib_all=False, include_missing=False, exclude=[], exclude_exact=[], only=[], externals=False, reverse=False, cluster=False, min_cluster_size=0, max_cluster_size=0, keep_target_cluster=False, rmprefix=[], start_color=0, show=True) 
____________________________ test_relative_imports _____________________________
capsys = <_pytest.capture.CaptureFixture object at 0xf6df3fb8>
    def test_relative_imports(capsys):
        files = """
            foo:
                - __init__.py
                - a.py: |
                    from bar import b
            bar:
                - __init__.py
                - b.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('foo') == {
                'bar -> foo.a',
                'bar.b -> foo.a'
            }
/builddir/build/BUILD/pydeps-1.9.13/tests/test_externals.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
______________________________ test_from_html5lib ______________________________
    def test_from_html5lib():
        files = """
            foo:
                - __init__.py
                - a.py: |
                    from bar import py
            bar:
                - __init__.py
                - py.py: |
                    barpy = 42
        """
        with create_files(files) as workdir:
>           assert simpledeps('foo', '--show-deps -LINFO -vv') == {
                'bar -> foo.a',
                'bar.py -> foo.a'
            }
/builddir/build/BUILD/pydeps-1.9.13/tests/test_funny_names.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
----------------------------- Captured stdout call -----------------------------
Namespace(debug=False, no_config=False, version=False, log=None, find_package=False, fname='foo', verbose=2, output=None, format='svg', display=None, no_show=False, show_deps=True, show_raw_deps=False, show_dot=False, nodot=None, no_output=False, show_cycles=False, debug_mf=0, noise_level=200, max_bacon=2, pylib=False, pylib_all=False, include_missing=False, exclude=[], exclude_exact=[], only=[], externals=False, reverse=False, cluster=False, min_cluster_size=0, max_cluster_size=0, keep_target_cluster=False, rmprefix=[], start_color=0, show=True) 
_________________________________ test_dep2dot _________________________________
    def test_dep2dot():
        files = """
            foo:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py
        """
        with create_files(files) as workdir:
>           g = depgrf("foo")
/builddir/build/BUILD/pydeps-1.9.13/tests/test_json.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
_______________________________ test_py2depgraph _______________________________
capsys = <_pytest.capture.CaptureFixture object at 0xf6d6c040>
    def test_py2depgraph(capsys):
        files = """
            - a.py: |
                import b
            - b.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('a.py') == {'b -> a'}
/builddir/build/BUILD/pydeps-1.9.13/tests/test_py2dep.py:13: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
____________________________ test_relative_imports _____________________________
    def test_relative_imports():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('relimp') == {'relimp.b -> relimp.a'}
/builddir/build/BUILD/pydeps-1.9.13/tests/test_relative_imports.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
____________________________ test_relative_imports2 ____________________________
    def test_relative_imports2():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           deps = simpledeps('relimp')
/builddir/build/BUILD/pydeps-1.9.13/tests/test_relative_imports.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
____________________________ test_relative_imports3 ____________________________
    def test_relative_imports3():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from .b import c
                - b.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('relimp') == {'relimp.b -> relimp.a'}
/builddir/build/BUILD/pydeps-1.9.13/tests/test_relative_imports.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
________________________________ test_hierarchy ________________________________
    def test_hierarchy():
        files = """
            relimp:
                - __init__.py
                - a:
                    - __init__.py
                    - amodule.py: |
                        from ..b import bmodule
                - b:
                    - __init__.py
                    - bmodule.py

        """
        with create_files(files, cleanup=True) as workdir:
            os.system("tree " + workdir)
>           deps = simpledeps('relimp')
/builddir/build/BUILD/pydeps-1.9.13/tests/test_relative_imports.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
----------------------------- Captured stderr call -----------------------------
sh: line 1: tree: command not found
______________________________ test_from_html5lib ______________________________
    def test_from_html5lib():
        files = """
            foo:
                - __init__.py
                - a.py: |
                    from bar import py
            bar:
                - __init__.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('foo', '--show-deps -LINFO -vv') == {
                'bar -> foo.a',
            }
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skinny_package.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
----------------------------- Captured stdout call -----------------------------
Namespace(debug=False, no_config=False, version=False, log=None, find_package=False, fname='foo', verbose=2, output=None, format='svg', display=None, no_show=False, show_deps=True, show_raw_deps=False, show_dot=False, nodot=None, no_output=False, show_cycles=False, debug_mf=0, noise_level=200, max_bacon=2, pylib=False, pylib_all=False, include_missing=False, exclude=[], exclude_exact=[], only=[], externals=False, reverse=False, cluster=False, min_cluster_size=0, max_cluster_size=0, keep_target_cluster=False, rmprefix=[], start_color=0, show=True) 
_________________________________ test_no_skip _________________________________
    def test_no_skip():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           print("plain", simpledeps('relimp'))
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
___________________________ test_skip_module_pattern ___________________________
    def test_skip_module_pattern():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           print("-x", simpledeps('relimp', '-x relimp.*'))
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
___________________________ test_skip_exact_pattern ____________________________
    def test_skip_exact_pattern():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                    from . import c
                - b.py: |
                    from .c import d
                - c:
                    - __init__.py
                    - d.py
        """
        with create_files(files) as workdir:
>           print('plain', simpledeps('relimp'))
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
_______________________________ test_skip_exact ________________________________
    def test_skip_exact():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           print('-xx', simpledeps('relimp', '-xx relimp.c'))
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
______________________________ test_skip_modules _______________________________
    def test_skip_modules():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('relimp', '-x relimp.c') == {
                'relimp.b -> relimp.a'
            }
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
_________________________________ test_rawdeps _________________________________
    def test_rawdeps():
        files = """
            relimp:
                - __init__.py
                - a.py: |
                    from . import b
                - b.py: |
                    from . import c
                - c.py
        """
        with create_files(files) as workdir:
>           assert simpledeps('relimp', '--show-raw-deps -x relimp.c') == {
                'relimp.b -> relimp.a'
            }
/builddir/build/BUILD/pydeps-1.9.13/tests/test_skip.py:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:19: in simpledeps
    return {"%s -> %s" % (a.name, b.name) for a, b in depgrf(item, args)}
/builddir/build/BUILD/pydeps-1.9.13/tests/simpledeps.py:15: in depgrf
    return py2dep(Target(item), **empty(args))
/builddir/build/BUILD/pydeps-1.9.13/pydeps/py2depgraph.py:242: in py2dep
    pylib = pystdlib()
/builddir/build/BUILD/pydeps-1.9.13/pydeps/pystdlib.py:11: in pystdlib
    return (set(stdlib_list.stdlib_list(curver)) | {
/usr/lib/python3.10/site-packages/stdlib_list/base.py:42: in stdlib_list
    version = get_canonical_version(version) if version is not None else '.'.join(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
version = '3.10'
    def get_canonical_version(version):

        if version in long_versions:
            version = ".".join(version.split(".")[:2])
        elif version not in short_versions:
>           raise ValueError("No such version: {}".format(version))
E           ValueError: No such version: 3.10
/usr/lib/python3.10/site-packages/stdlib_list/base.py:23: ValueError
=============================== warnings summary ===============================
pydeps/mf27.py:7
  /builddir/build/BUILD/pydeps-1.9.13/pydeps/mf27.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    import imp
tests/test_cli.py: 1 warning
tests/test_cycles.py: 1 warning
tests/test_dep2dot.py: 1 warning
tests/test_externals.py: 1 warning
tests/test_funny_names.py: 1 warning
tests/test_json.py: 1 warning
tests/test_py2dep.py: 1 warning
tests/test_relative_imports.py: 4 warnings
tests/test_skinny_package.py: 1 warning
tests/test_skip.py: 6 warnings
  /builddir/build/BUILD/pydeps-1.9.13/pydeps/mf27.py:115: DeprecationWarning: 'U' mode is deprecated
    fp = open(pathname, READ_MODE)
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_output - ValueError: No such version: 3.10
FAILED tests/test_cycles.py::test_cycle - ValueError: No such version: 3.10
FAILED tests/test_dep2dot.py::test_dep2dot - ValueError: No such version: 3.10
FAILED tests/test_externals.py::test_relative_imports - ValueError: No such v...
FAILED tests/test_funny_names.py::test_from_html5lib - ValueError: No such ve...
FAILED tests/test_json.py::test_dep2dot - ValueError: No such version: 3.10
FAILED tests/test_py2dep.py::test_py2depgraph - ValueError: No such version: ...
FAILED tests/test_relative_imports.py::test_relative_imports - ValueError: No...
FAILED tests/test_relative_imports.py::test_relative_imports2 - ValueError: N...
FAILED tests/test_relative_imports.py::test_relative_imports3 - ValueError: N...
FAILED tests/test_relative_imports.py::test_hierarchy - ValueError: No such v...
FAILED tests/test_skinny_package.py::test_from_html5lib - ValueError: No such...
FAILED tests/test_skip.py::test_no_skip - ValueError: No such version: 3.10
FAILED tests/test_skip.py::test_skip_module_pattern - ValueError: No such ver...
FAILED tests/test_skip.py::test_skip_exact_pattern - ValueError: No such vers...
FAILED tests/test_skip.py::test_skip_exact - ValueError: No such version: 3.10
FAILED tests/test_skip.py::test_skip_modules - ValueError: No such version: 3.10
FAILED tests/test_skip.py::test_rawdeps - ValueError: No such version: 3.10
=========== 18 failed, 13 passed, 6 deselected, 19 warnings in 0.54s ===========

Thanks!

thebjorn commented 3 years ago

We first need support from https://github.com/jackmaney/python-stdlib-list. Python 3.10 is not scheduled to be released until the 4th of October.

sanjayankur31 commented 3 years ago

Yes, but since it'll be included in the next Fedora release (35), we tend to start testing it early in our release cycle so we can inform upstream projects if their tools run into issues with the new version. More information on this here:

https://fedoraproject.org/wiki/Changes/Python3.10

I opened a PR here for pydeps: https://github.com/jackmaney/python-stdlib-list/pull/49. It'll hopefully be merged soon.

thebjorn commented 3 years ago

There shouldn't be any changes needed in pydeps to support Python 3.10.

I changed stdlib_list by copying lists/3.9.txt to lists/3.10.txt and added "3.10" to long_versions:

(pydeps310) go|c:\srv\lib\code\pydeps> pytest -xvv
========================================================================= test session starts =========================================================================
platform win32 -- Python 3.10.0rc1, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- c:\srv\venv\pydeps310\scripts\python.exe
cachedir: .pytest_cache
rootdir: c:\srv\lib\code\pydeps
plugins: cov-2.12.1
collected 39 items

tests/test_cli.py::test_output PASSED                                                                                                                            [  2%]
tests/test_cli.py::test_rankdir_default PASSED                                                                                                                   [  5%]
tests/test_cli.py::test_error PASSED                                                                                                                             [  7%]
tests/test_colors.py::test_rgb2css PASSED                                                                                                                        [ 10%]
tests/test_colors.py::test_brightness PASSED                                                                                                                     [ 12%]
tests/test_colors.py::test_colordiff PASSED                                                                                                                      [ 15%]
tests/test_colors.py::test_foreground PASSED                                                                                                                     [ 17%]
tests/test_colors.py::test_name2rgb PASSED                                                                                                                       [ 20%]
tests/test_cycles.py::test_cycle PASSED                                                                                                                          [ 23%]
tests/test_dep2dot.py::test_dep2dot PASSED                                                                                                                       [ 25%]
tests/test_dot.py::test_svg PASSED                                                                                                                               [ 28%]
tests/test_dot.py::test_svg_str PASSED                                                                                                                           [ 30%]
tests/test_dot.py::test_boolopt PASSED                                                                                                                           [ 33%]
tests/test_dot.py::test_obj PASSED                                                                                                                               [ 35%]
tests/test_dot.py::test_cmd2args PASSED                                                                                                                          [ 38%]
tests/test_externals.py::test_relative_imports PASSED                                                                                                            [ 41%]
tests/test_file.py::test_file PASSED                                                                                                                             [ 43%]
tests/test_file.py::test_file_pylib PASSED                                                                                                                       [ 46%]
tests/test_file.py::test_file_pyliball PASSED                                                                                                                    [ 48%]
tests/test_funny_names.py::test_from_html5lib PASSED                                                                                                             [ 51%]
tests/test_json.py::test_dep2dot PASSED                                                                                                                          [ 53%]
tests/test_py2dep.py::test_py2depgraph PASSED                                                                                                                    [ 56%]
tests/test_relative_imports.py::test_relative_imports PASSED                                                                                                     [ 58%]
tests/test_relative_imports.py::test_relative_imports2 PASSED                                                                                                    [ 61%]
tests/test_relative_imports.py::test_relative_imports3 PASSED                                                                                                    [ 64%]
tests/test_relative_imports.py::test_relative_imports_same_name_with_std PASSED                                                                                  [ 66%]
tests/test_relative_imports.py::test_relative_imports_same_name_with_std_future PASSED                                                                           [ 69%]
tests/test_relative_imports.py::test_pydeps_colors PASSED                                                                                                        [ 71%]
tests/test_relative_imports.py::test_hierarchy PASSED                                                                                                            [ 74%]
tests/test_render_context.py::test_render_context PASSED                                                                                                         [ 76%]
tests/test_render_context.py::test_render_context_reverse PASSED                                                                                                 [ 79%]
tests/test_render_context.py::test_render_context_rankdir PASSED                                                                                                 [ 82%]
tests/test_skinny_package.py::test_from_html5lib PASSED                                                                                                          [ 84%]
tests/test_skip.py::test_no_skip PASSED                                                                                                                          [ 87%]
tests/test_skip.py::test_skip_module_pattern PASSED                                                                                                              [ 89%]
tests/test_skip.py::test_skip_exact_pattern PASSED                                                                                                               [ 92%]
tests/test_skip.py::test_skip_exact PASSED                                                                                                                       [ 94%]
tests/test_skip.py::test_skip_modules PASSED                                                                                                                     [ 97%]
tests/test_skip.py::test_rawdeps PASSED                                                                                                                          [100%]

========================================================================= 39 passed in 18.81s =========================================================================

(pydeps310) go|c:\srv\lib\code\pydeps> cdsitepackages
(pydeps310) go|c:\srv\venv\pydeps310\Lib\site-packages> cd stdlib_list

(pydeps310) go|c:\srv\venv\pydeps310\Lib\site-packages\stdlib_list> git diff
diff --git a/base.py b/base.py
index 0cde17a..68aaedd 100644
--- a/base.py
+++ b/base.py
@@ -10,7 +10,7 @@ except ImportError:
     from functools32 import lru_cache

 long_versions = ["2.6.9", "2.7.9", "3.2.6", "3.3.6", "3.4.3", "3.5", "3.6",
-                 "3.7", "3.8", "3.9"]
+                 "3.7", "3.8", "3.9", "3.10"]

 short_versions = [".".join(x.split(".")[:2]) for x in long_versions]

(pydeps310) go|c:\srv\venv\pydeps310\Lib\site-packages\stdlib_list>

I.e. when stlib_list supports 3.10 (e.g. through https://github.com/jackmaney/python-stdlib-list/pull/49), pydeps will too :-)

thebjorn commented 3 years ago

I've implemented a "hack" that essentially does what I did in the previous comment (uses the last available version from stdlib_list). It is on PyPI as v1.10.0.

ryanneilyoung commented 1 year ago

it looks like stdlib-list is just part of base python now. Pydeps should probably use the standard library version and free up a dependancy: https://github.com/jackmaney/python-stdlib-list/issues/55#issuecomment-1297020414

thebjorn commented 1 year ago

@ryanneilyoung pydeps supports older python versions, so unfortunately there wouldn't be any freeing up of dependencies :-(

It would probably be a good idea to change pydeps/pydeps/pystdlib.py to use the suggested

builtin_modules = list(set(list(sys.stdlib_module_names) + list(sys.builtin_module_names)))

as the initial source of modules with py > 3.10. I haven't checked what the snippet returns very deeply, but I'm pretty sure we still need to keep our own extras list (and maybe even merge in the stdlib_list data to prevent surprises..?).

The current code-path must stay in place for users of older Pythons.