Bug 2328011 - python-dunamai fails to build with Python 3.14: cannot import name 'ByteString' from 'typing' (/usr/lib64/python3.14/typing.py)
Summary: python-dunamai fails to build with Python 3.14: cannot import name 'ByteStri...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dunamai
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 11:10 UTC by Karolina Surma
Modified: 2024-11-25 08:54 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-25 08:54:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-11-22 11:10:49 UTC
python-dunamai fails to build with Python 3.14.0a2.

________________________ test__version__from_mercurial _________________________
[gw0] linux -- Python 3.14.0 /usr/bin/python3

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw0/test__version__from_mercurial0')

    @pytest.mark.skipif(shutil.which("hg") is None, reason="Requires Mercurial")
    def test__version__from_mercurial(tmp_path) -> None:
        vcs = tmp_path / "dunamai-hg"
        vcs.mkdir()
        run = make_run_callback(vcs)
        from_vcs = make_from_callback(Version.from_mercurial)
        b = "default"
    
        with chdir(vcs):
            run("hg init")
            assert from_vcs(fresh=True) == Version("0.0.0", distance=0, dirty=False, branch=b)
            assert from_vcs(fresh=True).vcs == Vcs.Mercurial
    
            (vcs / "foo.txt").write_text("hi")
            assert from_vcs(fresh=True) == Version("0.0.0", distance=0, dirty=True, branch=b)
    
            run("hg add .")
>           run('hg commit -m "Initial commit"')

tests/integration/test_dunamai.py:537: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/integration/test_dunamai.py:56: in inner
    _, out = _run_cmd(command, where=where, codes=[expected_code], env=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

command = 'hg commit -m "Initial commit"'
where = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw0/test__version__from_mercurial0/dunamai-hg')
codes = [0], shell = False, env = None

    def _run_cmd(
        command: str,
        where: Optional[Path],
        codes: Sequence[int] = (0,),
        shell: bool = False,
        env: Optional[dict] = None,
    ) -> Tuple[int, str]:
        result = subprocess.run(
            shlex.split(command),
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            cwd=str(where) if where is not None else None,
            shell=shell,
            env=env,
        )
        output = result.stdout.decode().strip()
        if codes and result.returncode not in codes:
>           raise RuntimeError("The command '{}' returned code {}. Output:\n{}".format(command, result.returncode, output))
E           RuntimeError: The command 'hg commit -m "Initial commit"' returned code 255. Output:
E           no username found, using 'mockbuild' instead
E           abort: cannot import name 'ByteString' from 'typing' (/usr/lib64/python3.14/typing.py)

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08291471-python-dunamai/

For all our attempts to build python-dunamai with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-dunamai/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Miro Hrončok 2024-11-22 11:26:35 UTC
This is likely output from mercurial.

See also bz2327997.

Comment 2 Lumír Balhar 2024-11-25 08:54:43 UTC
I have prepared a fix for mercurial, built it in the COPR and it fixed the problem with this package.

PR for mercurial: https://src.fedoraproject.org/rpms/mercurial/pull-request/22
Build of this package: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8309862/


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