Skip to content

Commit ea1b6b3

Browse files
committed
setup.py: No longer need to convert README.md markdown to RST for PyPI
1 parent 602564b commit ea1b6b3

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[#49](https://github.com/bxparks/bigquery-schema-generator/issues/49).
88
* Add GitHub actions for automated tests and flake8 validation.
99
* Add package `__version__` string.
10+
* Update setup.py, no longer need to convert README.md markdown to RST.
1011
* 1.0 (2020-04-04)
1112
* Fix `--sanitize_names` for recursive RECORD fields (Thanks riccardomc@,
1213
see #43).

setup.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
from setuptools import setup
22

3-
# Convert README.md to README.rst because PyPI does not support Markdown.
4-
try:
5-
import pypandoc
6-
long_description = pypandoc.convert('README.md', 'rst', format='md')
7-
except: # noqa: E722
8-
# If unable to convert, try inserting the raw README.md file.
9-
try:
10-
with open('README.md', encoding="utf-8") as f:
11-
long_description = f.read()
12-
except: # noqa: E722
13-
# If all else fails, use some reasonable string.
14-
long_description = 'BigQuery schema generator.'
3+
# Slurp in the README.md. PyPI finally supports Markdown, so we no longer need
4+
# to convert it to RST.
5+
with open('README.md', encoding="utf-8") as f:
6+
long_description = f.read()
157

168
# Read the version string from bigquery_schema_generator/version.py.
179
# See https://packaging.python.org/guides/single-sourcing-package-version/
@@ -27,12 +19,13 @@
2719
version=version_string,
2820
description='BigQuery schema generator from JSON or CSV data',
2921
long_description=long_description,
22+
long_description_content_type="text/markdown",
3023
url='https://github.com/bxparks/bigquery-schema-generator',
3124
author='Brian T. Park',
3225
author_email='[email protected]',
3326
license='Apache 2.0',
3427
packages=['bigquery_schema_generator'],
35-
python_requires='~=3.6',
28+
python_requires='>=3.6',
3629
entry_points={
3730
'console_scripts': [
3831
'generate-schema = bigquery_schema_generator.generate_schema:main'

0 commit comments

Comments
 (0)