diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b4e1667d2aef604250dc2a69f5edb9c94db2a90a --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Compiled python modules. +*.pyc + +# Setuptools distribution folder. +/dist/ + +# Python egg metadata, regenerated from source files by setuptools. +/*.egg-info + +# Backups +*~ diff --git a/bin/split_merged.py b/bin/split_merged.py index 1d99ae47ee88f7ac8f16a0b6b1591dd570c993e8..1b8ffffece22263e4a3cadbaf41aea2644837ea5 100755 --- a/bin/split_merged.py +++ b/bin/split_merged.py @@ -19,6 +19,9 @@ subgroups of those reads based on similarity. """ import sys +major, minor = sys.version_info[:2] +if major < 3 or (major == 3 and minor < 8): + sys.exit("Need at least python 3.8\n") import logging from pathlib import Path import multiprocessing as mp @@ -59,6 +62,7 @@ def main(): pool.apply_async( split_fasta, args=( in_fname, + # "Walrus" assignment expression introduced in Python 3.8 cell_id := in_fname.name[:-len("_merged.fasta")], out_dir.join_path(cell_id))) for in_fname in in_fnames] diff --git a/setup.py b/setup.py index 0e7560c0474e9829596a3ce12cb2c11bdae88260..74930c11819bc35fdbfdfa5ec94d3655302c04c0 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,9 @@ setup( author="Blaise Li", author_email="blaise.li@normalesup.org", license="GNU GPLv3", - python_requires=">=3.4, <4", + # >=3.8 because using := in bin/split_merged.py + # Requirement could be relaxed to >=3.6 otherwise. + python_requires=">=3.8, <4", packages=find_packages(), scripts=["bin/split_merged.py"], #ext_modules = extensions,