unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: Lars-Dominik Braun <lars@6xq.net>
Cc: guix-devel@gnu.org
Subject: Re: Python
Date: Sat, 25 Feb 2023 17:39:55 +0100	[thread overview]
Message-ID: <Y/o521hFjB1Ac7Tk@jurong> (raw)
In-Reply-To: <Y/otI5lrBD6xL+5p@noor.fritz.box>

Am Sat, Feb 25, 2023 at 04:45:39PM +0100 schrieb Lars-Dominik Braun:
> note that importlib-metadata is – again – part of the standard
> library, as the table on [1] points out. So if we would ship Python 3.12,
> we would not need it. Bumping it to version 5.2 seems like the correct
> approach right now, since we’re at 3.10.7 on core-updates (as far as I see).

Very interesting! I am just not used to these very dynamically changing
languages. After a bit of discussion, we recently decided with my coauthor
to assume the C99 standard in our library instead of C89 :)

Right now I am left with a number of test failures that look real and cannot
easily be solved by an upgrade (either because we are already on the latest
version or because the tests still fail): python-sgmllib3k, python-typeguard
and python-coveralls. See messages below.

Andreas


python-coveralls:
=================================== FAILURES ===================================
___________________ ReporterTest.test_reporter_with_branches ___________________

self = <tests.api.reporter_test.ReporterTest testMethod=test_reporter_with_branches>

    def test_reporter_with_branches(self):
        subprocess.call(['coverage', 'run', '--branch', '--omit=**/.tox/*',
                         'runtests.py'], cwd=EXAMPLE_DIR)
        results = Coveralls(repo_token='xxx').get_coverage()
        assert len(results) == 2

        # Branches are expressed as four values each in a flat list
        assert not len(results[0]['branches']) % 4
        assert not len(results[1]['branches']) % 4

>       assert_coverage(results[0], {
            'source': ('def hello():\n'
                       '    print(\'world\')\n\n\n'
                       'class Foo:\n'
                       '    """ Bar """\n\n\n'
                       'def baz():\n'
                       '    print(\'this is not tested\')\n\n'
                       'def branch(cond1, cond2):\n'
                       '    if cond1:\n'
                       '        print(\'condition tested both ways\')\n'
                       '    if cond2:\n'
                       '        print(\'condition not tested both ways\')\n'),
            'name': 'project.py',
            'branches': [13, 0, 14, 1, 13, 0, 15, 1, 15, 0, 16, 1, 15, 0, 12,
                         0],
            'coverage': [1, 1, None, None, 1, None, None,
                         None, 1, 0, None, 1, 1, 1, 1, 1]})

/tmp/guix-build-python-coveralls-3.2.0.drv-0/source/tests/api/reporter_test.py:182:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = {'branches': [5, 0, 6, 1, 5, 0, ...], 'coverage': [1, 1, None, None, 1, None, ...], 'name': 'project.py', 'source': 'd...1:\n        print(\'condition tested both ways\')\n    if cond2:\n        print(\'condition not tested both ways\')\n'}
expected = {'branches': [13, 0, 14, 1, 13, 0, ...], 'coverage': [1, 1, None, None, 1, None, ...], 'name': 'project.py', 'source':...1:\n        print(\'condition tested both ways\')\n    if cond2:\n        print(\'condition not tested both ways\')\n'}

    def assert_coverage(actual, expected):
        assert actual['source'].strip() == expected['source'].strip()
        assert actual['name'] == expected['name']
        assert actual['coverage'] == expected['coverage']
>       assert actual.get('branches') == expected.get('branches')
E       assert [5, 0, 6, 1, 5, 0, 9, 1, 13, 0, 14, 1, 13, 0, 15, 1, 15, 0, 16, 1, 15, 0, 12, 0] == [13, 0, 14, 1, 13, 0, 15, 1, 15, 0, 16, 1, 15, 0, 12, 0]
E         At index 0 diff: 5 != 13
E         Left contains 8 more items, first extra item: 15
E         Full diff:
E         - [13, 0, 14, 1, 13, 0, 15, 1, 15, 0, 16, 1, 15, 0, 12, 0]
E         + [5, 0, 6, 1, 5, 0, 9, 1, 13, 0, 14, 1, 13, 0, 15, 1, 15, 0, 16, 1, 15, 0, 12, 0]
E         ?  ++++++++++++++++++++++++

/tmp/guix-build-python-coveralls-3.2.0.drv-0/source/tests/api/reporter_test.py:17: AssertionError
----------------------------- Captured stdout call -----------------------------
world
condition not tested both ways
condition tested both ways
condition not tested both ways
=========================== short test summary info ============================
FAILED tests/api/reporter_test.py::ReporterTest::test_reporter_with_branches
=================== 1 failed, 51 passed, 1 skipped in 2.51s ====================
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "pytest" arguments: ("-vv") exit-status: 1 term-signal: #f stop-signal: #f>
phase `check' failed after 2.8 seconds
command "pytest" "-vv" failed with status 1
builder for `/gnu/store/2f7hab84ljj1k284w61zn14cbapzfdnf-python-coveralls-3.2.0.drv' failed with exit code 1
build of /gnu/store/2f7hab84ljj1k284w61zn14cbapzfdnf-python-coveralls-3.2.0.drv failed
View build log at '/var/log/guix/drvs/2f/7hab84ljj1k284w61zn14cbapzfdnf-python-coveralls-3.2.0.drv.gz'.


python-sgmllib3k:
======================================================================
FAIL: test_declaration_junk_chars (test_sgmllib.SGMLParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-sgmllib3k-1.0.0-1.7999646.drv-0/source/test_sgmllib.py", line 310, in test_declaration_junk_chars
    self.check_parse_error("<!DOCTYPE foo $ >")
  File "/tmp/guix-build-python-sgmllib3k-1.0.0-1.7999646.drv-0/source/test_sgmllib.py", line 127, in check_parse_error
    parser.feed(source)
  File "/tmp/guix-build-python-sgmllib3k-1.0.0-1.7999646.drv-0/source/sgmllib.py", line 98, in feed
    self.goahead(0)
  File "/tmp/guix-build-python-sgmllib3k-1.0.0-1.7999646.drv-0/source/sgmllib.py", line 168, in goahead
    k = self.parse_declaration(i)
  File "/gnu/store/blals34ar25fiifvm17m2b504waxzys0-python-3.10.7/lib/python3.10/_markupbase.py", line 134, in parse_declaration
    raise AssertionError("unexpected %r char in declaration" % rawdata[j])
AssertionError: unexpected '$' char in declaration

----------------------------------------------------------------------
Ran 23 tests in 0.008s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=23 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=23 errors=0 failures=1>
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `check' failed after 0.3 seconds
command "python" "-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test" failed with status 1
builder for `/gnu/store/cp8sgcp3c1599dzjwmfms38jz3iddyk1-python-sgmllib3k-1.0.0-1.7999646.drv' failed with exit code 1
build of /gnu/store/cp8sgcp3c1599dzjwmfms38jz3iddyk1-python-sgmllib3k-1.0.0-1.7999646.drv failed
View build log at '/var/log/guix/drvs/cp/8sgcp3c1599dzjwmfms38jz3iddyk1-python-sgmllib3k-1.0.0-1.7999646.drv.gz'.


python-typeguard:
=================================== FAILURES ===================================
___________________ TestTypeChecked.test_typed_dict[correct] ___________________
tests/test_typeguard.py:1343: in test_typed_dict
    foo(value)
/gnu/store/qmli9ql0wplg1hyacy07kvgaqbpfa11z-python-typeguard-2.13.3/lib/python3.10/site-packages/typeguard/__init__.py:1032: in wrapper
    check_argument_types(memo)
/gnu/store/qmli9ql0wplg1hyacy07kvgaqbpfa11z-python-typeguard-2.13.3/lib/python3.10/site-packages/typeguard/__init__.py:875: in check_argument_types
    raise TypeError(*exc.args) from None
E   TypeError: TypedDict does not support instance and class checks
__________________ TestTypeChecked.test_typed_dict[missing_x] __________________
tests/test_typeguard.py:1341: in test_typed_dict
    pytest.raises(TypeError, foo, value).match(error_re)
E   AssertionError: Regex pattern 'required key\\(s\\) \\("x"\\) missing from argument "arg"' does not match 'TypedDict does not support instance and class checks'.
___________________ TestTypeChecked.test_typed_dict[wrong_y] ___________________
tests/test_typeguard.py:1341: in test_typed_dict
    pytest.raises(TypeError, foo, value).match(error_re)
E   AssertionError: Regex pattern 'type of dict item "y" for argument "arg" must be str; got int instead' does not match 'TypedDict does not support instance and class checks'.
_______________ TestTypeChecked.test_typed_dict[missing_y_error] _______________
tests/test_typeguard.py:1341: in test_typed_dict
    pytest.raises(TypeError, foo, value).match(error_re)
E   AssertionError: Regex pattern 'required key\\(s\\) \\("y"\\) missing from argument "arg"' does not match 'TypedDict does not support instance and class checks'.
________________ TestTypeChecked.test_typed_dict[missing_y_ok] _________________
tests/test_typeguard.py:1343: in test_typed_dict
    foo(value)
/gnu/store/qmli9ql0wplg1hyacy07kvgaqbpfa11z-python-typeguard-2.13.3/lib/python3.10/site-packages/typeguard/__init__.py:1032: in wrapper
    check_argument_types(memo)
/gnu/store/qmli9ql0wplg1hyacy07kvgaqbpfa11z-python-typeguard-2.13.3/lib/python3.10/site-packages/typeguard/__init__.py:875: in check_argument_types
    raise TypeError(*exc.args) from None
E   TypeError: TypedDict does not support instance and class checks
___________________ TestTypeChecked.test_typed_dict[wrong_x] ___________________
tests/test_typeguard.py:1341: in test_typed_dict
    pytest.raises(TypeError, foo, value).match(error_re)
E   AssertionError: Regex pattern 'type of dict item "x" for argument "arg" must be int; got str instead' does not match 'TypedDict does not support instance and class checks'.
_________________ TestTypeChecked.test_typed_dict[unknown_key] _________________
tests/test_typeguard.py:1341: in test_typed_dict
    pytest.raises(TypeError, foo, value).match(error_re)
E   AssertionError: Regex pattern 'extra key\\(s\\) \\("foo"\\) in argument "arg"' does not match 'TypedDict does not support instance and class checks'.
=============================== warnings summary ===============================
tests/test_typeguard.py::TestTypeChecker::test_generator
tests/test_typeguard.py::TestTypeChecker::test_exception
tests/test_typeguard_py36.py::TestTypeChecker::test_async_generator[generator]
tests/test_typeguard_py36.py::TestTypeChecker::test_async_generator[iterable]
tests/test_typeguard_py36.py::TestTypeChecker::test_async_generator[iterator]
  /gnu/store/fgbf94ab19n90rsz6h7vrvqyw17w9kqa-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/python.py:192: PytestRemovedIn8Warning: Passing None has been deprecated.
  See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.
    result = testfunction(**testargs)

tests/test_typeguard_py36.py::TestTypeChecker::test_callable
  /gnu/store/qmli9ql0wplg1hyacy07kvgaqbpfa11z-python-typeguard-2.13.3/lib/python3.10/site-packages/typeguard/__init__.py:1027: UserWarning: no code associated -- not typechecking test_typeguard_py36.<test_typeguard_py36.TestTypeChecker.test_callable.<locals>.command object at 0x7ffff5d4a800>
    warn('no code associated -- not typechecking {}'.format(function_name(func)))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========== 7 failed, 233 passed, 3 deselected, 6 warnings in 2.13s ============
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "pytest" arguments: ("-vv" "-k" "not usefixtures and not test_cached_module") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `check' failed after 2.5 seconds
command "pytest" "-vv" "-k" "not usefixtures and not test_cached_module" failed with status 1
builder for `/gnu/store/l9gb4nadq9c43zn82wqbxmwgib7bkqqs-python-typeguard-2.13.3.drv' failed with exit code 1
build of /gnu/store/l9gb4nadq9c43zn82wqbxmwgib7bkqqs-python-typeguard-2.13.3.drv failed
View build log at '/var/log/guix/drvs/l9/gb4nadq9c43zn82wqbxmwgib7bkqqs-python-typeguard-2.13.3.drv.gz'.



  reply	other threads:[~2023-02-25 16:40 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12  9:05 Merging core-updates? Julien Lepiller
2023-02-12 11:06 ` Andreas Enge
2023-02-12 11:52   ` Julien Lepiller
2023-02-12 11:58     ` Julien Lepiller
2023-02-12 13:05       ` Christopher Baines
2023-02-20 11:10         ` Christopher Baines
2023-02-12 17:08       ` Andreas Enge
2023-02-12 18:29         ` Kaelyn
2023-02-13 20:04           ` Efraim Flashner
2023-02-13 21:36             ` Kaelyn
2023-02-14 14:50               ` Efraim Flashner
2023-02-14 20:29                 ` Kaelyn
2023-02-15  0:07                   ` Kaelyn
2023-02-12 18:40         ` Janneke Nieuwenhuizen
2023-02-13 11:34         ` Janneke Nieuwenhuizen
2023-02-13 13:57           ` Andreas Enge
2023-02-15  8:39             ` Janneke Nieuwenhuizen
2023-02-16 14:19               ` Andreas Enge
2023-02-16 15:03                 ` bug#49985: " Janneke Nieuwenhuizen
2023-02-16 15:24                   ` Andreas Enge
2023-02-16 15:33                   ` Julien Lepiller
2023-02-12 14:49   ` Josselin Poiret
2023-02-13  3:05     ` John Kehayias
2023-02-12 12:02 ` Leo Famulari
2023-02-21 23:01   ` Ludovic Courtès
2023-02-12 13:28 ` Christopher Baines
2023-03-05 19:52   ` Christopher Baines
2023-03-05 22:18     ` Merging core-updates? OFF TOPIC PRAISE Joshua Branson
2023-02-12 15:51 ` Merging core-updates? Efraim Flashner
2023-02-13 16:40   ` Katherine Cox-Buday
2023-02-13 17:11     ` John Kehayias
2023-02-13 20:22   ` Andreas Enge
2023-02-13 20:38     ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-02-13  9:43 ` zimoun
2023-02-13 10:56   ` Architecture support [was: Re: Merging core-updates?] Efraim Flashner
2023-02-13 12:59     ` Architecture support Andreas Enge
2023-02-14 16:30     ` Architecture support [was: Re: Merging core-updates?] Andreas Enge
2023-02-14 16:40       ` Julien Lepiller
2023-02-15  9:45         ` Architecture support Andreas Enge
2023-02-17 16:49         ` Architecture support [was: Re: Merging core-updates?] Christopher Baines
2023-02-19 22:50           ` Architecture support Andreas Enge
2023-02-20  9:23             ` Christopher Baines
2023-02-14 20:10       ` Architecture support [was: Re: Merging core-updates?] Efraim Flashner
2023-02-15  9:35         ` Andreas Enge
2023-02-13 20:35 ` Merging core-updates? Andreas Enge
2023-02-13 21:31   ` Efraim Flashner
2023-02-14 18:27     ` Andreas Enge
2023-02-15 18:51       ` Andreas Enge
2023-02-15 19:19         ` Openjdk (was: Merging core-updates?) Andreas Enge
2023-02-16 11:03           ` Efraim Flashner
2023-02-16 11:38             ` Julien Lepiller
2023-02-18 11:28               ` Andreas Enge
2023-02-17 10:36             ` Andreas Enge
2023-02-17 14:49             ` Andreas Enge
2023-02-17 16:28               ` Andreas Enge
2023-02-17 17:27                 ` Kaelyn
2023-02-18 10:55                   ` Andreas Enge
2023-02-16 11:41         ` Merging core-updates? Maxime Devos
2023-02-16 16:03           ` Andreas Enge
2023-02-18 11:03   ` Ocaml (was: Merging core-updates?) Andreas Enge
2023-02-18 11:38     ` Andreas Enge
2023-02-19  9:15       ` Julien Lepiller
2023-02-20 10:35         ` Simon Tournier
2023-02-20 11:16           ` Julien Lepiller
2023-02-20 11:55             ` Ocaml Andreas Enge
2023-02-19 11:02   ` Python (was: Merging core-updates?) Andreas Enge
2023-02-19 11:15     ` Andreas Enge
2023-02-19 11:19       ` Andreas Enge
2023-02-19 15:10         ` Attila Lendvai
2023-02-21 16:24           ` Python Andreas Enge
2023-02-19 11:30     ` Python (was: Merging core-updates?) Andreas Enge
2023-02-19 20:31       ` Python Andreas Enge
2023-02-21 16:41         ` Python Andreas Enge
2023-02-22 14:23           ` Python Andreas Enge
2023-02-23 15:16           ` Python Andreas Enge
2023-02-24 16:47             ` Python Andreas Enge
2023-02-24 16:51               ` Python Andreas Enge
2023-02-24 18:08               ` Python Lars-Dominik Braun
2023-02-25 15:15                 ` Python Andreas Enge
2023-02-25 15:45                   ` Python Lars-Dominik Braun
2023-02-25 16:39                     ` Andreas Enge [this message]
2023-02-25 16:56                       ` Python Lars-Dominik Braun
2023-02-25 18:00                         ` Python Andreas Enge
2023-02-25 18:06                           ` Python Andreas Enge
2023-02-25 18:15                             ` Python Andreas Enge
2023-02-25 18:33                               ` Python Andreas Enge
2023-02-27 19:14                                 ` Python Lars-Dominik Braun
2023-02-28 15:05                                   ` Python Andreas Enge
2023-02-25 18:29                           ` Python Andreas Enge
2023-03-11 11:20                           ` Python Andreas Enge
2023-03-11 11:44                             ` Python Andreas Enge
2023-03-15 13:49                         ` Python Andreas Enge
2023-03-18  8:59                           ` Python Lars-Dominik Braun
2023-03-18  9:15                             ` Python Andreas Enge
2023-03-18 10:02                               ` Python Lars-Dominik Braun
2023-03-18 10:13                                 ` Python Andreas Enge
2023-03-18  9:43                           ` Python Lars-Dominik Braun
2023-03-18 19:37                             ` Python Andreas Enge
2023-03-21 18:56                               ` Python Lars-Dominik Braun
2023-03-30  9:57                                 ` Python Lars-Dominik Braun
2023-03-30 10:10                                   ` Python Andreas Enge
2023-04-03 17:29                                   ` PyQt in core-updates Andreas Enge
2023-04-04  7:55                                     ` Lars-Dominik Braun
2023-04-17  8:32                                       ` Andreas Enge
2023-03-30 11:05                               ` Python Lars-Dominik Braun
2023-03-31  8:52                                 ` Python Andreas Enge
2023-02-27 18:55                 ` Python Efraim Flashner
2023-02-27 19:12                   ` Python Lars-Dominik Braun
2023-02-21 16:50       ` Python (was: Merging core-updates?) Andreas Enge
2023-02-19 11:47     ` Lars-Dominik Braun
2023-02-19 11:57       ` Andreas Enge
2023-02-19 15:50         ` Lars-Dominik Braun
2023-02-19 20:27           ` Python Andreas Enge
2023-02-25 17:44             ` Python Andreas Enge
2023-02-19 21:35           ` Python (was: Merging core-updates?) Andreas Enge
2023-02-19 22:08           ` Andreas Enge
2023-02-19 22:59             ` Kaelyn
2023-02-21 16:18               ` Andreas Enge
2023-02-19 19:55         ` Andreas Enge
2023-02-19 11:48     ` Andreas Enge
2023-02-19 22:24     ` Andreas Enge
2023-02-21 16:58       ` Andreas Enge
2023-02-22  9:40         ` Icecat (was: Python) Andreas Enge
2023-02-16 20:11 ` Merging core-updates? Josselin Poiret
  -- strict thread matches above, loose matches on Subject: below --
2013-09-13 15:46 Python Andreas Enge
2013-09-13 16:25 ` Python Cyril Roelandt
2013-09-14  9:02   ` Python Andreas Enge
2013-09-13 21:32 ` Python Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/o521hFjB1Ac7Tk@jurong \
    --to=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    --cc=lars@6xq.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).