Bug 2258443

Summary: python-pytz-deprecation-shim FTBFS
Product: [Fedora] Fedora Reporter: Lumír Balhar <lbalhar>
Component: python-pytz-deprecation-shimAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: code
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python-pytz-deprecation-shim-0.1.0.post0-7.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-15 13:12:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lumír Balhar 2024-01-15 10:53:47 UTC
This change https://src.fedoraproject.org/rpms/python-pytz-deprecation-shim/c/91a24fc8de6a41a2cf77fdda9996a8658636f67c?branch=rawhide causes the package to fail to build from source.

The sed makes the tox.ini file invalid which then causes the following exception during the build:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.12/site-packages/tox/__main__.py", line 6, in <module>
    run()
  File "/usr/lib/python3.12/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/run.py", line 38, in main
    state = setup_state(args)
            ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/run.py", line 52, in setup_state
    options = get_options(*args)
              ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/config/cli/parse.py", line 36, in get_options
    guess_verbosity, log_handler, source = _get_base(args)
                                           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/config/cli/parse.py", line 56, in _get_base
    source = discover_source(parsed.config_file, parsed.root_dir)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/config/source/discover.py", line 29, in discover_source
    src = _locate_source()
          ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/config/source/discover.py", line 55, in _locate_source
    return src_type(candidate)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tox/config/source/ini.py", line 35, in __init__
    self._parser.read_string(content, str(path))
  File "/usr/lib64/python3.12/configparser.py", line 710, in read_string
    self.read_file(sfile, source)
  File "/usr/lib64/python3.12/configparser.py", line 705, in read_file
    self._read(f, source)
  File "/usr/lib64/python3.12/configparser.py", line 1074, in _read
    raise DuplicateOptionError(sectname, optname,
configparser.DuplicateOptionError: While reading from '/builddir/build/BUILD/pytz_deprecation_shim-0.1.0.post0/tox.ini' [line 27]: option 'commands' in section 'testenv' already exists
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 560, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 459, in generate_requires
    generate_tox_requirements(toxenv, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 405, in generate_tox_requirements
    r.check_returncode()
  File "/usr/lib64/python3.12/subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'tox', '--print-deps-to', '/builddir/build/BUILD/pytz_deprecation_shim-0.1.0.post0/.pyproject-builddir/tmpbx2jceau', '--print-extras-to', '/builddir/build/BUILD/pytz_deprecation_shim-0.1.0.post0/.pyproject-builddir/tmpr6rw_vpy', '--no-provision', '/builddir/build/BUILD/pytz_deprecation_shim-0.1.0.post0/.pyproject-builddir/tmp5xoy7f38', '-q', '-r', '-e', 'py312']' returned non-zero exit status 1.
error: Bad exit status from /var/tmp/rpm-tmp.Ra7Kt1 (%generate_buildrequires)
    Bad exit status from /var/tmp/rpm-tmp.Ra7Kt1 (%generate_buildrequires)


Reproducible: Always

Steps to Reproduce:
1. fedpkg clone python-pytz-deprecation-shim
2. cd python-pytz-deprecation-shim
3. fedpkg mockbuild
Actual Results:  
Build fails.

Expected Results:  
Build succeeds.

Comment 1 Ben Beasley 2024-01-15 13:02:17 UTC
Thanks for the report. I wonder how I managed to push that without testing it…

Comment 2 Fedora Update System 2024-01-15 13:09:12 UTC
FEDORA-2024-8627611628 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-8627611628

Comment 3 Fedora Update System 2024-01-15 13:12:28 UTC
FEDORA-2024-8627611628 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.