#460 Could not execute mockbuild: 'DistGitLayout' object has no attribute 'rpmfilename'
Closed: Fixed by onosek. Opened by msuchy.

I get error when requesting mock config for epel8 branch.

Steps to reproduce
* fedpkg clone rpmconf
* git checkout epel8
* fedpkg mock-config

Could not execute mock_config: 'DistGitLayout' object has no attribute 'rpmfilename'

The same arrer is for mockbuild.
With -vvv
I get:

Creating repo object from /tmp/rpmconf
Could not execute mockbuild: 'DistGitLayout' object has no attribute 'rpmfilename'
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyrpkg/cli.py", line 2235, in mockbuild
    self.cmd.mockbuild(mockargs, self.args.root,
  File "/usr/lib/python3.10/site-packages/pyrpkg/__init__.py", line 2813, in mockbuild
    self.srpm(hashtype=hashtype)
  File "/usr/lib/python3.10/site-packages/pyrpkg/__init__.py", line 2972, in srpm
    % (self.repo_name, self.ver, self.rel))
  File "/usr/lib/python3.10/site-packages/pyrpkg/__init__.py", line 1057, in ver
    self.load_nameverrel()
  File "/usr/lib/python3.10/site-packages/pyrpkg/__init__.py", line 708, in load_nameverrel
    cmd.extend(self.rpmdefines)
  File "/usr/lib/python3.10/site-packages/pyrpkg/__init__.py", line 789, in rpmdefines
    self.load_rpmdefines()
  File "/usr/lib/python3.10/site-packages/fedpkg/__init__.py", line 197, in load_rpmdefines
    "--define '_rpmfilename %s'" % self.layout.rpmfilename,
AttributeError: 'DistGitLayout' object has no attribute 'rpmfilename'. Did you mean: '_ver'?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/fedpkg", line 33, in <module>
    sys.exit(load_entry_point('fedpkg==1.41', 'console_scripts', 'fedpkg')())
  File "/usr/lib/python3.10/site-packages/fedpkg/__main__.py", line 87, in main
    sys.exit(client.args.command())
  File "/usr/lib/python3.10/site-packages/pyrpkg/cli.py", line 2239, in mockbuild
    raise rpkgError(e)
pyrpkg.errors.rpkgError: 'DistGitLayout' object has no attribute 'rpmfilename'

This happens with F35: fedpkg-1.41-2.fc35.noarch


I cannot reproduce this.
For me both mock-config and mockbuild work as they should
in given repo and branch.

DistGitLayout attribute rpmfilename was added in rpkg commit 89bc57df,
which made it into rpkg 1.63.
Could you check which version of python3-rpkg you have installed?

Also, do other branches like rawhide work?

Does this still happen?
If yes, could you provide the information I ask for above?

This behavior was relevant for fepdkg-1.41 & rpkg-1.62.
New versions were fixed as @oturpe noted (since fedpkg-1.42).

Metadata Update from @onosek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @onosek:
- Issue set to the milestone: 1.42

Metadata