Skip to content

Commit

Permalink
lib versions; use setuptools_scm & markdown readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Mar 1, 2019
1 parent 0401ccb commit 4e9119d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 33 deletions.
28 changes: 18 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ sudo: false
matrix:
include:
- python: "2.7"
env: [DJANGO=1.8.18, DRF=3.6.4]
env: [DJANGO=1.8.19, DRF=3.6.4]
- python: "3.5"
env: [DJANGO=1.8.19, DRF=3.6.4]
- python: "2.7"
env: [DJANGO=1.11.12, DRF=3.8.2]
- python: "3.4"
env: [DJANGO=1.8.18, DRF=3.6.4]
env: [DJANGO=1.11.20, DRF=3.9.1]
- python: "3.7"
env: [DJANGO=1.11.20, DRF=3.9.1]
- python: "3.4"
env: [DJANGO=2.0.4, DRF=3.8.2]
env: [DJANGO=2.0.13, DRF=3.9.1]
- python: "3.5"
env: [DJANGO=2.0.4, DRF=3.8.2]
env: [DJANGO=2.0.13, DRF=3.9.1]
- python: "3.6"
env: [DJANGO=1.11.12, DRF=3.8.2]
- python: "3.6"
env: [DJANGO=2.0.4, DRF=3.8.2]
env: [DJANGO=2.0.13, DRF=3.9.1]
- python: "3.7"
env: [DJANGO=2.1.7, DRF=3.9.1]
- python: "3.5"
env: [DJANGO=2.1.7, DRF=3.9.1]
- python: "3.6"
env: [DJANGO=2.0.4, DRF=3.8.2, LINT=1]
env: [DJANGO=2.1.7, DRF=3.9.1]
- python: "3.7"
env: [DJANGO=2.1.7, DRF=3.9.1]
- python: "3.7"
env: [DJANGO=2.1.7, DRF=3.9.1, LINT=1]
install:
- pip install django==$DJANGO
- pip install djangorestframework==$DRF
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Enhanced support for [natural keys] in Django and [Django REST Framework]. Extr

[![Travis Build Status](https://img.shields.io/travis/wq/django-natural-keys/master.svg)](https://travis-ci.org/wq/django-natural-keys)
[![Python Support](https://img.shields.io/pypi/pyversions/natural-keys.svg)](https://pypi.org/project/natural-keys/)
[![Django Support](https://img.shields.io/badge/Django-1.8%2C%201.11%2C%202.0-blue.svg)](https://pypi.org/project/natural-keys/)
[![Django Support](https://img.shields.io/badge/Django-1.8%2C%201.11%2C%202.0-%2C%202.1-blue.svg)](https://pypi.org/project/natural-keys/)


## Usage
Expand Down
34 changes: 12 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,26 @@
"""


def parse_markdown_readme():
"""
Convert README.md to RST via pandoc, and load into memory
(fallback to LONG_DESCRIPTION on failure)
"""
# Attempt to run pandoc on markdown file
import subprocess
def readme():
try:
subprocess.call(
['pandoc', '-t', 'rst', '-o', 'README.rst', 'README.md']
)
except OSError:
return LONG_DESCRIPTION

# Attempt to load output
try:
readme = open(os.path.join(
os.path.dirname(__file__),
'README.rst'
))
readme = open('README.md')
except IOError:
return LONG_DESCRIPTION
return readme.read()
else:
return readme.read()


setup(
name='natural-keys',
version='1.4.0',
use_scm_version=True,
author='S. Andrew Sheppard',
author_email='andrew@wq.io',
url='https://github.com/wq/django-natural-keys',
license='MIT',
packages=['natural_keys'],
description=LONG_DESCRIPTION.strip(),
long_description=parse_markdown_readme(),
long_description=readme(),
long_description_content_type="text/markdown",
install_requires=[
'html-json-forms>=1.0.0',
],
Expand All @@ -55,14 +40,19 @@ def parse_markdown_readme():
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Topic :: Database',
],
test_suite='tests',
tests_require=[
'djangorestframework'
],
setup_requires=[
'setuptools_scm',
],
)

0 comments on commit 4e9119d

Please sign in to comment.