components/python/pylint/Makefile
changeset 6938 64f04bb4c3c3
parent 5682 94c0ca64c022
child 7084 09540c7edf7c
equal deleted inserted replaced
6936:b7d04c4c9133 6938:64f04bb4c3c3
    24 #
    24 #
    25 BUILD_BITS= NO_ARCH
    25 BUILD_BITS= NO_ARCH
    26 include ../../../make-rules/shared-macros.mk
    26 include ../../../make-rules/shared-macros.mk
    27 
    27 
    28 COMPONENT_NAME=		pylint
    28 COMPONENT_NAME=		pylint
    29 COMPONENT_VERSION=	1.4.3
    29 COMPONENT_VERSION=	1.6.4
    30 COMPONENT_ARCHIVE_HASH=		\
    30 COMPONENT_ARCHIVE_HASH=		\
    31 	sha256:1dce8c143a5aa15e0638887c2b395e2e823223c63ebaf8d5f432a99e44b29f60
    31 	sha256:ef901a34b62ed7a734370ba5b162d890231ba8822abe88c6dda1268e2575f5f1
    32 COMPONENT_ARCHIVE_URL=	$(call pypi_url)
    32 COMPONENT_ARCHIVE_URL=	$(call pypi_url)
    33 COMPONENT_PROJECT_URL=  https://bitbucket.org/logilab/pylint
    33 COMPONENT_PROJECT_URL=  https://bitbucket.org/logilab/pylint
    34 
    34 
    35 TPNO=			22903
    35 TPNO=			31351
    36 
       
    37 # Since Pylint 1.4, it only supports Python 2.7+ and Python 3.3+.
       
    38 PYTHON_VERSIONS=	2.7
       
    39 
    36 
    40 BUILD_STYLE= setup.py
    37 BUILD_STYLE= setup.py
    41 include $(WS_MAKE_RULES)/common.mk
    38 include $(WS_MAKE_RULES)/common.mk
       
    39 
       
    40 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
       
    41 
       
    42 # Use the logilab-common, lazy-object-proxy, astroid and isort that are in the
       
    43 # gate until the new versions are on the Userland build machines.
       
    44 LLC = $(WS_COMPONENTS)/python/logilab-common/build/prototype/$(MACH)/$(PYTHON_LIB)
       
    45 LOP = $(WS_COMPONENTS)/python/lazy-object-proxy/build/prototype/$(MACH)/$(PYTHON_LIB)
       
    46 ASTROID = $(WS_COMPONENTS)/python/astroid/build/prototype/$(MACH)/$(PYTHON_LIB)
       
    47 ISORT = $(WS_COMPONENTS)/python/isort/build/prototype/$(MACH)/$(PYTHON_LIB)
       
    48 
       
    49 COMPONENT_BUILD_ENV +=		PYTHONPATH=$(LLC):$(LOP):$(ASTROID):$(ISORT)
       
    50 COMPONENT_INSTALL_ENV +=	PYTHONPATH=$(LLC):$(LOP):$(ASTROID):$(ISORT)
    42 
    51 
    43 # There are several pylint documentation files that setup.py isn't installing
    52 # There are several pylint documentation files that setup.py isn't installing
    44 # but are present in the pylint package on other distributions. Copy them into
    53 # but are present in the pylint package on other distributions. Copy them into
    45 # the proto area "manually", so they can be included in the package.
    54 # the proto area "manually", so they can be included in the package.
    46 PDOC_PYLINT =		$(PROTOUSRSHAREDOCDIR)/pylint
    55 PDOC_PYLINT =		$(PROTOUSRSHAREDOCDIR)/pylint
    47 PDOC_PYLINT_EXAMPLES =	$(PDOC_PYLINT)/examples
    56 PDOC_PYLINT_EXAMPLES =	$(PDOC_PYLINT)/examples
    48 
    57 
    49 COMPONENT_POST_INSTALL_ACTION += \
    58 COMPONENT_POST_INSTALL_ACTION += \
    50 	$(MKDIR) $(PDOC_PYLINT) ;
    59 	$(MKDIR) $(PDOC_PYLINT) ;
    51 COMPONENT_POST_INSTALL_ACTION += \
    60 COMPONENT_POST_INSTALL_ACTION += \
    52 	$(CP) $(COMPONENT_SRC)/README $(PDOC_PYLINT) ;
    61 	$(CP) $(COMPONENT_SRC)/README.rst $(PDOC_PYLINT) ;
    53 COMPONENT_POST_INSTALL_ACTION += \
       
    54 	$(CP) $(COMPONENT_SRC)/README.Python3 $(PDOC_PYLINT) ;
       
    55 
    62 
    56 COMPONENT_POST_INSTALL_ACTION += \
    63 COMPONENT_POST_INSTALL_ACTION += \
    57 	$(MKDIR) $(PDOC_PYLINT_EXAMPLES) ;
    64 	$(MKDIR) $(PDOC_PYLINT_EXAMPLES) ;
    58 COMPONENT_POST_INSTALL_ACTION += \
    65 COMPONENT_POST_INSTALL_ACTION += \
    59 	$(CP) $(COMPONENT_SRC)/examples/custom.py $(PDOC_PYLINT_EXAMPLES) ;
    66 	$(CP) $(COMPONENT_SRC)/examples/custom.py $(PDOC_PYLINT_EXAMPLES) ;
    74 COMPONENT_POST_INSTALL_ACTION += \
    81 COMPONENT_POST_INSTALL_ACTION += \
    75 	(cd $(PROTO_DIR)/usr/bin; $(MV) pyreverse pyreverse-$(PYTHON_VERSION)) ;
    82 	(cd $(PROTO_DIR)/usr/bin; $(MV) pyreverse pyreverse-$(PYTHON_VERSION)) ;
    76 COMPONENT_POST_INSTALL_ACTION += \
    83 COMPONENT_POST_INSTALL_ACTION += \
    77 	(cd $(PROTO_DIR)/usr/bin; $(MV) symilar symilar-$(PYTHON_VERSION)) ;
    84 	(cd $(PROTO_DIR)/usr/bin; $(MV) symilar symilar-$(PYTHON_VERSION)) ;
    78 
    85 
    79 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
    86 COMPONENT_POST_INSTALL_ACTION += \
       
    87 	$(PYTHON) -m py_compile $(PROTOUSRLIBDIR)/python$(PYTHON_VERSION)/vendor-packages/pylint/testutils.py
    80 
    88 
    81 COMPONENT_POST_INSTALL_ACTION += \
    89 COMPONENT_TEST_ENV = PYTHONPATH=$(LLC):$(LOP):$(ASTROID):$(ISORT):$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
    82 	$(PYTHON.2.7.32) -m py_compile $(PROTOUSRLIBDIR)/python2.7/vendor-packages/pylint/testutils.py
       
    83 
    90 
    84 # The tests are run using python 2.7 only and require that
    91 COMPONENT_TEST_CMD = $(LLC)/../../../bin/pytest-$(PYTHON_VERSION)
    85 # the python-27 package is installed (does not have to be the default python). 
    92 COMPONENT_TEST_ARGS =
    86 
       
    87 # Use the python 2.7 libraries for testing.
       
    88 test: PYTHON_VERSION=2.7
       
    89 
       
    90 # logilab-common and astroid are runtime dependencies of pylint,
       
    91 # and we need to use their latest versions from this workspace.
       
    92 # We can't just add their install targets as dependencies here,
       
    93 # so just "gmake install" in the logilab-common and astroid
       
    94 # component directories before running the pylint tests.
       
    95 COMPONENT_PRE_TEST_ACTION = ($(GMAKE) -C \
       
    96 	$(COMPONENT_DIR)/../logilab-common install; \
       
    97 	$(GMAKE) -C $(COMPONENT_DIR)/../astroid install )
       
    98 
       
    99 COMPONENT_TEST_ENV = PYTHONPATH=$(COMPONENT_DIR)/../logilab-common/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(COMPONENT_DIR)/../astroid/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
       
   100 
    93 
   101 # The test output contains details from each test, in whatever order they
    94 # The test output contains details from each test, in whatever order they
   102 # complete. Use nawk to extract just the sections that summarizes the test result.
    95 # complete. Use nawk to extract just the sections that summarizes the test
   103 COMPONENT_TEST_CMD = /usr/bin/pytest-$(PYTHON_VERSION)
    96 # result.
   104 COMPONENT_TEST_ARGS =
       
   105 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
       
   106 COMPONENT_TEST_TRANSFORMER =	$(NAWK)
    97 COMPONENT_TEST_TRANSFORMER =	$(NAWK)
   107 COMPONENT_TEST_TRANSFORMS = "'/Ran (.+) test cases/{ sub(/in(.+)\)/, \"\"); print }/All (.+) modules OK/'"
    98 COMPONENT_TEST_TRANSFORMS = "'/Ran (.+) test cases/{ sub(/in(.+)\)/, \"\"); print }/All (.+) modules OK/'"
   108 
    99 
   109 
       
   110 COMPONENT_SYSTEM_TEST_CMD = /usr/bin/pytest-$(PYTHON_VERSION)
   100 COMPONENT_SYSTEM_TEST_CMD = /usr/bin/pytest-$(PYTHON_VERSION)
   111 COMPONENT_SYSTEM_TEST_ARGS =
   101 COMPONENT_SYSTEM_TEST_ARGS =
   112 
       
   113 REQUIRED_PACKAGES += library/python/logilab-common-27
       
   114 REQUIRED_PACKAGES += library/python/astroid-27
       
   115 REQUIRED_PACKAGES += library/python/six-27