Bug 2254188 - python-hatch-requirements-txt fails to build with Python 3.13: DeprecationWarning: 'count' is passed as positional argument
Summary: python-hatch-requirements-txt fails to build with Python 3.13: DeprecationWar...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-hatch-requirements-txt
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Maxwell G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-12-12 15:09 UTC by Karolina Surma
Modified: 2024-01-07 00:35 UTC (History)
3 users (show)

Fixed In Version: python-hatch-requirements-txt-0.4.0-2.fc38 python-hatch-requirements-txt-0.4.0-2.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-01-05 01:02:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-12-12 15:09:08 UTC
python-hatch-requirements-txt fails to build with Python 3.13.0a2.


____________ test_using_project_deps_and_optional_deps[build_sdist] ____________

tmp_pathplus = PosixPathPlus('/tmp/pytest-of-mockbuild/pytest-0/test_using_project_deps_and_op1')
build_func = <function build_sdist at 0x7f1f9c102660>

    @pytest.mark.parametrize("build_func", [build_wheel, build_sdist])
    def test_using_project_deps_and_optional_deps(tmp_pathplus: PathPlus, build_func: Callable):
    
    	pyproject_toml = pyproject_toml_header.replace(
    			'dynamic = ["dependencies"]',
    			"""
    dynamic = ["optional-dependencies"]
    dependencies = ["foo", "bar"]
       """
    			) + """
    [tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
    crypto = ["requirements-crypto.txt"]
    """
    	(tmp_pathplus / "requirements-crypto.txt").write_lines(["PyJWT", "cryptography"])
>   	info = get_pkginfo(tmp_pathplus, build_func, pyproject_toml)

tests/test_metadata.py:367: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_metadata.py:53: in get_pkginfo
    dist_filename = build_func(dist_dir)
/usr/lib/python3.13/site-packages/hatchling/build.py:34: in build_sdist
    return os.path.basename(next(builder.build(sdist_directory, ['standard'])))
/usr/lib/python3.13/site-packages/hatchling/builders/plugin/interface.py:158: in build
    artifact = version_api[version](directory, **build_data)
/usr/lib/python3.13/site-packages/hatchling/builders/sdist.py:164: in build_standard
    with SdistArchive(self.artifact_project_id, reproducible=self.config.reproducible) as archive:
/usr/lib/python3.13/site-packages/hatchling/builders/sdist.py:204: in artifact_project_id
    self.project_id
/usr/lib/python3.13/site-packages/hatchling/builders/plugin/interface.py:372: in project_id
    self.__project_id = f'{self.normalize_file_name_component(self.metadata.core.name)}-{self.metadata.version}'
/usr/lib/python3.13/site-packages/hatchling/builders/plugin/interface.py:439: in normalize_file_name_component
    return re.sub(r'[^\w\d.]+', '_', file_name, re.UNICODE)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pattern = '[^\\w\\d.]+', repl = '_', string = 'demo', count = re.UNICODE
flags = 0, args = []
warnings = <module 'warnings' from '/usr/lib64/python3.13/warnings.py'>

    def sub(pattern, repl, string, *args, count=_zero_sentinel, flags=_zero_sentinel):
        """Return the string obtained by replacing the leftmost
        non-overlapping occurrences of the pattern in string by the
        replacement repl.  repl can be either a string or a callable;
        if a string, backslash escapes in it are processed.  If it is
        a callable, it's passed the Match object and must return
        a replacement string to be used."""
        if args:
            if count is not _zero_sentinel:
                raise TypeError("sub() got multiple values for argument 'count'")
            count, *args = args
            if args:
                if flags is not _zero_sentinel:
                    raise TypeError("sub() got multiple values for argument 'flags'")
                flags, *args = args
                if args:
                    raise TypeError("sub() takes from 3 to 5 positional arguments "
                                    "but %d were given" % (5 + len(args)))
    
            import warnings
>           warnings.warn(
                "'count' is passed as positional argument",
                DeprecationWarning, stacklevel=2
            )
E           DeprecationWarning: 'count' is passed as positional argument

/usr/lib64/python3.13/re/__init__.py:202: DeprecationWarning
FAILED tests/test_metadata.py::test_build_comments[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_comments[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_pip_compile_style[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_pip_compile_style[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_with_files[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_with_files[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_files_in_subdirectory[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_build_files_in_subdirectory[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_not_dynamic_no_explicit_files[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_not_dynamic_no_explicit_files[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_not_dynamic_project_dependencies[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_not_dynamic_project_dependencies[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_optional_dependencies[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_optional_dependencies[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_using_project_dependencies[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_using_project_dependencies[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_using_project_deps_and_optional_deps[build_wheel] - DeprecationWarning: 'count' is passed as positional argument
FAILED tests/test_metadata.py::test_using_project_deps_and_optional_deps[build_sdist] - DeprecationWarning: 'count' is passed as positional argument
======================== 18 failed, 40 passed in 1.06s =========================

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06726074-python-hatch-requirements-txt/

For all our attempts to build python-hatch-requirements-txt with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-hatch-requirements-txt/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Fedora Update System 2023-12-17 19:31:47 UTC
FEDORA-2023-3c3699fe47 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-3c3699fe47

Comment 2 Fedora Update System 2023-12-17 22:27:32 UTC
FEDORA-2023-1d669864d2 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-1d669864d2

Comment 3 Fedora Update System 2023-12-18 01:04:51 UTC
FEDORA-2023-1d669864d2 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-1d669864d2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-1d669864d2

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

Comment 4 Fedora Update System 2023-12-18 01:09:28 UTC
FEDORA-2023-3c3699fe47 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-3c3699fe47`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-3c3699fe47

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

Comment 5 Fedora Update System 2023-12-22 02:51:47 UTC
FEDORA-2023-3c3699fe47 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-3c3699fe47`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-3c3699fe47

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

Comment 6 Fedora Update System 2023-12-22 03:38:45 UTC
FEDORA-2023-1d669864d2 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-1d669864d2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-1d669864d2

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

Comment 7 Fedora Update System 2023-12-28 01:45:49 UTC
FEDORA-2023-1d669864d2 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-1d669864d2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-1d669864d2

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

Comment 8 Fedora Update System 2023-12-30 01:43:41 UTC
FEDORA-2023-3c3699fe47 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-3c3699fe47`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-3c3699fe47

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

Comment 9 Fedora Update System 2024-01-05 01:02:10 UTC
FEDORA-2023-1d669864d2 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2024-01-07 00:35:18 UTC
FEDORA-2023-3c3699fe47 has been pushed to the Fedora 39 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.