Example #1
0
    def execute(self, finder):
        issues = []

        def capture(code, message):
            if message in IGNORE_MSGS:
                return
            issues.append(
                CheckManifestIssue(
                    code,
                    message,
                    os.path.join(dirname, 'MANIFEST.in'),
                ))

        check_manifest.info = partial(capture, 'info')
        check_manifest.warning = partial(capture, 'warning')
        check_manifest.error = partial(capture, 'error')

        for filepath in finder.files(self.config['filters']):
            dirname, _ = os.path.split(filepath)
            try:
                check_manifest.check_manifest(dirname)
            except check_manifest.Failure as exc:
                issues.append(
                    CheckManifestIssue(
                        'error',
                        'Unexpected error: %s' % (exc, ),
                        filepath,
                    ))

        return issues
Example #2
0
def run_check_menifest():
    codeOut = StringIO()
    codeErr = StringIO()
    sys.stdout = codeOut
    sys.stderr = codeErr
    check_manifest(update=True)
    sys.stderr = sys.__stderr__
    sys.stdout = sys.__stdout__
    with open("check_manifest.log", "w+") as file:
        file.write(codeErr.getvalue())
    codeOut.close()
    codeErr.close()
Example #3
0
    def execute(self, finder):
        issues = []

        for filepath in finder.files(self.config['filters']):
            dirname, _ = os.path.split(filepath)
            try:
                cmui = CheckManifestUI(dirname)
                check_manifest.check_manifest(dirname, ui=cmui)
            except check_manifest.Failure as exc:
                issues.append(
                    CheckManifestIssue(
                        'error',
                        'Unexpected error: %s' % (exc, ),
                        filepath,
                    ))
            else:
                issues += cmui.issues

        return issues
Example #4
0
def lint_check_manifest(
    skip: Tuple[str],
    path: Path,
    src: Tuple[Path],
    non_src_package: Tuple[Path],
) -> None:
    """
    Check that the manifest file has everything not explicitly ignored.
    """
    result = check_manifest.check_manifest(path)
    if not result:
        sys.exit(1)