From dc1660087150b1b78a34dc0c51f4859d6bd31fa0 Mon Sep 17 00:00:00 2001 From: nvbn Date: Mon, 27 Jul 2015 23:23:26 +0300 Subject: [PATCH] #311 Manually convert md to rst --- README.md | 8 ++++---- requirements.txt | 1 + setup.py | 12 +++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d741331a..5a453a21 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Magnificent app which corrects your previous console command, inspired by a [@liamosaur](https://twitter.com/liamosaur/) [tweet](https://twitter.com/liamosaur/status/506975850596536320). -![gif with examples](https://raw.githubusercontent.com/nvbn/thefuck/master/example.gif) +[![gif with examples](https://raw.githubusercontent.com/nvbn/thefuck/master/example.gif)](https://raw.githubusercontent.com/nvbn/thefuck/master/example.gif) Few more examples: @@ -208,14 +208,14 @@ Bundled, but not enabled by default: For adding your own rule you should create `your-rule-name.py` in `~/.thefuck/rules`. The rule should contain two functions: + ```python match(command: Command, settings: Settings) -> bool get_new_command(command: Command, settings: Settings) -> str ``` -Also the rule can contain an optional function -`side_effect(command: Command, settings: Settings) -> None` and -optional `enabled_by_default`, `requires_output` and `priority` variables. +Also the rule can contain an optional function `side_effect(command: Command, settings: Settings) -> None` +and optional `enabled_by_default`, `requires_output` and `priority` variables. `Command` has three attributes: `script`, `stdout` and `stderr`. diff --git a/requirements.txt b/requirements.txt index 40ce7169..92ed391f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ pytest-mock wheel setuptools>=17.1 pexpect +pypandoc diff --git a/setup.py b/setup.py index 6a018537..92a2d971 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,13 @@ from setuptools import setup, find_packages import sys +try: + import pypandoc + + long_description = pypandoc.convert('README.md', 'rst') +except: + long_description = open('README.md').read() + version = sys.version_info[:2] if version < (2, 7): print('thefuck requires Python version 2.7 or later' + @@ -12,7 +19,7 @@ elif (3, 0) < version < (3, 3): ' ({}.{} detected).'.format(*version)) sys.exit(-1) -VERSION = '2.5' +VERSION = '2.5.4' install_requires = ['psutil', 'colorama', 'six'] extras_require = {':python_version<"3.4"': ['pathlib']} @@ -20,14 +27,13 @@ extras_require = {':python_version<"3.4"': ['pathlib']} setup(name='thefuck', version=VERSION, description="Magnificent app which corrects your previous console command", + long_description=long_description, author='Vladimir Iakovlev', author_email='nvbn.rm@gmail.com', url='https://github.com/nvbn/thefuck', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests', 'release']), - setup_requires=['setuptools-markdown'], - long_description_markdown_filename='README.md', include_package_data=True, zip_safe=False, install_requires=install_requires,