From 03c76cab30c0caf1e58023d00ff468cc55844f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Thu, 26 Apr 2018 16:57:37 +0200 Subject: [PATCH] Introduce markdown on PyPi --- Makefile | 6 ++---- README.md | 8 -------- setup.py | 6 ++---- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 0045f712..730d210d 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ clean: build: clean @echo "Building..." + @pip install -U setuptools @python setup.py sdist bdist_wheel --universal install: @@ -25,10 +26,7 @@ install: @[ ! -d $(ENV)/ ] && python3 -m venv $(ENV)/ || : @$(ENV)/bin/pip install $(requirements) -generate-rst: - @pandoc --from=markdown --to=rst --output=README.rst README.md - -publish: generate-rst build +publish: build @echo "Publishing to pypi..." @$(ENV)/bin/twine upload -r $(REPOSITORY) dist/* diff --git a/README.md b/README.md index bae9cb91..34eefc0d 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,6 @@ Django webpack loader consumes the output generated by [webpack-bundle-tracker]( A [changelog](CHANGELOG.md) is also available. -## Maintainers -In order to overcome the lack of support for Markdown on PyPi, building this package can use [pandoc](http://pandoc.org/installing.html) along with [pypandoc](https://pypi.python.org/pypi/pypandoc) to convert the README.md into a Restructured Text format compatible with PyPI. This requires installing `pandoc` for your operating system (installation instructions on the pandoc site), and `pypandoc` which will be installed if you: - - pip install -r requirements-dev.txt - -before uploading to PyPI. - -If pandoc or pypandoc fails, the README.md file will be uploaded as it was before this enhancement. ## Compatibility diff --git a/setup.py b/setup.py index c92f50e6..2449f7e8 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,7 @@ def rel(*parts): '''returns the relative path to a file wrt to the current directory''' return os.path.abspath(os.path.join(os.path.dirname(__file__), *parts)) -if os.path.isfile('README.rst'): - README = open('README.rst', 'r').read() -else: - README = open('README.md', 'r').read() +README = open('README.md', 'r').read() with open(rel('webpack_loader', '__init__.py')) as handler: INIT_PY = handler.read() @@ -25,6 +22,7 @@ def rel(*parts): version = VERSION, description = 'Transparently use webpack with django', long_description=README, + long_description_content_type="text/markdown", author = 'Owais Lone', author_email = 'hello@owaislone.org', download_url = 'https://github.com/owais/django-webpack-loader/tarball/{0}'.format(VERSION),