# The MIT License (MIT)
#
# Copyright (c) 2018 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os
import sys
from setuptools import setup, find_packages

def readme():
  if os.path.isfile('README.md') and any('dist' in x for x in sys.argv[1:]):
    if os.system('pandoc -s README.md -o README.rst') != 0:
      print('-----------------------------------------------------------------')
      print('WARNING: README.rst could not be generated, pandoc command failed')
      print('-----------------------------------------------------------------')
      if sys.stdout.isatty():
        input("Enter to continue... ")
    else:
      print("Generated README.rst with Pandoc")

  if os.path.isfile('README.rst'):
    with open('README.rst') as fp:
      return fp.read()
  return ''

setup(
  name='nr',
  version='2.0.1',
  license='MIT',
  description='Compound utility library and command-line tools for Python 2/3',
  long_description=readme(),
  url='https://github.com/NiklasRosenstein/py-nr',
  author='Niklas Rosenstein',
  author_email='rosensteinniklas@gmail.com',
  packages=find_packages(),
  entry_points = {
    'console_scripts': [
      'nr = nr.__main__:main'
    ]
  }
)

@@ -1127,18 +1127,18 @@
 ort 
+i
 o
-s
 %0Aimport 
 sys%0A
@@ -1137,16 +1137,17 @@
 ort 
-sys%0Afrom
+os%0Aimport
  set
@@ -1157,17 +1157,17 @@
 ools
- 
+%0A
 import s
 etup
@@ -1166,553 +1166,140 @@
 rt s
-etup, find_packages%0A%0Adef readme():%0A  if os.path.isfile('README.md') and any('dist' in x for x in sys.argv%5B1:%5D):%0A    if os.system('pandoc -s README.md -o README.rst') != 0:%0A      print('-----------------------------------------------------------------')%0A      print('WARNING: README.rst could not be generated, pandoc command failed')%0A      print('-----------------------------------------------------------------')%0A      if sys.stdout.isatty():%0A        input(%22Enter to continue... %22)%0A    else:%0A      print(%22Generated README.rst with Pandoc%22)%0A%0A  
+ys%0A%0Aif any('dist' in x for x in sys.argv%5B1:%5D):%0A  import setuptools_readme%0A  setuptools_readme.convert('README.md', encoding='utf8')%0A
 if o
@@ -1327,18 +1327,16 @@
 .rst'):%0A
-  
   with o
@@ -1368,40 +1368,90 @@
     
-  return fp.read()%0A  return ''%0A%0A
+long_description = fp.read()%0A    del fp%0Aelse:%0A  long_description = ''%0A%0Asetuptools.
 setu
@@ -1605,16 +1605,24 @@
 ion=
-readme()
+long_description
 ,%0A  
@@ -1756,16 +1756,27 @@
 ackages=
+setuptools.
 find_pac
@@ -1784,16 +1784,39 @@
 ages(),%0A
+  install_requires=%5B%5D,%0A
   entry_

update setup.py, use setuptools_readme for distribution