Whitespace
[naja.git] / setup.py
index 792f01e560ddfb97eaca0c4441894a1c0e043876..49e8fffbda9d9f1acced73b9fd20c32bbf7621c4 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,10 @@
 """Setuptools setup.py file for Robolock II."""
 
 from setuptools import setup, find_packages
+from setuptools.command.sdist import sdist
+from setuptools.command.install import install
+
+from tools import gen_json
 
 try:
     import py2exe
@@ -15,6 +19,19 @@ except ImportError:
 # This should probably be pulled from constants.py
 VERSION_STR = "0.1"
 
+
+class NajaSdist(sdist):
+    def run(self):
+        gen_json.main()
+        sdist.run(self)
+
+
+class NajaInstall(install):
+    def run(self):
+        gen_json.main(update=False)
+        install.run(self)
+
+
 setup(
     name="robolock-II",
     version=VERSION_STR,
@@ -23,7 +40,7 @@ setup(
     author=(", ".join([
         "Simon Cross",
         "Neil Muller",
-        "Adrianna Pinska",
+        "Adrianna Pińska",
         "Stefano Rivera",
         "David Sharpe",
         "Jeremy Thurgood",
@@ -63,6 +80,9 @@ setup(
     # Dependencies
     install_requires=[
         'pygame',
+    ],
+
+    setup_requires=[
         'PyYAML',
     ],
 
@@ -72,6 +92,11 @@ setup(
         'scripts/naja',
     ],
 
+    cmdclass={
+        'sdist': NajaSdist,
+        'install': NajaInstall,
+    },
+
     # py2exe
     windows=[{
         'script': 'scripts/naja',