diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..08a67c15 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +name: Lint + +on: + push: + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install CPython 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + + - name: Install/fetch dependencies + run: | + set -exuo pipefail + pip install --upgrade pip setuptools + pip install tox + + - name: Run linter + run: tox -e lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3a22469b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Test + +on: + push: + pull_request: + +jobs: + test: + name: CPython ${{ matrix.python }} + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - python: "3.6" + - python: "3.7" + - python: "3.8" + - python: "3.9" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install CPython ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + architecture: x64 + + - name: Install/fetch dependencies + run: | + set -exuo pipefail + pip install --upgrade pip setuptools + ./tests/install.sh + + - name: Run tests + run: ./tests/travis.sh diff --git a/.travis.yml b/.travis.yml index 0c5fe0e6..a557f4b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,6 @@ language: python jobs: include: - - python: "3.6" - - python: "3.7" - - python: "3.8" - - python: "3.9" - python: "3.8" arch: arm64-graviton2 virt: vm @@ -16,8 +12,6 @@ jobs: arch: ppc64le - python: "3.8" arch: s390x - - python: "3.8" - env: LINTER=1 services: - docker @@ -29,11 +23,7 @@ before_install: - pip install --upgrade pip setuptools install: - - pip install -r test-requirements.txt - - pip install tox codecov - - pip install -e . - # pull manylinux images that will be used, this helps passing tests which would otherwise timeout. - - python -c $'from tests.integration.test_manylinux import MANYLINUX_IMAGES\nfor image in MANYLINUX_IMAGES.values():\n print(image)' | xargs -L 1 docker pull + - ./tests/install.sh script: - tests/travis.sh diff --git a/auditwheel/condatools.py b/auditwheel/condatools.py index 00314a8a..27ffa314 100644 --- a/auditwheel/condatools.py +++ b/auditwheel/condatools.py @@ -2,32 +2,36 @@ conda packages. """ import os +from typing import List, Optional from .tmpdirs import InTemporaryDirectory from .tools import tarbz2todir class InCondaPkg(InTemporaryDirectory): - def __init__(self, in_conda_pkg): + def __init__(self, in_conda_pkg: str) -> None: """Initialize in-conda-package context manager""" self.in_conda_pkg = os.path.abspath(in_conda_pkg) super().__init__() - def __enter__(self): + def __enter__(self) -> str: tarbz2todir(self.in_conda_pkg, self.name) return super().__enter__() class InCondaPkgCtx(InCondaPkg): - def __init__(self, in_conda_pkg): + def __init__(self, in_conda_pkg: str) -> None: super().__init__(in_conda_pkg) - self.path = None + self.path: Optional[str] = None def __enter__(self): self.path = super().__enter__() return self - def iter_files(self): + def iter_files(self) -> List[str]: + if self.path is None: + raise ValueError( + "This function should be called from context manager") files = os.path.join(self.path, 'info', 'files') with open(files) as f: return [line.strip() for line in f.readlines()] diff --git a/auditwheel/elfutils.py b/auditwheel/elfutils.py index 24d23ecb..db938bc0 100644 --- a/auditwheel/elfutils.py +++ b/auditwheel/elfutils.py @@ -2,8 +2,8 @@ from os.path import basename, realpath, relpath from .lddtree import parse_ld_paths -from elftools.elf.elffile import ELFFile # type: ignore -from elftools.common.exceptions import ELFError # type: ignore +from elftools.elf.elffile import ELFFile +from elftools.common.exceptions import ELFError from typing import Iterator, Tuple, Optional, Dict, List @@ -78,7 +78,8 @@ def elf_references_PyFPE_jbuf(elf: ELFFile) -> bool: return False -def elf_is_python_extension(fn, elf) -> Tuple[bool, Optional[int]]: +def elf_is_python_extension(fn: str, + elf: ELFFile) -> Tuple[bool, Optional[int]]: modname = basename(fn).split('.', 1)[0] module_init_f = { 'init' + modname: 2, diff --git a/auditwheel/genericpkgctx.py b/auditwheel/genericpkgctx.py index 37addb41..0f9208bf 100644 --- a/auditwheel/genericpkgctx.py +++ b/auditwheel/genericpkgctx.py @@ -1,8 +1,11 @@ +from typing import Optional, Union from .wheeltools import InWheelCtx from .condatools import InCondaPkgCtx -def InGenericPkgCtx(in_path, out_path=None): +def InGenericPkgCtx( + in_path: str, out_path: Optional[str] = None +) -> Union[InWheelCtx, InCondaPkgCtx]: """Factory that returns a InWheelCtx or InCondaPkgCtx context manager depending on the file extension """ diff --git a/auditwheel/hashfile.py b/auditwheel/hashfile.py index 1ae45c70..96598bef 100644 --- a/auditwheel/hashfile.py +++ b/auditwheel/hashfile.py @@ -1,7 +1,8 @@ import hashlib +from typing import BinaryIO -def hashfile(afile, blocksize=65536): +def hashfile(afile: BinaryIO, blocksize: int = 65536) -> str: """Hash the contents of an open file handle with SHA256""" hasher = hashlib.sha256() buf = afile.read(blocksize) diff --git a/auditwheel/lddtree.py b/auditwheel/lddtree.py index 1ef9e2df..195bab30 100644 --- a/auditwheel/lddtree.py +++ b/auditwheel/lddtree.py @@ -17,9 +17,9 @@ import errno import logging import functools -from typing import List, Dict, Optional, Any +from typing import List, Dict, Optional, Any, Tuple -from elftools.elf.elffile import ELFFile # type: ignore +from elftools.elf.elffile import ELFFile log = logging.getLogger(__name__) __all__ = ['lddtree'] @@ -75,7 +75,7 @@ def dedupe(items: List[str]) -> List[str]: return [seen.setdefault(x, x) for x in items if x not in seen] -def parse_ld_paths(str_ldpaths, root='', path=None) -> List[str]: +def parse_ld_paths(str_ldpaths: str, path: str, root: str = '') -> List[str]: """Parse the colon-delimited list of paths and apply ldso rules to each Note the special handling as dictated by the ldso: @@ -204,7 +204,7 @@ def load_ld_paths(root: str = '/', prefix: str = '') -> Dict[str, List[str]]: return ldpaths -def compatible_elfs(elf1, elf2): +def compatible_elfs(elf1: ELFFile, elf2: ELFFile) -> bool: """See if two ELFs are compatible This compares the aspects of the ELF to see if they're compatible: @@ -232,7 +232,8 @@ def compatible_elfs(elf1, elf2): elf1.header['e_machine'] == elf2.header['e_machine']) -def find_lib(elf, lib, ldpaths, root='/'): +def find_lib(elf: ELFFile, lib: str, ldpaths: List[str], + root: str = '/') -> Tuple[Optional[str], Optional[str]]: """Try to locate a ``lib`` that is compatible to ``elf`` in the given ``ldpaths`` @@ -370,13 +371,13 @@ def lddtree(path: str, if t.entry.d_tag == 'DT_RPATH': rpaths = parse_ld_paths( t.rpath, - root=root, - path=path) + path=path, + root=root) elif t.entry.d_tag == 'DT_RUNPATH': runpaths = parse_ld_paths( t.runpath, - root=root, - path=path) + path=path, + root=root) elif t.entry.d_tag == 'DT_NEEDED': libs.append(t.needed) if runpaths: @@ -412,7 +413,7 @@ def lddtree(path: str, 'path': fullpath, 'needed': [], } - if fullpath: + if realpath and fullpath: lret = lddtree(realpath, root, prefix, diff --git a/auditwheel/main.py b/auditwheel/main.py index 1e0ae19d..0598cd64 100644 --- a/auditwheel/main.py +++ b/auditwheel/main.py @@ -2,7 +2,8 @@ import sys import logging import argparse -import pkg_resources # type: ignore +import pkg_resources +from typing import Optional from . import main_show from . import main_addtag @@ -10,7 +11,7 @@ from . import main_repair -def main(): +def main() -> Optional[int]: if sys.platform != 'linux': print('Error: This tool only supports Linux') return 1 @@ -45,7 +46,7 @@ def main(): if not hasattr(args, 'func'): p.print_help() - return + return None rval = args.func(args, p) diff --git a/auditwheel/main_addtag.py b/auditwheel/main_addtag.py index 9591adf1..19167c10 100644 --- a/auditwheel/main_addtag.py +++ b/auditwheel/main_addtag.py @@ -22,7 +22,7 @@ def configure_parser(sub_parsers): def execute(args, p): import os - from ._vendor.wheel.wheelfile import WHEEL_INFO_RE # type: ignore + from ._vendor.wheel.wheelfile import WHEEL_INFO_RE from .wheeltools import InWheelCtx, add_platforms, WheelToolsError from .wheel_abi import analyze_wheel_abi, NonPlatformWheel diff --git a/auditwheel/main_lddtree.py b/auditwheel/main_lddtree.py index e9daa0b9..6a0ea2c5 100644 --- a/auditwheel/main_lddtree.py +++ b/auditwheel/main_lddtree.py @@ -1,5 +1,4 @@ import logging - logger = logging.getLogger(__name__) diff --git a/auditwheel/main_show.py b/auditwheel/main_show.py index 6745394b..fea9240b 100644 --- a/auditwheel/main_show.py +++ b/auditwheel/main_show.py @@ -12,7 +12,7 @@ def configure_parser(sub_parsers): p.set_defaults(func=execute) -def printp(text): +def printp(text: str) -> None: from textwrap import wrap print() print('\n'.join(wrap(text))) diff --git a/auditwheel/patcher.py b/auditwheel/patcher.py index 7db4bcd3..0acda3e0 100644 --- a/auditwheel/patcher.py +++ b/auditwheel/patcher.py @@ -46,7 +46,7 @@ def _verify_patchelf() -> None: class Patchelf(ElfPatcher): - def __init__(self): + def __init__(self) -> None: _verify_patchelf() def replace_needed(self, diff --git a/auditwheel/policy/__init__.py b/auditwheel/policy/__init__.py index a82ff2b5..22879c0a 100644 --- a/auditwheel/policy/__init__.py +++ b/auditwheel/policy/__init__.py @@ -1,7 +1,7 @@ import sys import json import platform as _platform_module -from typing import Optional +from typing import Optional, List from os.path import join, dirname, abspath import logging @@ -12,7 +12,7 @@ bits = 8 * (8 if sys.maxsize > 2 ** 32 else 4) -def get_arch_name(): +def get_arch_name() -> str: machine = _platform_module.machine() if machine not in {'x86_64', 'i686'}: return machine @@ -56,7 +56,7 @@ def get_policy_name(priority: int) -> Optional[str]: return matches[0] -def get_priority_by_name(name: str): +def get_priority_by_name(name: str) -> Optional[int]: matches = [p['priority'] for p in _POLICIES if p['name'] == name] if len(matches) == 0: return None @@ -65,7 +65,7 @@ def get_priority_by_name(name: str): return matches[0] -def get_replace_platforms(name: str): +def get_replace_platforms(name: str) -> List[str]: """Extract platform tag replacement rules from policy >>> get_replace_platforms('linux_x86_64') diff --git a/auditwheel/policy/external_references.py b/auditwheel/policy/external_references.py index dc05f6ff..dd188ed8 100644 --- a/auditwheel/policy/external_references.py +++ b/auditwheel/policy/external_references.py @@ -1,6 +1,6 @@ import re import logging -from typing import Dict, List, Set, Any +from typing import Dict, Set, Any, Generator from ..elfutils import is_subdir from . import load_policies @@ -9,12 +9,13 @@ LIBPYTHON_RE = re.compile(r'^libpython\d\.\dm?.so(.\d)*$') -def lddtree_external_references(lddtree: Dict, wheel_path: str): +def lddtree_external_references(lddtree: Dict, wheel_path: str) -> Dict: # XXX: Document the lddtree structure, or put it in something # more stable than a big nested dict policies = load_policies() - def filter_libs(libs, whitelist): + def filter_libs(libs: Set[str], + whitelist: Set[str]) -> Generator[str, None, None]: for lib in libs: if 'ld-linux' in lib or lib in ['ld64.so.2', 'ld64.so.1']: # always exclude ELF dynamic linker/loader @@ -30,7 +31,7 @@ def filter_libs(libs, whitelist): continue yield lib - def get_req_external(libs: Set[str], whitelist: Set[str]): + def get_req_external(libs: Set[str], whitelist: Set[str]) -> Set[str]: # get all the required external libraries libs = libs.copy() reqs = set() @@ -44,7 +45,7 @@ def get_req_external(libs: Set[str], whitelist: Set[str]): ret = {} # type: Dict[str, Dict[str, Any]] for p in policies: - needed_external_libs = [] # type: List[str] + needed_external_libs = set() # type: Set[str] if not (p['name'] == 'linux' and p['priority'] == 0): # special-case the generic linux platform here, because it diff --git a/auditwheel/policy/versioned_symbols.py b/auditwheel/policy/versioned_symbols.py index 5f363b67..8c3e25f9 100644 --- a/auditwheel/policy/versioned_symbols.py +++ b/auditwheel/policy/versioned_symbols.py @@ -8,7 +8,7 @@ def versioned_symbols_policy(versioned_symbols: Dict[str, Set[str]]) -> int: def policy_is_satisfied(policy_name: str, - policy_sym_vers: Dict[str, Set[str]]): + policy_sym_vers: Dict[str, Set[str]]) -> bool: policy_satisfied = True for name in (set(required_vers) & set(policy_sym_vers)): if not required_vers[name].issubset(policy_sym_vers[name]): diff --git a/auditwheel/repair.py b/auditwheel/repair.py index d85337d0..5b1ae4b1 100644 --- a/auditwheel/repair.py +++ b/auditwheel/repair.py @@ -9,7 +9,7 @@ from os.path import exists, basename, abspath, isabs, dirname from os.path import join as pjoin from subprocess import check_call -from typing import Dict, Optional, Tuple +from typing import Dict, Iterable, Optional, Tuple from auditwheel.patcher import ElfPatcher from .elfutils import elf_read_rpaths, elf_read_dt_needed, is_subdir @@ -99,13 +99,14 @@ def repair_wheel(wheel_path: str, abi: str, lib_sdir: str, out_dir: str, return ctx.out_wheel -def strip_symbols(libraries): +def strip_symbols(libraries: Iterable[str]) -> None: for lib in libraries: logger.info('Stripping symbols from %s', lib) check_call(['strip', '-s', lib]) -def copylib(src_path, dest_dir, patcher): +def copylib(src_path: str, dest_dir: str, + patcher: ElfPatcher) -> Tuple[str, str]: """Graft a shared library from the system into the wheel and update the relevant links. diff --git a/auditwheel/tmpdirs.py b/auditwheel/tmpdirs.py index 8a4e90e5..a3b47b32 100644 --- a/auditwheel/tmpdirs.py +++ b/auditwheel/tmpdirs.py @@ -2,6 +2,8 @@ ''' import os from tempfile import TemporaryDirectory +from types import TracebackType +from typing import Optional, Type class InTemporaryDirectory: @@ -21,19 +23,21 @@ class InTemporaryDirectory: True ''' - def __init__(self): + def __init__(self) -> None: self._tmpdir = TemporaryDirectory() @property - def name(self): + def name(self) -> str: return self._tmpdir.name - def __enter__(self): + def __enter__(self) -> str: self._pwd = os.getcwd() os.chdir(self._tmpdir.name) return self._tmpdir.__enter__() - def __exit__(self, exc, value, tb): + def __exit__(self, exc: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: os.chdir(self._pwd) return self._tmpdir.__exit__(exc, value, tb) @@ -62,7 +66,7 @@ class InGivenDirectory: again. """ - def __init__(self, path=None): + def __init__(self, path: Optional[str] = None) -> None: """ Initialize directory context manager Parameters @@ -75,12 +79,14 @@ def __init__(self, path=None): path = os.getcwd() self.name = os.path.abspath(path) - def __enter__(self): + def __enter__(self) -> str: self._pwd = os.path.abspath(os.getcwd()) if not os.path.isdir(self.name): os.mkdir(self.name) os.chdir(self.name) return self.name - def __exit__(self, exc, value, tb): + def __exit__(self, exc: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: os.chdir(self._pwd) diff --git a/auditwheel/tools.py b/auditwheel/tools.py index b12d056b..f80e50d3 100644 --- a/auditwheel/tools.py +++ b/auditwheel/tools.py @@ -3,11 +3,12 @@ import shutil from glob import glob from os.path import join as pjoin +from typing import Any, Iterable, List import zipfile import subprocess -def unique_by_index(sequence): +def unique_by_index(sequence: Iterable[Any]) -> List[Any]: """ unique elements in `sequence` in the order in which they occur Parameters @@ -27,7 +28,7 @@ def unique_by_index(sequence): return uniques -def zip2dir(zip_fname, out_dir): +def zip2dir(zip_fname: str, out_dir: str) -> None: """ Extract `zip_fname` into output directory `out_dir` Parameters @@ -52,7 +53,7 @@ def zip2dir(zip_fname, out_dir): zf.extractall(out_dir) -def dir2zip(in_dir, zip_fname): +def dir2zip(in_dir: str, zip_fname: str) -> None: """ Make a zip file `zip_fname` with contents of directory `in_dir` The recorded filenames are relative to `in_dir`, so doing a standard zip @@ -75,7 +76,7 @@ def dir2zip(in_dir, zip_fname): z.write(os.path.join(root, file), out_fname) -def tarbz2todir(tarbz2_fname, out_dir): +def tarbz2todir(tarbz2_fname: str, out_dir: str) -> None: """Extract `tarbz2_fname` into output directory `out_dir` """ subprocess.check_output(['tar', 'xjf', tarbz2_fname, '-C', out_dir]) diff --git a/auditwheel/wheel_abi.py b/auditwheel/wheel_abi.py index 69f83ce6..160b9573 100644 --- a/auditwheel/wheel_abi.py +++ b/auditwheel/wheel_abi.py @@ -127,14 +127,14 @@ def get_wheel_elfdata(wheel_fn: str): uses_ucs2_symbols, uses_PyFPE_jbuf) -def get_external_libs(external_refs): +def get_external_libs(external_refs) -> Dict[str, str]: """Get external library dependencies for all policies excluding the default linux policy :param external_refs: external references for all policies :return: {realpath: soname} e.g. {'/path/to/external_ref.so.1.2.3': 'external_ref.so.1'} """ - result = {} + result: Dict[str, str] = {} for policy in external_refs.values(): # linux tag (priority 0) has no white-list, do not analyze it if policy['priority'] == 0: @@ -193,7 +193,7 @@ def get_symbol_policies(versioned_symbols, external_versioned_symbols, return result -def analyze_wheel_abi(wheel_fn: str): +def analyze_wheel_abi(wheel_fn: str) -> WheelAbIInfo: external_refs = { p['name']: {'libs': {}, 'priority': p['priority']} diff --git a/auditwheel/wheeltools.py b/auditwheel/wheeltools.py index cb7e551e..f8240155 100644 --- a/auditwheel/wheeltools.py +++ b/auditwheel/wheeltools.py @@ -10,12 +10,14 @@ import hashlib import csv from itertools import product +from types import TracebackType +from typing import Generator, Iterable, Optional, Type import logging from base64 import urlsafe_b64encode -from ._vendor.wheel.pkginfo import (read_pkg_info, # type: ignore +from ._vendor.wheel.pkginfo import (read_pkg_info, write_pkg_info) -from ._vendor.wheel.wheelfile import WHEEL_INFO_RE # type: ignore +from ._vendor.wheel.wheelfile import WHEEL_INFO_RE from .tmpdirs import InTemporaryDirectory from .tools import unique_by_index, zip2dir, dir2zip @@ -28,7 +30,7 @@ class WheelToolsError(Exception): pass -def _dist_info_dir(bdist_dir): +def _dist_info_dir(bdist_dir: str) -> str: """Get the .dist-info directory from an unpacked wheel Parameters @@ -43,7 +45,7 @@ def _dist_info_dir(bdist_dir): return info_dirs[0] -def rewrite_record(bdist_dir): +def rewrite_record(bdist_dir: str) -> None: """ Rewrite RECORD file with hashes for all files in `wheel_sdir` Copied from :method:`wheel.bdist_wheel.bdist_wheel.write_record` @@ -63,12 +65,12 @@ def rewrite_record(bdist_dir): if exists(sig_path): os.unlink(sig_path) - def walk(): + def walk() -> Generator[str, None, None]: for dir, dirs, files in os.walk(bdist_dir): for f in files: yield pjoin(dir, f) - def skip(path): + def skip(path: str) -> bool: """Wheel hashes every possible file.""" return path == record_relpath @@ -85,7 +87,7 @@ def skip(path): digest = hashlib.sha256(data).digest() sha256 = urlsafe_b64encode(digest).rstrip(b'=').decode('ascii') hash_ = f'sha256={sha256}' - size = len(data) + size = f'{len(data)}' record_path = relpath(path, bdist_dir).replace(psep, '/') writer.writerow((record_path, hash_, size)) @@ -98,7 +100,7 @@ class InWheel(InTemporaryDirectory): pack stuff up for you. """ - def __init__(self, in_wheel, out_wheel=None, ret_self=False): + def __init__(self, in_wheel: str, out_wheel: Optional[str] = None) -> None: """ Initialize in-wheel context manager Parameters @@ -108,19 +110,18 @@ def __init__(self, in_wheel, out_wheel=None, ret_self=False): out_wheel : None or str: filename of wheel to write after exiting. If None, don't write and discard - ret_self : bool, optional - If True, return ``self`` from ``__enter__``, otherwise return the - directory path. """ self.in_wheel = abspath(in_wheel) self.out_wheel = None if out_wheel is None else abspath(out_wheel) super().__init__() - def __enter__(self): + def __enter__(self) -> str: zip2dir(self.in_wheel, self.name) return super().__enter__() - def __exit__(self, exc, value, tb): + def __exit__(self, exc: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: if self.out_wheel is not None: rewrite_record(self.name) dir2zip(self.name, self.out_wheel) @@ -143,7 +144,7 @@ class InWheelCtx(InWheel): ``wheel_path``. """ - def __init__(self, in_wheel, out_wheel=None): + def __init__(self, in_wheel: str, out_wheel: Optional[str] = None) -> None: """ Init in-wheel context manager returning self from enter Parameters @@ -161,7 +162,10 @@ def __enter__(self): self.path = super().__enter__() return self - def iter_files(self): + def iter_files(self) -> Generator[str, None, None]: + if self.path is None: + raise ValueError( + "This function should be called from context manager") record_names = glob.glob(os.path.join(self.path, '*.dist-info/RECORD')) if len(record_names) != 1: raise ValueError("Should be exactly one `*.dist_info` directory") @@ -174,7 +178,8 @@ def iter_files(self): yield filename -def add_platforms(wheel_ctx, platforms, remove_platforms=()): +def add_platforms(wheel_ctx: InWheelCtx, platforms: Iterable[str], + remove_platforms: Iterable[str] = ()) -> str: """Add platform tags `platforms` to a wheel Add any platform tags in `platforms` that are missing @@ -193,6 +198,10 @@ def add_platforms(wheel_ctx, platforms, remove_platforms=()): """ definitely_not_purelib = False + if wheel_ctx.path is None: + raise ValueError( + "This function should be called from wheel_ctx context manager") + info_fname = pjoin(_dist_info_dir(wheel_ctx.path), 'WHEEL') info = read_pkg_info(info_fname) # Check what tags we have diff --git a/setup.cfg b/setup.cfg index f93c1267..717b55f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,6 +43,11 @@ log_cli_level = 20 exclude = _vendor +[mypy] +follow_imports = silent +ignore_missing_imports = True +warn_unused_ignores = True + [mypy-auditwheel/_vendor/*] follow_imports = skip ignore_errors = True diff --git a/tests/install.sh b/tests/install.sh new file mode 100755 index 00000000..6df48207 --- /dev/null +++ b/tests/install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -exuo pipefail + +pip install -r test-requirements.txt +pip install tox codecov +pip install -e . +# pull manylinux images that will be used, this helps passing tests which would otherwise timeout. +python -c $'from tests.integration.test_manylinux import MANYLINUX_IMAGES\nfor image in MANYLINUX_IMAGES.values():\n print(image)' | xargs -L 1 docker pull diff --git a/tests/travis.sh b/tests/travis.sh index c7dd8e52..d1ce6852 100755 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -1,11 +1,7 @@ #!/bin/bash -set -exo pipefail +set -exuo pipefail -if [[ "$LINTER" == "1" ]]; then - tox -e lint -else - pytest -s --cov auditwheel --cov-branch - auditwheel lddtree $(python -c 'import sys; print(sys.executable)') - codecov || true # Ignore failures from codecov tool -fi +pytest -s --cov auditwheel --cov-branch +auditwheel lddtree $(python -c 'import sys; print(sys.executable)') +codecov || true # Ignore failures from codecov tool