Bug 2378476

Summary: tpm2-pkcs11: Stop using deprecated %py3_build/%py3_install macros
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: tpm2-pkcs11Assignee: Jakub Jelen <jjelen>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: davide, jjelen, pbrobinson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-07-21 13:06:25 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:
Bug Depends On:    
Bug Blocks: 2376118    

Description Miro Hrončok 2025-07-08 15:27:34 UTC
Dear package maintainer,

this bugzilla is automated becasue the number of impacted packages it too high to go trough manually.


It appears that your package uses the deprecated %py3_build and/or %py3_install macro.

See https://fedoraproject.org/wiki/Changes/DeprecateSetuppyMacros for why the macros are deprecated.

%py3_install expands to python setup.py install. This has been a deprecated command for 5 years and will likely stop working in Fedora 45.



Please migrate to %pyproject_buildrequires + %pyproject_wheel + %pyproject_install macros instead.

See https://fedoraproject.org/wiki/Changes/DeprecateSetuppyMacros#Migrating_to_%pyproject_macros for migration guide.

See https://github.com/hroncok/pyprojectize/ for a tool that can help you automate the migration.


Thank you. Let me know if you need help.

Comment 1 Jakub Jelen 2025-07-08 17:02:53 UTC
Did the best effort to remove the %py3_ macros, which looks like builds in mock for me:

https://src.fedoraproject.org/rpms/tpm2-pkcs11/c/d034963f79891a6edf52dcb4fbcc9bf7edd952bc?branch=rawhide

Let me know if this is good enough or I should do some more fiddling with generating the requirements, but all my previous attempts ended with

```
error: Dependency tokens must begin with alpha-numeric, '_' or '/': ~/build/BUILD/tpm2-pkcs11-1.9.1-build/tpm2-pkcs11-1.9.1/tools ~/build/BUILD/tpm2-pkcs11-1.9.1-build/tpm2-pkcs11-1.9.1
```

Comment 2 Miro Hrončok 2025-07-08 17:23:13 UTC
Your change is good enough to fix this.

However, using %pyproject_wheel and %pyproject_install without %pyproject_buildrequires is not supported. The requirements you listed manually (such as pip) to make it work are not part of the API and are not guaranteed to be stable.


> error: Dependency tokens must begin with alpha-numeric, '_' or '/': ~/build/BUILD/tpm2-pkcs11-1.9.1-build/tpm2-pkcs11-1.9.1/tools ~/build/BUILD/tpm2-pkcs11-1.9.1-build/tpm2-pkcs11-1.9.1

This is likely a result of:

  %generate_buildrequires
  pushd tools
  %pyproject_buildrequires
  popd

The stdout of the entire %generate_buildrequires section is considered as BuildRequires. The pushd and popd commands generate a line on the stdout each.

One solution is to use a plain cd:

  %generate_buildrequires
  cd tools
  %pyproject_buildrequires

As you don't need to popd anyway.

If you prefer pushed, you need to silence the stdout:

  %generate_buildrequires
  pushd tools >&2
  %pyproject_buildrequires
  popd >&2


Here's the change: https://src.fedoraproject.org/rpms/tpm2-pkcs11/pull-request/4