From 43e5bb603db866bb050f6f809f59d0675ab5463f Mon Sep 17 00:00:00 2001 From: joaomcteixeira Date: Fri, 17 Apr 2020 10:27:24 -0400 Subject: [PATCH 1/2] Help solve Miniconda forbidden error In case Miniconda can not be downloaded due to forbidden error advises the user to perform a manual download. Installation can than proceed using the Miniconda installation file already in the FarSeer-NMR folder. --- README.md | 8 +++++--- install/commons.py | 25 ++++++++++++++++++++----- install/messages.py | 28 ++++++++++++---------------- install/system.py | 2 +- installation_vars.py | 19 +++++++++++++++++++ 5 files changed, 57 insertions(+), 25 deletions(-) create mode 100644 installation_vars.py diff --git a/README.md b/README.md index f1b66a6..f23bfff 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ We are currently rewriting Farseer-NMR towards **version 2**. And you are now visiting **version 1** branch. -**Version 1** is still functional and working, though not much supported apart from minor bugs. You can download the latest stable version, v1.3.5, on the [releases tab](https://github.com/Farseer-NMR/FarSeer-NMR/releases/tag/v1.3.5), or visit the complete version 1 code and its documentation in [version 1 branch](https://github.com/Farseer-NMR/FarSeer-NMR/tree/version1) on GitHub. +**Version 1** is still functional and working, though not much supported apart from minor bugs. You can download the latest stable version, v1.3.6, on the [releases tab](https://github.com/Farseer-NMR/FarSeer-NMR/releases/tag/v1.3.6), or visit the complete version 1 code and its documentation in [version 1 branch](https://github.com/Farseer-NMR/FarSeer-NMR/tree/version1) on GitHub. Our original publication is available at [JBioMolNMR](https://link.springer.com/article/10.1007/s10858-018-0182-5), cite us if you use Farseer-NMR for your research, regardless of which version you use. @@ -30,7 +30,9 @@ With Farseer-NMR, you have: # Download, Install and Update -[Download here the latest version of Farseer-NMR.](https://github.com/Farseer-NMR/FarSeer-NMR/releases) +[Download here the latest stable version of Farseer-NMR.](https://github.com/Farseer-NMR/FarSeer-NMR/releases), **please note that the version at the `master` branch is not stable.** + +Unpack the download compressed file and navigate to the newly created `FarSeer-NMR` folder. To install Farseer-NMR simply run the installation script: @@ -38,7 +40,7 @@ To install Farseer-NMR simply run the installation script: python install_farseernmr.py ``` -Read [here](https://github.com/Farseer-NMR/FarSeer-NMR/wiki/Download,-Install-and-Update) some additional detail on how to setup your Farseer-NMR installation - it's very easy! +Read [here](https://github.com/Farseer-NMR/FarSeer-NMR/wiki/Download,-Install-and-Update) some additional details on how to setup your Farseer-NMR installation - it's very easy! # Documentation diff --git a/install/commons.py b/install/commons.py index e836bb1..430d354 100644 --- a/install/commons.py +++ b/install/commons.py @@ -28,7 +28,6 @@ Contributors to this file: - Joao M.C. Teixeira (https://github.com/joaomcteixeira) - Farseer-NMR is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or @@ -61,12 +60,15 @@ if python_version < 3: import urllib as url + from urllib2 import HTTPError + url_request_error = urllib2.HTTPError url_not_found_error = IOError user_input = raw_input elif python_version == 3: import urllib import urllib.request as url + url_request_error = urllib.error.HTTPError url_not_found_error = urllib.error.URLError user_input = input @@ -158,26 +160,39 @@ def reporthook(blocknum, blocksize, totalsize): def download_file(link, destination): """ Downloads file. - + Parameters: - link (str): the file URL - destination (str): where to save file in computer """ log.info("* Downloading {}...".format(link)) log.info("* ... to destination: {}".format(destination)) - try: url.urlretrieve( link, destination, reporthook ) + except url_request_error as err: + if os.path.exists(destination): + pass + else: + errmsg = ( + '* ATTENTION * Anaconda servers have blocked the download of Miniconda.\n' + '* ATTENTION * Please download manually the Miniconda installation file\n' + '* ATTENTION * provided in the link bellow:\n' + f'* ATTENTION * {link}\n' + '* ATTENTION * place the Miniconda installation file int he FarSeer-NMR folder\n' + '* ATTENTION * and repeat the installation process again.' + ) + log.info(errmsg) + sys.exit() except url_not_found_error as e: log.info(messages.url_error) log.info(messages.something_wrong) log.debug(e) log.info(messages.abort) - sys_exit() + sys.exit() except ValueError as e: log.info(messages.url_unkown) log.debug(e) @@ -189,7 +204,7 @@ def download_file(link, destination): log.info(messages.something_wrong) log.info(messages.abort) sys_exit() - + if os.path.exists(destination): log.debug("destination file found: {}".format(destination)) log.info("... Download completed") diff --git a/install/messages.py b/install/messages.py index 9103716..c3e8df4 100644 --- a/install/messages.py +++ b/install/messages.py @@ -324,27 +324,26 @@ def _formats_short_title(s): # http://patorjk.com/software/taag/#p=display&h=1&f=Doom&t=---------%0AFarseer-NMR%0Av1.3.3%0A--------- banner = r""" - ______ ______ ______ ______ ______ ______ ______ ______ ______ |______||______||______||______||______||______||______||______||______| -______ _____ _ _ ___ _________ -| ___| / ___| | \ | || \/ || ___ \ -| |_ __ _ _ __\ `--. ___ ___ _ __ ______ | \| || . . || |_/ / -| _|/ _` || '__|`--. \ / _ \ / _ \| '__||______|| . ` || |\/| || / -| | | (_| || | /\__/ /| __/| __/| | | |\ || | | || |\ \ -\_| \__,_||_| \____/ \___| \___||_| \_| \_/\_| |_/\_| \_| +______ _ _ ___ _________ +| ___| | \ | || \/ || ___ \ +| |_ __ _ _ __ ___ ___ ___ _ __ ______ | \| || . . || |_/ / +| _|/ _` || '__|/ __| / _ \ / _ \| '__||______|| . ` || |\/| || / +| | | (_| || | \__ \| __/| __/| | | |\ || | | || |\ \ +\_| \__,_||_| |___/ \___| \___||_| \_| \_/\_| |_/\_| \_| - __ _____ _____ - / | |____ | | ___| -__ __`| | / / |___ \ -\ \ / / | | \ \ \ \ - \ V / _| |_ _ .___/ /_ /\__/ / - \_/ \___/(_)\____/(_)\____/ + __ _____ ____ + / | |____ | / ___| +__ __`| | / / / /___ +\ \ / / | | \ \ | ___ \ + \ V / _| |_ _ .___/ /_ | \_/ | + \_/ \___/(_)\____/(_)\_____/ @@ -352,9 +351,6 @@ def _formats_short_title(s): ______ ______ ______ ______ ______ ______ ______ ______ ______ |______||______||______||______||______||______||______||______||______| - - - """ if __name__ == "__main__": diff --git a/install/system.py b/install/system.py index 766e0ab..1306588 100644 --- a/install/system.py +++ b/install/system.py @@ -48,7 +48,7 @@ # configure accordingly to the host project software_name = "Farseer-NMR" -software_version = (1, 3, 5) # v1.0.0 +software_version = (1, 3, 6) # v1.0.0 min_space_allowed = 3 # min GB required to install your software installation_log_name = "install.log" update_log_name = "update.log" diff --git a/installation_vars.py b/installation_vars.py new file mode 100644 index 0000000..c02b15a --- /dev/null +++ b/installation_vars.py @@ -0,0 +1,19 @@ + +# This file registers the installation variables +# which are required for debugging and updating purposes. +# +# Please do not delete it from the installation folder +# +# For additional help, please write us at: +# farseer-nmr@googlegroups.com + +from pathlib import Path + +install_option = 1 +install_dir = Path(r'/home/joao/software/FarSeer-NMR') +conda_exec = Path(r'/home/joao/software/FarSeer-NMR/miniconda/bin/conda') +python_exec = Path(r'/home/joao/software/FarSeer-NMR/miniconda/envs/farseernmr/bin/python') +miniconda_folder = Path(r'/home/joao/software/FarSeer-NMR/miniconda') +installed_env_file = Path(r'/home/joao/software/FarSeer-NMR/install/farseernmr.yml') +installed_env_name = 'farseernmr' +installed_env_version = 2 From 0d363d93526c6d82d8a8fb9a165eda3d309bbdbe Mon Sep 17 00:00:00 2001 From: joaomcteixeira Date: Fri, 17 Apr 2020 10:35:17 -0400 Subject: [PATCH 2/2] removed dummy file --- installation_vars.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 installation_vars.py diff --git a/installation_vars.py b/installation_vars.py deleted file mode 100644 index c02b15a..0000000 --- a/installation_vars.py +++ /dev/null @@ -1,19 +0,0 @@ - -# This file registers the installation variables -# which are required for debugging and updating purposes. -# -# Please do not delete it from the installation folder -# -# For additional help, please write us at: -# farseer-nmr@googlegroups.com - -from pathlib import Path - -install_option = 1 -install_dir = Path(r'/home/joao/software/FarSeer-NMR') -conda_exec = Path(r'/home/joao/software/FarSeer-NMR/miniconda/bin/conda') -python_exec = Path(r'/home/joao/software/FarSeer-NMR/miniconda/envs/farseernmr/bin/python') -miniconda_folder = Path(r'/home/joao/software/FarSeer-NMR/miniconda') -installed_env_file = Path(r'/home/joao/software/FarSeer-NMR/install/farseernmr.yml') -installed_env_name = 'farseernmr' -installed_env_version = 2