#17 Set linters as optional and disabled by default
Closed 2 years ago by sergiomb. Opened 2 years ago by dherrera.
rpms/ dherrera/opencv main  into  main

file modified
+11 -2
@@ -1,6 +1,7 @@ 

  %undefine __cmake_in_source_build

  %bcond_without  tests

  %bcond_without  extras

+ %bcond_with     linters

  %bcond_with     ffmpeg

  %bcond_without  gstreamer

  %bcond_with     eigen2
@@ -59,7 +60,7 @@ 

  %global minorver %(foo=%{version}; a=(${foo//./ }); echo ${a[1]} )

  %global padding  %(digits=00; num=%{minorver}; echo ${digits:${#num}:${#digits}} )

  %global abiver   %(echo %{majorver}%{padding}%{minorver} )

- Release:        4%{?dist}

+ Release:        5%{?dist}

  Summary:        Collection of algorithms for computer vision

  # This is normal three clause BSD.

  License:        BSD
@@ -121,8 +122,10 @@ 

  BuildRequires:  pkgconfig

  BuildRequires:  python3-devel

  BuildRequires:  python3-numpy

+ %{?with_linters:

  BuildRequires:  pylint

  BuildRequires:  python3-flake8

+ }

  BuildRequires:  swig >= 1.3.24

  %{?with_ffmpeg:BuildRequires:  ffmpeg-devel >= 0.4.9}

  %if 0%{?fedora} || 0%{?rhel} > 7
@@ -329,7 +332,10 @@ 

   -DPYTHON3_EXECUTABLE=%{__python3} \

   -DPYTHON3_PACKAGES_PATH=%{python3_sitearch} \

   -DOPENCV_GENERATE_SETUPVARS=OFF \

-  -DENABLE_PYLINT=ON \

+  %{!?with_linters: \

+  -DENABLE_PYLINT=OFF \

+  -DENABLE_FLAKE8=OFF \

+  } \

   -DBUILD_PROTOBUF=OFF \

   -DPROTOBUF_UPDATE_FILES=ON \

  %{?with_opencl: -DOPENCL_INCLUDE_DIR=%{_includedir}/CL } \
@@ -492,6 +498,9 @@ 

  %{_libdir}/libopencv_xphoto.so.{%{abiver},%{version}}

  

  %changelog

+ * Wed Jul 13 2022 Diego Herrera <dherrera@redhat.com> - 4.6.0-5

+ - Set linters as optional and disabled by default

+ 

  * Fri Jul 08 2022 Sandro Mani <manisandro@gmail.com> - 4.6.0-4

  - Rebuild (tesseract)

  

I know that this was already proposed before on PR#14, but I would like to insist on disabling linters by default on the build process, this would reduce the dependency scope of the project and help in reducing the cost of bringing opencv to epel9 (bug 2035373).

I know that even if it's only recommended, it's not mandatory to disable them, but I still would like you to reconsider. In this PR instead of removing them, I added a "linters" conditional flag, which is disabled by default so you can enable them on different environments if needed.

Build succeeded.

Pull-Request has been closed by sergiomb

2 years ago
Metadata