Skip to content
Snippets Groups Projects
Commit c7e5d674 authored by Joseph Weston's avatar Joseph Weston
Browse files

correctly add static data to source distribution

parent 9ade2600
No related branches found
No related tags found
No related merge requests found
include-recursive zesje/static/*
setup.py 100644 → 100755
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,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment