Bug 2378476 - tpm2-pkcs11: Stop using deprecated %py3_build/%py3_install macros
Summary: tpm2-pkcs11: Stop using deprecated %py3_build/%py3_install macros
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: tpm2-pkcs11
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2376118
TreeView+ depends on / blocked
 
Reported: 2025-07-08 15:27 UTC by Miro Hrončok
Modified: 2025-07-21 13:06 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-07-21 13:06:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


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