diff --git a/README.md b/README.md index e3e250c..33fc007 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The pyEGA3 download client is a python-based tool for viewing and downloading fi ## Requirements -* Python3 ([download instructions](https://www.python.org/downloads/)) +* Python 3.6 or newer. ([download instructions](https://www.python.org/downloads/)) ### Firewall ports @@ -107,6 +107,21 @@ If the ports are open, both of the sites should load with no timeouts. pyega3/pyega3.py --help ``` +### Using Docker + +There are Docker images built by Bioconda: https://bioconda.github.io/recipes/pyega3/README.html +An example of running pyEGA3 in a Docker container: + +```bash +docker run --rm -v /tmp:/app -w /app quay.io/biocontainers/pyega3:3.4.0--py_0 pyega3 -d -t fetch EGAF00001775036 +``` + +This example command mounts your /tmp folder into the Docker container as /app, +starts the 3.4.0 version of pyEGA3 and downloads a test file. +The test file will be downloaded into your /tmp folder. +You can find other, possibly newer, versions ("tags") of the pyEGA3 Docker image +on the above-mentioned Bioconda page. + ## Usage - File download ```bash diff --git a/pyega3/pyega3.py b/pyega3/pyega3.py index e840197..50cbc73 100755 --- a/pyega3/pyega3.py +++ b/pyega3/pyega3.py @@ -19,7 +19,7 @@ import requests from tqdm import tqdm -version = "3.4.0" +version = "3.4.1" session_id = random.getrandbits(32) logging_level = logging.INFO diff --git a/setup.py b/setup.py index 56efa7c..616be49 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,25 @@ +import sys + from setuptools import setup, find_packages +CURRENT_PYTHON_VERSION = sys.version_info[:2] + +# When changing the value of the REQUIRED_PYTHON_VERSION variable, +# make sure to also change the "python_requires" variable +# and the "classifiers" section in this file (setup.py). +REQUIRED_PYTHON_VERSION = (3, 6) + +if CURRENT_PYTHON_VERSION < REQUIRED_PYTHON_VERSION: + sys.stderr.write(""" +========================== +Unsupported Python version +========================== +This version of pyEGA3 requires Python {}.{}, but you're trying to +install it on Python {}.{}. Please try to upgrade to a newer Python +version or maybe use pyEGA3 in a Docker container (see the README for that). +""".format(*(REQUIRED_PYTHON_VERSION + CURRENT_PYTHON_VERSION))) + sys.exit(1) + with open("README.md", encoding='utf-8') as f: long_description = f.read() @@ -9,9 +29,10 @@ long_description=long_description, long_description_content_type="text/plain", packages=find_packages(), - version = "3.4.0", + version="3.4.1", author="EGA team", author_email="ega-helpdesk@ebi.ac.uk", + python_requires=">=3.6", install_requires=["requests", "tqdm", "htsget", "psutil"], keywords=["EGA", "archive"], license="Apache License, Version 2.0", @@ -21,11 +42,11 @@ "Development Status :: 3 - Alpha", "Topic :: Scientific/Engineering :: Bio-Informatics", "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3.5" - ], + "Programming Language :: Python :: 3.6" + ], entry_points={ - "console_scripts": [ - "pyega3 = pyega3.pyega3:main", - ] - } + "console_scripts": [ + "pyega3 = pyega3.pyega3:main", + ] + } )