annotate garcon/pypi.py @ 676:a04288f199a5

cm: Don't always generation the version when running `setuptools`.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 06 Mar 2016 23:51:20 -0800
parents 1e543ed2bf38
children 9231172e3d81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
642
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
1 from invoke import task, run
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
2
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
3
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
4 @task
650
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
5 def makerelease(version, local_only=False):
642
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
6 if not version:
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
7 raise Exception("You must specify a version!")
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
8
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
9 # FoodTruck assets.
648
1696f0a41cfc cm: Update npm modules and bower packages before making a release.
Ludovic Chabant <ludovic@chabant.com>
parents: 642
diff changeset
10 print("Update node modules")
1696f0a41cfc cm: Update npm modules and bower packages before making a release.
Ludovic Chabant <ludovic@chabant.com>
parents: 642
diff changeset
11 run("npm install")
1696f0a41cfc cm: Update npm modules and bower packages before making a release.
Ludovic Chabant <ludovic@chabant.com>
parents: 642
diff changeset
12 print("Install Bower components")
1696f0a41cfc cm: Update npm modules and bower packages before making a release.
Ludovic Chabant <ludovic@chabant.com>
parents: 642
diff changeset
13 run("bower install")
1696f0a41cfc cm: Update npm modules and bower packages before making a release.
Ludovic Chabant <ludovic@chabant.com>
parents: 642
diff changeset
14 print("Generating FoodTruck assets")
642
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
15 run("gulp")
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
16
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
17 # CHANGELOG.rst
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
18 run("invoke changelog --last %s" % version)
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
19
650
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
20 if not local_only:
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
21 # Submit the CHANGELOG.
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
22 run('hg commit CHANGELOG.rst -m "cm: Regenerate the CHANGELOG."')
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
23
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
24 # Tag in Mercurial, which will then be used for PyPi version.
642
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
25 run("hg tag %s" % version)
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
26
650
1e543ed2bf38 cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents: 648
diff changeset
27 # PyPi upload.
676
a04288f199a5 cm: Don't always generation the version when running `setuptools`.
Ludovic Chabant <ludovic@chabant.com>
parents: 650
diff changeset
28 run("python setup.py version")
642
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
29 run("python setup.py sdist upload")
79aefe82c6b6 cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
30