Skip to content

Commit

Permalink
remote rst and pandoc from setup.py, fix requirements-dev.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
balta2ar committed Feb 21, 2020
1 parent 5353d82 commit 6346f4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pythonapp.yml
Expand Up @@ -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)"
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
@@ -1,4 +1,3 @@
-r requirements.txt
pytest>=2.5
pytest-cov
pandoc
39 changes: 6 additions & 33 deletions setup.py
Expand Up @@ -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.
Expand All @@ -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')
Expand Down Expand Up @@ -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,

Expand Down

0 comments on commit 6346f4a

Please sign in to comment.