Skip to content

Commit

Permalink
Restructured Setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Feb 27, 2015
1 parent b7e2b53 commit 2ffbf04
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include README.md
include LICENSE
include test_geocoder.py
include requirements.txt
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: docs

setup:
python setup.py install

init:
pip install -r requirements.txt

test:
py.test test_geocoder.py --verbose

clean:
python setup.py clean --all
rm -rf build-*
rm -rf *egg*
rm -rf dist

tox:
tox

publish:
python setup.py register
python setup.py sdist upload
python setup.py bdist_wheel upload

register:
python setup.py register
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests>=2.5.3
ratelim>=0.1.6
32 changes: 10 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,21 @@
# coding: utf8
import sys
import os
from setuptools import setup

__version__ = '1.1.3'
requirements_file = "requirements.txt"
requirements = [pkg.strip() for pkg in open(requirements_file).readlines()]

try:
from setuptools import setup
except ImportError:
from distutils.core import setup


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wheel upload')
sys.exit()

# auto-convert README.md
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (ImportError, OSError):
# we'll just use the poorly formatted Markdown file instead
long_description = open('README.md').read()

install_requires = ['requests', 'ratelim']
setup_requires = ['tox', 'nose', 'flake8']
long_description = pypandoc.convert('README.md', 'rst') + "\n"
except(IOError, ImportError):
long_description = open('README.md').read() + "\n"

setup(
name='geocoder',
version='1.1.3',
version=__version__,
description="A complete Python Geocoding module made easy.",
long_description=long_description,
author='Denis Carriere',
Expand All @@ -40,11 +29,10 @@
geocode=geocoder.cli:cli
''',
packages=['geocoder'],
package_data={'': ['LICENSE', 'README.rst']},
package_data={'': ['LICENSE', 'README.md']},
package_dir={'geocoder': 'geocoder'},
include_package_data=True,
setup_requires=setup_requires,
install_requires=install_requires,
install_requires=requirements,
zip_safe=False,
keywords='geocoder arcgis tomtom opencage google bing here',
classifiers=(
Expand Down

0 comments on commit 2ffbf04

Please sign in to comment.