From 6346f4a924c7778ff797bdc4bef8c120a0a02f60 Mon Sep 17 00:00:00 2001 From: Yuri Bochkarev Date: Fri, 21 Feb 2020 22:03:11 +0100 Subject: [PATCH] remote rst and pandoc from setup.py, fix requirements-dev.txt --- .github/workflows/pythonapp.yml | 1 + requirements-dev.txt | 1 - setup.py | 39 +++++---------------------------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index aed818c4..4b006e0c 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -21,6 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install -r requirements.txt pip install -r requirements-dev.txt - name: Display Python version run: python -c "import sys; print(sys.version)" diff --git a/requirements-dev.txt b/requirements-dev.txt index b4d7b199..2526ce47 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ --r requirements.txt pytest>=2.5 pytest-cov pandoc diff --git a/setup.py b/setup.py index 6d1161d5..72de2f67 100644 --- a/setup.py +++ b/setup.py @@ -16,31 +16,6 @@ from edx_dl._version import __version__ -def generate_readme_rst(): - """ - Generate README.rst from README.md via pandoc. - - In case of errors, we show a message having the error that we got and - exit the program. - """ - - pandoc_cmd = [ - 'pandoc', - '--from=markdown', - '--to=rst', - '--output=README.rst', - 'README.md' - ] - - if os.path.exists('README.rst'): - return - try: - subprocess.call(pandoc_cmd) - except (IOError, OSError) as e: - print('Could not run "pandoc". Error: %s' % e, file=sys.stderr) - print('Generating only a stub instead of the real documentation.') - - def read_file(filename, alt=None): """ Read the contents of filename or give an alternative result instead. @@ -55,12 +30,9 @@ def read_file(filename, alt=None): return lines -generate_readme_rst() - long_description = read_file( - 'README.rst', - 'Generate README.rst from README.md via pandoc!\n\nExample: ' - 'pandoc --from=markdown --to=rst --output=README.rst README.md' + 'README.md', + 'Cannot find README.md' ) requirements = read_file('requirements.txt') dev_requirements = read_file('requirements-dev.txt') @@ -94,12 +66,13 @@ def read_file(filename, alt=None): url='https://github.com/coursera-dl/edx-dl', install_requires=requirements, - extras_require=dict( - dev=dev_requirements - ), + extras_require={ + 'dev': dev_requirements, + }, description='Simple tool to download video and lecture materials from edx.org.', long_description=long_description, + long_description_content_type='text/markdown', keywords=['edx-dl','edX', 'download', 'education', 'MOOCs', 'video'], classifiers=trove_classifiers,