Bug 1900669 - modulemd-tools fails to build with Python 3.10: AssertionError: '---\[58 chars]eam: "devel"\n version: 123\n context: f32\n[437 chars]..\n' != '---\[58 chars]eam: devel\n version: 123\n context: f32\n [435 chars]..\n'
Summary: modulemd-tools fails to build with Python 3.10: AssertionError: '---\[58 char...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: modulemd-tools
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Kadlčík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-23 13:59 UTC by Tomáš Hrnčiar
Modified: 2021-04-21 08:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 08:40:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-23 13:59:43 UTC
modulemd-tools fails to build with Python 3.10.0a2.

======================================================================
FAIL: test_stream2yaml (tests.test_yaml.TestYaml)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/modulemd-tools-0.6/modulemd_tools/tests/test_yaml.py", line 371, in test_stream2yaml
    self.assertEqual(_stream2yaml(mod_stream), yaml1)
AssertionError: '---\[58 chars]eam: "devel"\n  version: 123\n  context: f32\n[437 chars]..\n' != '---\[58 chars]eam: devel\n  version: 123\n  context: f32\n  [435 chars]..\n'
  ---
  document: modulemd
  version: 2
  data:
    name: foo
-   stream: "devel"
?           -     -
+   stream: devel
    version: 123
    context: f32
    summary: Summary and stuff
    description: >-
      This module has been generated using dir2module tool
    license:
      module:
      - MIT
      content:
      - BSD
      - GPLv2
      - MIT
    dependencies:
    - buildrequires:
        platform: [f32]
      requires:
        platform: [f32]
    artifacts:
      rpms:
      - LTK-0:1.5.0-8.fc32.x86_64
      - LTK-debuginfo-0:1.5.0-8.fc32.x86_64
      - LTK-debugsource-0:1.5.0-8.fc32.x86_64
  ...


======================================================================
FAIL: test_upgrade_to_same_version (tests.test_yaml.TestYaml)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/modulemd-tools-0.6/modulemd_tools/tests/test_yaml.py", line 305, in test_upgrade_to_same_version
    self.assertEqual(result, yaml1)
AssertionError: '---\[58 chars]eam: "devel"\n  version: 123\n  context: f32\n[437 chars]..\n' != '---\[58 chars]eam: devel\n  version: 123\n  context: f32\n  [435 chars]..\n'
  ---
  document: modulemd
  version: 2
  data:
    name: foo
-   stream: "devel"
?           -     -
+   stream: devel
    version: 123
    context: f32
    summary: Summary and stuff
    description: >-
      This module has been generated using dir2module tool
    license:
      module:
      - MIT
      content:
      - BSD
      - GPLv2
      - MIT
    dependencies:
    - buildrequires:
        platform: [f32]
      requires:
        platform: [f32]
    artifacts:
      rpms:
      - LTK-0:1.5.0-8.fc32.x86_64
      - LTK-debuginfo-0:1.5.0-8.fc32.x86_64
      - LTK-debugsource-0:1.5.0-8.fc32.x86_64
  ...


----------------------------------------------------------------------
Ran 26 tests in 0.120s

FAILED (failures=2)
error: Bad exit status from /var/tmp/rpm-tmp.qC0nbx (%check)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01783941-modulemd-tools/

For all our attempts to build modulemd-tools with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/modulemd-tools/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Jakub Kadlčík 2020-11-25 17:39:35 UTC
Hello Tomas,
I couldn't reproduce the issue

I run a `fedora:rawhide` docker container like this

    docker run -v ~/git/modulemd-tools/:/modulemd-tools:Z -it fedora:rawhide bash
    

And then tried to 

    [root@914be6d5063b ~]# dnf install 'dnf-command(copr)'
    [root@914be6d5063b ~]# dnf copr enable @python/python3.10
    [root@914be6d5063b ~]# dnf update python3
    [root@914be6d5063b ~]# python3.10 --version
    Python 3.10.0a2

    [root@914be6d5063b ~]# cd /modulemd-tools/
    [root@914be6d5063b modulemd-tools]# dnf builddep modulemd-tools.spec
    [root@914be6d5063b modulemd-tools]# dnf install python3-pytest
    [root@914be6d5063b modulemd-tools]# python3.10 -m pytest -s modulemd_tools/tests -v

And all tests passed successfully. Do you have any idea what changed
or if I am doing something wrong?

Thank you

Comment 2 Miro Hrončok 2020-11-25 20:01:09 UTC
The failures happen in mock build. Mock config is at https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

[~]$ fedpkg clone modulemd-tools
[~]$ cd modulemd-tools/
[modulemd-tools (master)]$ fedpkg srpm 
...

[modulemd-tools (master)]$ mock -r fedora-rawhide-python310 modulemd-tools-0.6-1.fc34.src.rpm
...

----------------------------------------------------------------------
Ran 26 tests in 0.122s

FAILED (failures=2)

Comment 3 Jakub Kadlčík 2021-01-18 02:36:08 UTC
Thank you for the reproducer Miro,

Fixed in PR#26 (0784734)

Comment 4 Tomáš Hrnčiar 2021-01-18 09:57:31 UTC
Hello Jakub, thank you for the fix. Please keep this bugzilla open until it is not in rawhide. We use it for tracking purposes.

Comment 5 Ben Cotton 2021-02-09 15:27:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


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