From 4684492f699aa87cdf3c9c83ddc584aa819ac6ea Mon Sep 17 00:00:00 2001 From: Harry Slatyer Date: Thu, 14 Jan 2021 16:23:33 +1100 Subject: [PATCH] Fix description in setup and bump version tags The setup script currently fails when DESCRIPTION.rst isn't present, which happens when pip installing. Oops. This makes the behaviour consistent with more standard approaches (specifically the approach used by dephell when automatically creating setup.py from pyproject.toml). --- docs/conf.py | 4 ++-- mloop/__init__.py | 2 +- setup.py | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index ce238db..8091ecc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -72,7 +72,7 @@ # The short X.Y version. version = '3.2' # The full version, including alpha/beta/rc tags. -release = '3.2.0' +release = '3.2.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -152,7 +152,7 @@ # The name for this set of Sphinx documents. # " v documentation" by default. -#html_title = 'M-LOOP v3.2.0' +#html_title = 'M-LOOP v3.2.1' # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None diff --git a/mloop/__init__.py b/mloop/__init__.py index f8b203a..ad0add9 100644 --- a/mloop/__init__.py +++ b/mloop/__init__.py @@ -12,5 +12,5 @@ import os -__version__= "3.2.0" +__version__= "3.2.1" __all__ = ['controllers','interfaces','launchers','learners','nnlearner','testing','utilities','visualizations','cmd'] diff --git a/setup.py b/setup.py index 733eb87..39ff44d 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,12 @@ from os import path def main(): - this_directory = path.abspath(path.dirname(__file__)) - with open(path.join(this_directory, 'DESCRIPTION.rst'), encoding='utf-8') as f: - long_description = f.read() + long_description = '' + here = path.abspath(path.dirname(__file__)) + description_path = path.join(here, 'DESCRIPTION.rst') + if path.exists(description_path): + with open(description_path, 'rb') as stream: + long_description = stream.read().decode('utf8') setup( name = 'M-LOOP', @@ -46,7 +49,7 @@ def main(): license = 'MIT', keywords = 'automated machine learning optimization optimisation science experiment quantum', url = 'https://github.com/michaelhush/M-LOOP/', - download_url = 'https://github.com/michaelhush/M-LOOP/tarball/3.2.0', + download_url = 'https://github.com/michaelhush/M-LOOP/tarball/3.2.1', classifiers = ['Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Science/Research',