#557 Passing arguments to %py*_compile and friends
Closed: Fixed None Opened 5 years ago by scop.

I have a package (python-libdiscid) in which I'd like to be able to pass additional arguments to %py2_build. But the way it's currently defined practically prevents me from doing that.

The additional arguments are "build_ext -i build_sphinx"

First, the "()" after %py2_build in its definition make it error out because it thinks the -i above is an arg for the macro function, and looks like the macro is designed to take only one argument in the first place, not sure why. Second, after removing the parens and the %{?1}, the multiline style %expand definition breaks things because all the additional arguments end up on the next line.

So I suggest defining the macro simply as:

%py2_build %{expand:CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}"}

All on one line. This would fix my use case, I could just call %py2_build build_ext -i build_sphinx.

And actually, I'm not sure what the %{expand:...} is there for -- if it doesn't have a purpose, maybe it should be removed while at it.

In addition to %py2_build, the %py2_install, %py3_build, and %py3_install macros are similarly affected.

We just write the guidelines; the python folks are in charge of their package so you should file normal bugzilla requests if you need changes there. If they do change their macros we will update the guidelines to match.

But for the record, I don't disagree with your request, and would actually like to see additional changes to those macros. This just isn't the best place to discuss that kind of thing.

Login to comment on this ticket.