changeset 1070:a013a3bea22a

cm: Upgrade release script.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Feb 2018 23:37:59 -0800
parents dff873f11541
children 7f94407d037d
files garcon/pypi.py
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/garcon/pypi.py	Tue Feb 13 23:22:27 2018 -0800
+++ b/garcon/pypi.py	Tue Feb 13 23:37:59 2018 -0800
@@ -1,4 +1,6 @@
+import os.path
 import re
+import shutil
 from invoke import task, run
 
 
@@ -10,8 +12,6 @@
     # FoodTruck assets.
     print("Update node modules")
     run("npm install")
-    print("Install Bower components")
-    run("bower install")
     print("Generating FoodTruck assets")
     run("gulp")
 
@@ -27,7 +27,15 @@
     # CHANGELOG.rst and documentation changelog page.
     run("invoke changelog --last %s" % version)
     run("invoke changelog --last %s -o docs/pages/support/changelog.md" %
-            version)
+        version)
+
+    # Clean `dist` folder before running setuptools.
+    dist_dir = os.path.join(
+        os.path.dirname(os.path.dirname(__file__)),
+        'dist')
+    if os.path.isdir(dist_dir):
+        print("Removing %s" % dist_dir)
+        shutil.rmtree(dist_dir)
 
     if not local_only:
         if commit_assets:
@@ -47,7 +55,8 @@
 
         # PyPi upload.
         run("python setup.py version")
-        run("python setup.py sdist upload")
+        run("python setup.py sdist bdist_wheel")
+        run("twine upload dist/*")
     else:
         if commit_assets:
             print("Would submit FoodTruck assets...")