Commit c7e5d674 authored by Joseph Weston's avatar Joseph Weston

correctly add static data to source distribution

parent 9ade2600
include-recursive zesje/static/*
from setuptools import setup, find_packages
from distutils.command.build import build
from setuptools.command.sdist import sdist
def webpack():
import subprocess
subprocess.check_call(['yarn', 'install'])
subprocess.check_call(['yarn', 'build'])
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist as sdist_orig
class Build(build):
def run(self):
webpack()
super().run()
if sys.version_info < (3, 6):
print('zesje requires Python 3.6 or higher')
sys.exit(1)
class Sdist(sdist):
class sdist(sdist_orig):
def run(self):
webpack()
import subprocess
subprocess.check_call(['yarn', 'install'])
subprocess.check_call(['yarn', 'build'])
super().run()
......@@ -29,9 +26,7 @@ setup(
author="Zesje authors",
author_email="anton.akhmerov@tudelft.nl",
packages=find_packages('.'),
cmdclass={'build': Build,
'sdist': Sdist,
},
cmdclass=dict(sdist=sdist),
package_data={'zesje': ['static/*']},
include_package_data=True,
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment