Mercurial > piecrust2
annotate garcon/pypi.py @ 833:cb39c0dbe5f0
Merge pull request #40 from GitHub.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 05 Feb 2017 22:42:18 -0800 |
parents | 9231172e3d81 |
children | 22cf13b86cc3 bd269692dbb4 |
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 |
742
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
17 # CHANGELOG.rst and documentation changelog page. |
642
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) |
742
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
19 run("invoke changelog --last %s -o docs/pages/support/changelog.md" % |
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
20 version) |
642
79aefe82c6b6
cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 |
650
1e543ed2bf38
cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents:
648
diff
changeset
|
22 if not local_only: |
1e543ed2bf38
cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents:
648
diff
changeset
|
23 # Submit the CHANGELOG. |
742
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
24 run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' |
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
25 '-m "cm: Regenerate the CHANGELOG."') |
650
1e543ed2bf38
cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents:
648
diff
changeset
|
26 |
1e543ed2bf38
cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents:
648
diff
changeset
|
27 # 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
|
28 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
|
29 |
650
1e543ed2bf38
cm: Tweaks to the release script.
Ludovic Chabant <ludovic@chabant.com>
parents:
648
diff
changeset
|
30 # PyPi upload. |
676
a04288f199a5
cm: Don't always generation the version when running `setuptools`.
Ludovic Chabant <ludovic@chabant.com>
parents:
650
diff
changeset
|
31 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
|
32 run("python setup.py sdist upload") |
742
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
33 else: |
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
34 print("Would submit changelog files...") |
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
35 print("Would tag repo with %s..." % version) |
9231172e3d81
cm: Add generation of online changelog to the release task.
Ludovic Chabant <ludovic@chabant.com>
parents:
676
diff
changeset
|
36 print("Would upload to PyPi...") |
642
79aefe82c6b6
cm: Move all scripts into a `garcon` package with `invoke` support.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
37 |