Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove .pyo anc .pyc from an RPM?

Tags:

python

rpm

I have a proxy written in python. I want to create an RPM for this. This rpm will just place the appropriate files at their location. and then some python server will pick them. Now my question is that whenever I generate the rpm, I am getting .pyo and .pyc files as well for every .py file. I don't need those pyc and pyo files. Is there any flag or anything that I can do to remove them?

Thank you.

like image 280
Kanhaiya Choudhary Avatar asked Dec 06 '25 04:12

Kanhaiya Choudhary


1 Answers

I have excluded these .pyc and .pyo files from getting packaged into the RPM by adding lines like this in your RPM specfile:

%files
...
...
%exclude /path_to_files/*.pyc
%exclude /path_to_files/*.pyo
like image 59
Kanhaiya Choudhary Avatar answered Dec 07 '25 19:12

Kanhaiya Choudhary