# Note that the path could itself be a python file, or a directory # Python's compile_all module only works on directories, and requires a max # recursion depth # Usage: # %py_byte_compile <interpereter> <path> # Example: # %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/ # This will terminate build on SyntaxErrors, if you want to avoid that, # use it in a subshell like this: # (%{py_byte_compile <interpereter> <path>}) || : %py_byte_compile()\ python_binary="%1"\ buildroot_path="%2"\ bytecode_compilation_path=".${buildroot_path/#$RPM_BUILD_ROOT}"\ failure=0\ pushd $RPM_BUILD_ROOT\ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile || failure=1\ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile || failure=1\ popd\ test $failure -eq 0
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
macros.alt-python310 | File | 2.01 KB | 0644 |
|
macros.alt-python311 | File | 2.01 KB | 0644 |
|
macros.alt-python312 | File | 2.01 KB | 0644 |
|
macros.alt-python38 | File | 1.97 KB | 0644 |
|
macros.alt-python39 | File | 1.98 KB | 0644 |
|
macros.dwz | File | 1.76 KB | 0644 |
|
macros.efi-srpm | File | 3 KB | 0644 |
|
macros.environment-modules | File | 75 B | 0644 |
|
macros.fedora-misc | File | 2.76 KB | 0644 |
|
macros.fedora-misc-srpm | File | 239 B | 0644 |
|
macros.forge | File | 12.43 KB | 0644 |
|
macros.ghc-srpm | File | 414 B | 0644 |
|
macros.go-srpm | File | 7.17 KB | 0644 |
|
macros.info | File | 390 B | 0644 |
|
macros.kernel-srpm | File | 116 B | 0644 |
|
macros.ldc-srpm | File | 73 B | 0644 |
|
macros.ldconfig | File | 307 B | 0644 |
|
macros.mono-srpm | File | 181 B | 0644 |
|
macros.nodejs-srpm | File | 324 B | 0644 |
|
macros.ocaml-srpm | File | 737 B | 0644 |
|
macros.openblas-srpm | File | 104 B | 0644 |
|
macros.perl | File | 5.06 KB | 0644 |
|
macros.perl-srpm | File | 794 B | 0644 |
|
macros.pybytecompile | File | 886 B | 0644 |
|
macros.python | File | 3.36 KB | 0644 |
|
macros.python-srpm | File | 5.95 KB | 0644 |
|
macros.python2 | File | 1.82 KB | 0644 |
|
macros.python3 | File | 3.63 KB | 0644 |
|
macros.rust-srpm | File | 61 B | 0644 |
|
macros.scl | File | 13.53 KB | 0644 |
|
macros.selinux-policy | File | 6.61 KB | 0644 |
|
macros.systemd | File | 4.03 KB | 0644 |
|
macros.systemtap | File | 206 B | 0644 |
|
macros.valgrind-srpm | File | 127 B | 0644 |
|
macros.vim | File | 40 B | 0644 |
|
macros.vpath | File | 228 B | 0644 |
|