From 6086ccd3415373eb5f5e03bff9447426dbb15b39 Mon Sep 17 00:00:00 2001 From: Daniel Standage Date: Wed, 20 Feb 2019 17:14:15 -0500 Subject: [PATCH 1/4] Cleaning up build --- Makefile | 158 ++++++++++-------------------------------------------- setup.cfg | 21 ++------ setup.py | 111 ++++++-------------------------------- 3 files changed, 50 insertions(+), 240 deletions(-) diff --git a/Makefile b/Makefile index 12ebaa802c..74ec229e5b 100644 --- a/Makefile +++ b/Makefile @@ -32,71 +32,41 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Contact: khmer-project@idyll.org - +# # `make help` for a summary of useful targets - +# # `SHELL=bash` Will break Titus's laptop, so don't use BASH-isms like # `[[` conditional expressions. # PREFIX=/usr/local CPPSOURCES=$(wildcard src/oxli/*.cc include/oxli/*.hh src/khmer/_cpy_*.cc include/khmer/_cpy_*.hh) setup.py CYSOURCES=$(wildcard khmer/_oxli/*.pxd khmer/_oxli/*.pyx) -PYSOURCES=$(filter-out khmer/_version.py, \ - $(wildcard khmer/*.py scripts/*.py oxli/*.py) ) +PYSOURCES=$(filter-out khmer/_version.py, $(wildcard khmer/*.py scripts/*.py oxli/*.py) ) SOURCES=$(PYSOURCES) $(CPPSOURCES) $(CYSOURCES) setup.py - -DEVPKGS=pep8==1.6.2 diff_cover autopep8 pylint coverage gcovr pytest pydocstyle - -GCOVRURL=git+https://github.com/nschum/gcovr.git@never-executed-branches - -VERSION=$(shell ./setup.py version | grep Version | awk '{print $$4}' \ - | sed 's/+/-/') - -# The following four variables are only used by cppcheck. If you want to -# change how things are compiled edit `setup.cfg` or `setup.py`. -DEFINES += -DNDEBUG -DVERSION=$(VERSION) -DSEQAN_HAS_BZIP2=1 \ - -DSEQAN_HAS_ZLIB=1 -UNO_UNIQUE_RC - -INCLUDESTRING=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null \ - | grep '^ /' | grep -v cc1plus) -INCLUDEOPTS=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null \ - | grep '^ /' | grep -v cc1plus | awk '{print "-I" $$1 " "}') - -PYINCLUDE=$(shell python -c "import sysconfig; \ - flags = ['-I' + sysconfig.get_path('include'), \ - '-I' + sysconfig.get_path('platinclude')]; print(' '.join(flags))") - -CPPCHECK_SOURCES=$(filter-out lib/test%, $(wildcard lib/*.cc khmer/_khmer.cc) ) -CPPCHECK=cppcheck --enable=all \ - --error-exitcode=1 \ - --suppress='*:/Library/*' \ - --suppress='*:*/include/python*/Python.h' \ - --suppress='*:/usr/*' --platform=unix64 \ - --std=c++11 --inline-suppr -Ilib -Ithird-party/bzip2 \ - -Ithird-party/zlib -Ithird-party/smhasher -Ithird-party/rollinghash \ - $(DEFINES) $(INCLUDEOPTS) $(PYINCLUDE) $(CPPCHECK_SOURCES) --quiet - -UNAME := $(shell uname) +DEVPKGS=pycodestyle coverage gcovr pytest pydocstyle +VERSION=$(shell ./setup.py version | grep Version | awk '{print $$4}' | sed 's/+/-/') +INCLUDESTRING=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null | grep '^ /' | grep -v cc1plus) +INCLUDEOPTS=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null | grep '^ /' | grep -v cc1plus | awk '{print "-I" $$1 " "}') +PYINCLUDE=$(shell python -c "import sysconfig; flags = ['-I' + sysconfig.get_path('include'), '-I' + sysconfig.get_path('platinclude')]; print(' '.join(flags))") +UNAME=$(shell uname) +MODEXT=$(shell python -c "import sysconfig;print(sysconfig.get_config_var('SO'))") +EXTENSION_MODULE=khmer/_khmer$(MODEXT) ifeq ($(UNAME),Linux) TESTATTR ?= 'not known_failing and not jenkins and not huge' else TESTATTR ?= 'not known_failing and not jenkins and not huge and not linux' endif -MODEXT=$(shell python -c \ - "import sysconfig;print(sysconfig.get_config_var('SO'))") -EXTENSION_MODULE = khmer/_khmer$(MODEXT) -CY_MODULES = $($(wildcard khmer/_oxli/*.pyx): .pyx=.$(MODEXT)) - -PYLINT_TEMPLATE="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" ## all : default task; compile C++ code, build shared object library all: sharedobj + ## help : print this help message and exit help: Makefile @sed -n 's/^##//p' $< + ## install-dep : install most of the development dependencies via pip install-dep: install-dependencies @@ -104,27 +74,26 @@ install-dependencies: pip install $(DEVPKGS) pip install --requirement doc/requirements.txt + ## sharedobj : build khmer shared object file sharedobj: $(EXTENSION_MODULE) $(EXTENSION_MODULE): $(CPPSOURCES) $(CYSOURCES) ./setup.py build_ext --inplace -coverage-debug: $(CPPSOURCES) - export CFLAGS="-pg -fprofile-arcs -ftest-coverage -O0"; ./setup.py \ - build_ext --debug --inplace --libraries gcov - touch coverage-debug ## install : install the khmer module and scripts install: FORCE ./setup.py build install + ## dist : create a module package for distribution dist: dist/khmer-$(VERSION).tar.gz dist/khmer-$(VERSION).tar.gz: $(SOURCES) ./setup.py sdist + ## clean : clean up all temporary / machine-generated files clean: FORCE cd src/oxli && $(MAKE) clean || true @@ -150,6 +119,7 @@ debug: FORCE -D_GLIBCXX_DEBUG -DDEBUG_ASSEMBLY=1 -DDEBUG_FILTERS=1"; python setup.py build_ext --debug \ --inplace + ## doc : render documentation in HTML doc: build/sphinx/html/index.html @@ -159,6 +129,7 @@ build/sphinx/html/index.html: $(SOURCES) $(wildcard doc/*.rst) doc/conf.py all @echo '--> docs in build/sphinx/html <--' @echo '' + ## pdf : render documentation as a PDF file # packages needed include: texlive-latex-base texlive-latex-recommended # texlive-fonts-recommended texlive-latex-extra @@ -174,6 +145,7 @@ build/sphinx/latex/khmer.pdf: $(SOURCES) doc/conf.py $(wildcard doc/*.rst) \ cppcheck-result.xml: $(CPPSOURCES) $(CPPCHECK) --xml-version=2 2> cppcheck-result.xml + ## cppcheck : run static analysis on C++ code cppcheck: FORCE @$(CPPCHECK) @@ -181,53 +153,20 @@ cppcheck: FORCE cppcheck-long: FORCE @$(CPPCHECK) -Ithird-party/seqan/core/include -## pep8 : check Python code style -pep8: $(PYSOURCES) $(wildcard tests/*.py) - pep8 setup.py khmer/*.py scripts/*.py tests/*.py oxli/*.py examples/python-api/*.py +## style : check Python code style +style: $(PYSOURCES) $(wildcard tests/*.py) + pycodestyle setup.py khmer/*.py scripts/*.py tests/*.py oxli/*.py examples/python-api/*.py -pep8_report.txt: $(PYSOURCES) $(wildcard tests/*.py) - pep8 setup.py khmer/ scripts/ tests/ oxli/ \ - > pep8_report.txt || true - -diff_pep8_report: pep8_report.txt - diff-quality --violations=pep8 pep8_report.txt ## pydocstyle : check Python doc strings pydocstyle: $(PYSOURCES) $(wildcard tests/*.py) - pydocstyle --ignore=D100,D101,D102,D103,D203 --match='(?!_version).*\.py' \ - setup.py khmer/ scripts/ oxli/ || true - -pydocstyle_report.txt: $(PYSOURCES) $(wildcard tests/*.py) - pydocstyle setup.py khmer/ scripts/ tests/ oxli/ \ - > pydocstyle_report.txt 2>&1 || true + pydocstyle --ignore=D100,D101,D102,D103,D203 --match='(?!_version).*\.py' setup.py khmer/ scripts/ oxli/ -diff_pydocstyle_report: pydocstyle_report.txt - diff-quality --violations=pep8 pydocstyle_report.txt ## astyle : fix most C++ code indentation and formatting astyle: $(CPPSOURCES) astyle -A10 --max-code-length=80 $(filter-out setup.py,$(CPPSOURCES)) -## autopep8 : fix most Python code indentation and formatting -autopep8: $(PYSOURCES) $(wildcard tests/*.py) - autopep8 --recursive --in-place --exclude _version.py --ignore E309 \ - setup.py khmer/*.py scripts/*.py tests/*.py oxli/*.py - -## format : check/fix all code formatting (astyle and autopep8) -format: astyle autopep8 - # Do nothing - -## pylint : run static code analysis on Python code -pylint: $(PYSOURCES) $(wildcard tests/*.py) - pylint --msg-template=$(PYLINT_TEMPLATE) \ - setup.py $(PYSOURCES) tests/*.py || true - -pylint_report.txt: $(PYSOURCES) $(wildcard tests/*.py) $(wildcard sandbox/*.py) - pylint --msg-template=$(PYLINT_TEMPLATE) \ - $(PYSOURCES) tests sandbox > pylint_report.txt || true - -diff_pylint_report: pylint_report.txt - diff-quality --violations=pylint pylint_report.txt # We need to get coverage to look at our scripts. Since they aren't in a # python module we can't tell pytest to look for them (via an import @@ -265,6 +204,7 @@ diff-cover.html: coverage-gcovr.xml coverage.xml pytests.xml: FORCE py.test --junitxml=$@ -m ${TESTATTR} + ## doxygen : generate documentation of the C++ and Python code # helpful packages: doxygen graphviz # ignore warning re: _formulas.aux @@ -305,6 +245,7 @@ libtest: FORCE src/oxli/test-compile.cc -loxli rm -rf install_target + ## test : run the khmer test suite test: FORCE ./setup.py develop @@ -314,56 +255,11 @@ sloccount.sc: $(CPPSOURCES) $(PYSOURCES) $(wildcard tests/*.py) Makefile sloccount --duplicates --wide --details include src khmer scripts tests \ setup.py Makefile > sloccount.sc + ## sloccount : count lines of code sloccount: sloccount src include khmer scripts tests setup.py Makefile -coverity-build: - if [ -x "${cov_analysis_dir}/bin/cov-build" ]; \ - then \ - export PATH=${PATH}:${cov_analysis_dir}/bin; \ - cov-build --dir cov-int --c-coverage gcov \ - --disable-gcov-arg-injection make coverage-debug; \ - cov-capture --dir cov-int --c-coverage gcov python -m pytest \ - -m $(TESTATTR) ; \ - cov-import-scm --dir cov-int --scm git 2>/dev/null; \ - else echo 'bin/cov-build does not exist in $$cov_analysis_dir: '\ - '${cov_analysis_dir}. Skipping coverity scan.'; \ - fi - -coverity-upload: cov-int - if [ -n "${COVERITY_TOKEN}" ]; \ - then \ - tar czf khmer-cov.tgz cov-int; \ - curl --form token=${COVERITY_TOKEN} --form \ - email=mcrusoe@msu.edu --form file=@khmer-cov.tgz \ - --form version=$(VERSION) \ - https://scan.coverity.com/builds?project=ged-lab%2Fkhmer ; \ - else echo 'Missing coverity credentials in $$COVERITY_TOKEN,'\ - 'skipping scan'; \ - fi - -coverity-clean-configuration: - rm -f ${cov_analysis_dir}/config/coverity_config.xml - -coverity-configure: - if [[ -x ${cov_analysis_dir}/bin/cov-configure ]]; \ - then \ - export PATH=${PATH}:${cov_analysis_dir}/bin; \ - for compiler in \ - /usr/bin/gcc-4.8 /usr/bin/x86_64-linux-gnu-gcc; do \ - cov-configure --comptype gcc \ - --compiler $${compiler}; \ - done; \ - else echo 'bin/cov-configure does not exist in $$cov_analysis_dir: '\ - '${cov_analysis_dir}. Skipping coverity configuration.'; \ - fi - -# may need to `sudo apt-get install bear` -compile_commands.json: clean - export PATH=$(shell echo $$PATH | sed 's=/usr/lib/ccache:==g') ; \ - bear ./setup.py build_ext - convert-release-notes: for file in doc/release-notes/*.md; do \ pandoc --from=markdown --to=rst $${file} > $${file%%.md}.rst; \ @@ -379,10 +275,12 @@ list-citation: git log --format='%aN,%aE' | sort -u | grep -v -F -f author-skips.txt > authors.csv python sort-authors-list.py + ## cpp-demos : run programs demonstrating access to the (unstable) C++ API cpp-demos: sharedobj cd examples/c++-api/ && make all run + ## py-demos : run programs demonstrating access to the Python API py-demos: sharedobj python examples/python-api/exact-counting.py diff --git a/setup.cfg b/setup.cfg index 894a4ea9b8..ebafd5e952 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,29 +1,17 @@ [build_ext] define = SEQAN_HAS_BZIP2,SEQAN_HAS_ZLIB undef = NO_UNIQUE_RC +libraries = z,bz2 +include-dirs = include:third-party/seqan/core/include:third-party/smhasher:third-party/cqf:third-party/rollinghash -# When you update the include directories here also update the paths used in -# docker/Dockerfile -# libraries = z,bz2 -## if using system libraries -include-dirs = include:third-party/zlib:third-party/bzip2:third-party/seqan/core/include:third-party/smhasher:third-party/cqf:third-party/rollinghash -# include-dirs = lib -## if using system libraries (broken) - -# define = NDEBUG -# is not needed for most Linux installs -# see the OPT line in /usr/lib/python2.7/config/Makefile which gets included -# in distutils version of CFLAGS - -[easy_install] [aliases] test=pytest + # See the docstring in versioneer.py for instructions. Note that you must # re-run 'versioneer.py setup' after changing this section, and commit the # resulting files. - [versioneer] VCS = git style = pep440 @@ -32,6 +20,7 @@ versionfile_build = khmer/_version.py tag_prefix = v parentdir_prefix = . -[pep8] + +[pycodestyle] exclude = _version.py ignore = E309,E226,E402 diff --git a/setup.py b/setup.py index ae5fe34b79..af52d51578 100755 --- a/setup.py +++ b/setup.py @@ -34,13 +34,10 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Contact: khmer-project@idyll.org -"""Setup for khmer project.""" -import ez_setup - -import glob +import codecs +from glob import glob import os -import sys from os import listdir as os_listdir from os.path import join as path_join from os.path import splitext @@ -49,7 +46,6 @@ import sys import sysconfig import tempfile -import codecs from setuptools import setup from setuptools import Extension @@ -60,7 +56,6 @@ from distutils.errors import DistutilsPlatformError import versioneer -ez_setup.use_setuptools(version="3.4.1") CMDCLASS = versioneer.get_cmdclass() @@ -68,25 +63,11 @@ HAS_CYTHON = False cy_ext = 'cpp' -# strip out -Wstrict-prototypes; a hack suggested by -# http://stackoverflow.com/a/9740721 -# proper fix coming in http://bugs.python.org/issue1222585 -# numpy has a "nicer" fix: -# https://github.com/numpy/numpy/blob/master/numpy/distutils/ccompiler.py -OPT = get_config_vars('OPT')[0] -os.environ['OPT'] = " ".join( - flag for flag in OPT.split() if flag != '-Wstrict-prototypes' -) - -# Checking for OpenMP support. Currently clang doesn't work with OpenMP, -# so it needs to be disabled for now. -# This function comes from the yt project: -# https://bitbucket.org/yt_analysis/yt/src/f7c75759e0395861b52d16921d8ce3ad6e36f89f/yt/utilities/lib/setup.py?at=yt - +# Checking for OpenMP support. Currently clang doesn't work with OpenMP, so it +# needs to be disabled for now. This function comes from the yt project: +# https://bitbucket.org/yt_analysis/yt/src/f7c75759/yt/utilities/lib/setup.py def check_for_openmp(): - """Check for OpenMP support.""" - # Create a temporary directory tmpdir = tempfile.mkdtemp() curdir = os.getcwd() exit_code = 1 @@ -96,12 +77,7 @@ def check_for_openmp(): try: os.chdir(tmpdir) - - # Get compiler invocation compiler = os.getenv('CC', 'cc') - - # Attempt to compile a test script. - # See http://openmp.org/wp/openmp-compilers/ filename = r'test.c' source = open(filename, 'wt', 1) source.write( @@ -116,10 +92,9 @@ def check_for_openmp(): """ ) with open(os.devnull, 'w') as fnull: - exit_code = subprocess.call([compiler, '-fopenmp', filename], - stdout=fnull, stderr=fnull) - - # Clean up + exit_code = subprocess.call( + [compiler, '-fopenmp', filename], stdout=fnull, stderr=fnull + ) source.close() finally: os.chdir(curdir) @@ -139,13 +114,6 @@ def distutils_dir_name(dname): def build_dir(): return path_join("build", distutils_dir_name("temp")) -# We bundle tested versions of zlib & bzip2. To use the system zlib and bzip2 -# change setup.cfg or use the `--libraries z,bz2` parameter which will make our -# custom build_ext command strip out the bundled versions. - - -ZLIBDIR = 'third-party/zlib' -BZIP2DIR = 'third-party/bzip2' BUILD_DEPENDS = [path_join("include", "khmer", bn + ".hh") for bn in [ "_cpy_khmer", "_cpy_utils", "_cpy_readparsers" @@ -168,15 +136,13 @@ def build_dir(): "MurmurHash3"]) # Don't forget to update lib/Makefile with these flags! -EXTRA_COMPILE_ARGS = ['-O3', '-std=c++11', '-pedantic', - '-fno-omit-frame-pointer'] -EXTRA_LINK_ARGS = ['-fno-omit-frame-pointer'] +EXTRA_COMPILE_ARGS = ['-O3', '-std=c++11'] +EXTRA_LINK_ARGS = [] if sys.platform == 'darwin': # force 64bit only builds - EXTRA_COMPILE_ARGS.extend(['-arch', 'x86_64', '-mmacosx-version-min=10.7', - '-stdlib=libc++']) - EXTRA_LINK_ARGS.append('-mmacosx-version-min=10.7') + EXTRA_COMPILE_ARGS.extend(['-arch', 'x86_64', '-mmacosx-version-min=10.9']) + EXTRA_LINK_ARGS.append('-mmacosx-version-min=10.9') if check_for_openmp(): EXTRA_COMPILE_ARGS.extend(['-fopenmp']) @@ -202,9 +168,7 @@ def build_dir(): 'c_string_encoding': 'utf8' } -for cython_ext in glob.glob(os.path.join("khmer", "_oxli", - "*.{0}".format(cy_ext))): - +for cython_ext in glob(os.path.join("khmer", "_oxli", "*.{0}".format(cy_ext))): CY_EXTENSION_MOD_DICT = \ { "sources": [cython_ext, "khmer/_oxli/oxli_exception_convert.cc"], @@ -300,58 +264,20 @@ def build_dir(): } -class KhmerBuildExt(_build_ext): # pylint: disable=R0904 - """Specialized Python extension builder for khmer project. - - Only run the library setup when needed, not on every invocation. - - Also strips out the bundled zlib and bzip2 libraries if - `--libraries z,bz2` is specified or the equivalent is in setup.cfg - """ - +class KhmerBuildExt(_build_ext): + """Specialized Python extension builder for khmer project.""" def run(self): - """Run extension builder.""" - if "%x" % sys.maxsize != '7fffffffffffffff': - raise DistutilsPlatformError("%s require 64-bit operating system" % - SETUP_METADATA["packages"]) - - if sys.platform == 'darwin' and 'gcov' in self.libraries: - self.libraries.remove('gcov') - cqfcmd = ['bash', '-c', 'cd third-party/cqf && make'] spawn(cmd=cqfcmd, dry_run=self.dry_run) for ext in self.extensions: ext.extra_objects.append(path_join("third-party", "cqf", "gqf.o")) - - if "z" not in self.libraries: - zcmd = ['bash', '-c', 'cd ' + ZLIBDIR + ' && ( test Makefile -nt' - ' configure || bash ./configure --static ) && make -f ' - 'Makefile.pic PIC'] - spawn(cmd=zcmd, dry_run=self.dry_run) - for ext in self.extensions: - ext.extra_objects.extend( - path_join("third-party", "zlib", bn + ".lo") for bn in [ - "adler32", "compress", "crc32", "deflate", "gzclose", - "gzlib", "gzread", "gzwrite", "infback", "inffast", - "inflate", "inftrees", "trees", "uncompr", "zutil"]) - - if "bz2" not in self.libraries: - bz2cmd = ['bash', '-c', 'cd ' + BZIP2DIR + ' && make -f ' - 'Makefile-libbz2_so all'] - spawn(cmd=bz2cmd, dry_run=self.dry_run) - for ext in self.extensions: - ext.extra_objects.extend( - path_join("third-party", "bzip2", bn + ".o") for bn in [ - "blocksort", "huffman", "crctable", "randtable", - "compress", "decompress", "bzlib"]) _build_ext.run(self) CMDCLASS.update({'build_ext': KhmerBuildExt}) -_DISTUTILS_REINIT = Distribution.reinitialize_command - +_DISTUTILS_REINIT = Distribution.reinitialize_command def reinitialize_command(self, command, reinit_subcommands): """Monkeypatch the original version from distutils. @@ -363,11 +289,8 @@ def reinitialize_command(self, command, reinit_subcommands): cmd_obj = _DISTUTILS_REINIT(self, command, reinit_subcommands) options = self.command_options.get(command) if options: - self._set_command_options( # pylint: disable=protected-access - cmd_obj, options) + self._set_command_options(cmd_obj, options) return cmd_obj - - Distribution.reinitialize_command = reinitialize_command From 11002d9436fa9b9290a71ae4e2145f1e9ad968fe Mon Sep 17 00:00:00 2001 From: Daniel Standage Date: Wed, 20 Feb 2019 22:30:31 -0500 Subject: [PATCH 2/4] Style fixes --- setup.cfg | 2 +- setup.py | 4 ++++ tests/test_cython_parsing.py | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/setup.cfg b/setup.cfg index ebafd5e952..2f730b97fa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,4 +23,4 @@ parentdir_prefix = . [pycodestyle] exclude = _version.py -ignore = E309,E226,E402 +ignore = E309,E226,E402,E722 diff --git a/setup.py b/setup.py index af52d51578..50207fb1fb 100755 --- a/setup.py +++ b/setup.py @@ -278,6 +278,8 @@ def run(self): _DISTUTILS_REINIT = Distribution.reinitialize_command + + def reinitialize_command(self, command, reinit_subcommands): """Monkeypatch the original version from distutils. @@ -291,6 +293,8 @@ def reinitialize_command(self, command, reinit_subcommands): if options: self._set_command_options(cmd_obj, options) return cmd_obj + + Distribution.reinitialize_command = reinitialize_command diff --git a/tests/test_cython_parsing.py b/tests/test_cython_parsing.py index 710ae711e2..83b445dd29 100755 --- a/tests/test_cython_parsing.py +++ b/tests/test_cython_parsing.py @@ -223,9 +223,9 @@ def testRequirePairedAndMinLength_HalfPass(self, parser, create_fastx): assert len(result) == 1 assert n == 0 - l, r = result[0] - assert l == reads[0] - assert r == reads[1] + left, right = result[0] + assert left == reads[0] + assert right == reads[1] @pytest.mark.parametrize("parser", [FastxParser, SanitizedFastxParser]) def testRequirePairedAndMinLength_SwappedHalfPass(self, parser, @@ -244,9 +244,9 @@ def testRequirePairedAndMinLength_SwappedHalfPass(self, parser, assert n == 0 assert len(result) == 1 - l, r = result[0] - assert l == reads[0] - assert r == reads[1] + left, right = result[0] + assert left == reads[0] + assert right == reads[1] @pytest.mark.parametrize("parser", [FastxParser, SanitizedFastxParser]) def testRequirePairedAndMinLength_NeitherPass(self, parser, create_fastx): @@ -264,9 +264,9 @@ def testRequirePairedAndMinLength_NeitherPass(self, parser, create_fastx): assert n == 0 assert len(result) == 1 - l, r = result[0] - assert l == reads[0] - assert r == reads[1] + left, right = result[0] + assert left == reads[0] + assert right == reads[1] @pytest.mark.parametrize("parser", [FastxParser, SanitizedFastxParser]) def testRequirePairedAndMinLength_SwappedNeitherPass(self, parser, @@ -285,9 +285,9 @@ def testRequirePairedAndMinLength_SwappedNeitherPass(self, parser, assert n == 0 assert len(result) == 1 - l, r = result[0] - assert l == reads[2] - assert r == reads[3] + left, right = result[0] + assert left == reads[2] + assert right == reads[3] def test_check_is_pair_1(): From d13544ab4ffb855f89ef66285c4d34a516a1d0d8 Mon Sep 17 00:00:00 2001 From: Daniel Standage Date: Wed, 20 Feb 2019 23:02:45 -0500 Subject: [PATCH 3/4] Fix Travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 693761b7f3..213f999d22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ install: # command to run tests script: - make test - - make pep8 + - make style - make doc - make py-demos - make cpp-demos From d00472e79936f3980eb631d8ae98ebfe3f307f81 Mon Sep 17 00:00:00 2001 From: Daniel Standage Date: Wed, 20 Feb 2019 23:23:59 -0500 Subject: [PATCH 4/4] Fix Travis build --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2f730b97fa..db01bdd104 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,4 +23,4 @@ parentdir_prefix = . [pycodestyle] exclude = _version.py -ignore = E309,E226,E402,E722 +ignore = E309,E226,E402,E722,W504