Skip to content

Commit

Permalink
update setup for better README formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed Nov 3, 2016
1 parent 7872cf5 commit 00c94a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
12 changes: 2 additions & 10 deletions setup.py
Expand Up @@ -4,16 +4,11 @@
import glob
import re
import io
import subprocess
import setuptools
import setuptools
from setuptools.command.test import test as TestCommand

VERSION_PATH='commcare_export/VERSION'

# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
subprocess.call(['pandoc', '--to=rst', '--output=README.txt', 'README.md'])

# Overwrite VERSION if we are actually building for a distribution to pypi
# This code path requires dependencies, etc, to be available
if 'sdist' in sys.argv:
Expand All @@ -28,11 +23,9 @@
# Crash if the VERSION is not a simple version and it is going to register or upload
if 'register' in sys.argv or 'upload' in sys.argv:
if not re.match('\d+\.\d+\.\d+', version):
print('Version %s is not an appropriate version for publicizing!' % version)
print('Version %s is not an appropriate version for publicizing! Make a tag and then try again.' % version)
sys.exit(1)

readme = 'README.txt' if os.path.exists('README.txt') else 'README.md'

class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
Expand All @@ -49,7 +42,6 @@ def run_tests(self):
name = "commcare-export",
version = version,
description = 'A command-line tool (and Python library) to extract data from CommCareHQ into a SQL database or Excel workbook',
long_description = io.open(readme, encoding='utf-8').read(),
author = 'Dimagi',
author_email = 'information@dimagi.com',
url = "https://github.com/dimagi/commcare-export",
Expand Down

0 comments on commit 00c94a1

Please sign in to comment.