Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #10 from cfpb/cfgov-setup
Browse files Browse the repository at this point in the history
adapt setup.py to use new cfgov-setup package.
  • Loading branch information
rosskarchner authored Oct 5, 2016
2 parents 362fd05 + 2b3573f commit ecb4d20
Showing 1 changed file with 2 additions and 48 deletions.
50 changes: 2 additions & 48 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import os
from setuptools import setup
from subprocess import call
from setuptools import Command
from distutils.command.build_ext import build_ext as _build_ext
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel


def read_file(filename):
Expand All @@ -17,43 +12,6 @@ def read_file(filename):
return ''


class build_frontend(Command):
""" A command class to run `setup.sh` """
description = 'build front-end JavaScript and CSS'
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
print __file__
call(['sh', './setup.sh'],
cwd=os.path.dirname(os.path.abspath(__file__)))


class build_ext(_build_ext):
""" A build_ext subclass that adds build_frontend """
def run(self):
self.run_command('build_frontend')
_build_ext.run(self)


class bdist_egg(_bdist_egg):
""" A bdist_egg subclass that runs build_frontend """
def run(self):
self.run_command('build_frontend')
_bdist_egg.run(self)


class bdist_wheel(_bdist_wheel):
""" A bdist_wheel subclass that runs build_frontend """
def run(self):
self.run_command('build_frontend')
_bdist_wheel.run(self)

setup(
name='complaintdatabase',
version='1.2.2',
Expand All @@ -76,10 +34,6 @@ def run(self):
],
long_description=read_file('README.md'),
zip_safe=False,
cmdclass={
'build_frontend': build_frontend,
'build_ext': build_ext,
'bdist_egg': bdist_egg,
'bdist_wheel': bdist_wheel,
},
setup_requires=['cfgov-setup==1.2',],
frontend_build_script= 'setup.sh',
)

0 comments on commit ecb4d20

Please sign in to comment.