Bug 1787452 (python-devtools) - Review Request: python-devtools - Dev tools for Python
Summary: Review Request: python-devtools - Dev tools for Python
Keywords:
Status: CLOSED ERRATA
Alias: python-devtools
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: python-pytest-isort python-pytest-toolbox
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-02 22:14 UTC by Fabian Affolter
Modified: 2020-05-28 04:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-28 04:14:22 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Description Fabian Affolter 2020-01-02 22:14:28 UTC
Spec URL: https://fab.fedorapeople.org/packages/SRPMS/python-devtools.spec
SRPM URL: https://fab.fedorapeople.org/packages/SRPMS/python-devtools-0.5.1-1.fc31.src.rpm

Project URL: https://github.com/samuelcolvin/python-devtools

Description:
The debug print command Python never had (and other things).

Koji scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=40057301

rpmlint output:
$ rpmlint python-devtools-0.5.1-1.fc31.src.rpm 
python-devtools.src: W: spelling-error Summary(en_US) Dev -> Dec, Devi, Dee
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

$ rpmlint python3-devtools-0.5.1-1.fc31.noarch.rpm 
python3-devtools.noarch: W: spelling-error Summary(en_US) Dev -> Dec, Devi, Dee
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

Fedora Account System Username: fab

Comment 1 Robert-André Mauchin 🐧 2020-01-06 18:57:29 UTC
 - Wrong summary:

%package -n python-%{pypi_name}-doc
Summary:        sphinxcontrib-asyncio documentation

 - The main subpackage doesn't depend on -doc and the LICENSE is only in the doc package. Either make python3-%{pypi_name} depend on python-%{pypi_name}-doc or include the license in python3-%{pypi_name}.

 - Some tests fail:

Results (0.98s):
      81 passed
       3 failed
         - tests/test_expr_render.py:35 test_exotic_types
         - tests/test_expr_render.py:141 test_kwargs_multiline
         - tests/test_main.py:91 test_small_call_frame_warning
       1 skipped


Report failures upstream.


――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_exotic_types ―――――――――――――――――――――――――――――――――――――――――――――――――――――――

    def test_exotic_types():
        aa = [1, 2, 3]
        v = debug.format(
            sum(aa),
            1 == 2,
            1 < 2,
            1 << 2,
            't' if True else 'f',
            1 or 2,
            [a for a in aa],
            {a for a in aa},
            {a: a + 1 for a in aa},
            (a for a in aa),
        )
        s = re.sub(r':\d{2,}', ':<line no>', str(v))
        s = re.sub(r'(at 0x)\w+', r'\1<hash>', s)
        print(s)
        # list and generator comprehensions are wrong because ast is wrong, see https://bugs.python.org/issue31241
>       assert (
            "tests/test_expr_render.py:<line no> test_exotic_types\n"
            "    sum(aa): 6 (int)\n"
            "    1 == 2: False (bool)\n"
            "    1 < 2: True (bool)\n"
            "    1 << 2: 4 (int)\n"
            "    't' if True else 'f': 't' (str) len=1\n"
            "    1 or 2: 1 (int)\n"
            "    [a for a in aa]: [1, 2, 3] (list) len=3\n"
            "    {a for a in aa}: {1, 2, 3} (set) len=3\n"
            "    {a: a + 1 for a in aa}: {\n"
            "        1: 2,\n"
            "        2: 3,\n"
            "        3: 4,\n"
            "    } (dict) len=3\n"
            "    (a for a in aa): (\n"
            "        1,\n"
            "        2,\n"
            "        3,\n"
            "    ) (generator)"
        ) == s
E       AssertionError: assert 'tests/test_e...) (generator)' == 'tests/test_ex...) (generator)'
E         - tests/test_expr_render.py:<line no> test_exotic_types
E         -     sum(aa): 6 (int)
E         + tests/test_expr_render.py:<line no> test_exotic_types (error passing code, SyntaxError: unexpected EOF while parsing (test_expr_render.py, line 2))
E         +     6 (int)
E         -     1 == 2: False (bool)
E         ?    --------
E         +     False (bool)
E         -     1 < 2: True (bool)
E         ?    -------
E         +     True (bool)
E         -     1 << 2: 4 (int)
E         ?    --------
E         +     4 (int)
E         -     't' if True else 'f': 't' (str) len=1
E         +     't' (str) len=1
E         -     1 or 2: 1 (int)
E         ?      --------
E         +     1 (int)
E         -     [a for a in aa]: [1, 2, 3] (list) len=3
E         ?    -----------------
E         +     [1, 2, 3] (list) len=3
E         -     {a for a in aa}: {1, 2, 3} (set) len=3
E         ?    -----------------
E         +     {1, 2, 3} (set) len=3
E         -     {a: a + 1 for a in aa}: {
E         +     {
E                   1: 2,
E                   2: 3,
E                   3: 4,
E               } (dict) len=3
E         -     (a for a in aa): (
E         +     (
E                   1,
E                   2,
E                   3,
E               ) (generator)

tests/test_expr_render.py:53: AssertionError


――――――――――――――――――――――――――――――――――――――――――――――――――――― test_kwargs_multiline ―――――――――――――――――――――――――――――――――――――――――――――――――――――

    @pytest.mark.skipif(sys.version_info < (3, 6), reason='kwarg order is not guaranteed for 3.5')
    def test_kwargs_multiline():
        v = debug.format(
            foobar(1, 2,
                   3),
            a=6,
            b=7
        )
        s = re.sub(r':\d{2,}', ':<line no>', str(v))
>       assert (
            'tests/test_expr_render.py:<line no> test_kwargs_multiline\n'
            '    foobar(1, 2, 3): 6 (int)\n'
            '    a: 6 (int)\n'
            '    b: 7 (int)'
        ) == s
E       AssertionError: assert 'tests/test_e...   b: 7 (int)' == 'tests/test_ex...   b: 7 (int)'
E         - tests/test_expr_render.py:<line no> test_kwargs_multiline
E         -     foobar(1, 2, 3): 6 (int)
E         + tests/test_expr_render.py:<line no> test_kwargs_multiline (error passing code, SyntaxError: unexpected EOF while parsing (test_expr_render.py, line 2))
E         +     6 (int)
E               a: 6 (int)
E               b: 7 (int)

tests/test_expr_render.py:150: AssertionError


――――――――――――――――――――――――――――――――――――――――――――――――― test_small_call_frame_warning ―――――――――――――――――――――――――――――――――――――――――――――――――

    def test_small_call_frame_warning():
        debug_ = Debug(frame_context_length=2)
        v = debug_.format(
            1,
            2,
            3,
        )
>       assert re.sub(r':\d{2,}', ':<line no>', str(v)) == (
            "tests/test_main.py:<line no> test_small_call_frame_warning "
            "(error passing code, found <class '_ast.Tuple'> not Call)\n"
            "    1 (int)\n"
            "    2 (int)\n"
            "    3 (int)"
        )
E       AssertionError: assert 'tests/test_m...\n    3 (int)' == 'tests/test_ma...\n    3 (int)'
E         - tests/test_main.py:<line no> test_small_call_frame_warning (error passing code, SyntaxError: unexpected EOF while parsing (test_main.py, line 3))
E         + tests/test_main.py:<line no> test_small_call_frame_warning (error passing code, found <class '_ast.Tuple'> not Call)
E               1 (int)
E               2 (int)
E               3 (int)

tests/test_main.py:98: AssertionError

Comment 2 Fabian Affolter 2020-04-06 14:44:00 UTC
Thanks for the feedback.

(In reply to Robert-AndrΓ© Mauchin from comment #1)
>  - Wrong summary:
> 
> %package -n python-%{pypi_name}-doc
> Summary:        sphinxcontrib-asyncio documentation

Fixed

>  - The main subpackage doesn't depend on -doc and the LICENSE is only in the
> doc package. Either make python3-%{pypi_name} depend on
> python-%{pypi_name}-doc or include the license in python3-%{pypi_name}.

License added

>  - Some tests fail:

Exclude the three failing tests

%changelog
* Fri Mar 27 2020 Fabian Affolter <mail> - 0.5.1-3
- Exclude three failing tests
- Use license from tarball

* Mon Jan 06 2020 Fabian Affolter <mail> - 0.5.1-2
- Fix description
- Add license (rhbz#1787452)

Updated files:
Spec URL: https://fab.fedorapeople.org/packages/SRPMS/python-devtools.spec
SRPM URL: https://fab.fedorapeople.org/packages/SRPMS/python-devtools-0.5.1-3.fc31.src.rpm

Koji scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=43062526

Comment 3 Robert-André Mauchin 🐧 2020-04-13 18:32:29 UTC
Ok package approved, but report the failing tests upstream.

Comment 4 Gwyn Ciesla 2020-05-19 13:26:19 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-devtools

Comment 5 Fedora Update System 2020-05-19 15:49:16 UTC
FEDORA-2020-08986a1cad has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-08986a1cad

Comment 6 Fedora Update System 2020-05-20 05:48:52 UTC
FEDORA-2020-08986a1cad has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2020-08986a1cad \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-08986a1cad

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-05-28 04:14:22 UTC
FEDORA-2020-08986a1cad has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.