Skip to content

Commit

Permalink
Merge pull request #283 from rosskarchner/cfgov-setup
Browse files Browse the repository at this point in the history
use cfgov_setup to build frontend assets
  • Loading branch information
rosskarchner committed Oct 5, 2016
2 parents 265a263 + 94ec738 commit ae64ef8
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, find_packages
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(['./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='college-costs',
version='2.2.4',
Expand Down Expand Up @@ -94,10 +52,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 ae64ef8

Please sign in to comment.