1 | # -*- coding: utf-8; -*- |
---|
2 | ################################################################################ |
---|
3 | # |
---|
4 | # Rattail -- Retail Software Framework |
---|
5 | # Copyright © 2010-2018 Lance Edgar |
---|
6 | # |
---|
7 | # This file is part of Rattail. |
---|
8 | # |
---|
9 | # Rattail is free software: you can redistribute it and/or modify it under the |
---|
10 | # terms of the GNU General Public License as published by the Free Software |
---|
11 | # Foundation, either version 3 of the License, or (at your option) any later |
---|
12 | # version. |
---|
13 | # |
---|
14 | # Rattail is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
15 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
16 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
17 | # details. |
---|
18 | # |
---|
19 | # You should have received a copy of the GNU General Public License along with |
---|
20 | # Rattail. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | # |
---|
22 | ################################################################################ |
---|
23 | """ |
---|
24 | Tasks for 'rattail' package |
---|
25 | """ |
---|
26 | |
---|
27 | from __future__ import unicode_literals, absolute_import |
---|
28 | |
---|
29 | import os |
---|
30 | import shutil |
---|
31 | |
---|
32 | from invoke import task |
---|
33 | |
---|
34 | |
---|
35 | here = os.path.abspath(os.path.dirname(__file__)) |
---|
36 | exec(open(os.path.join(here, 'rattail', '_version.py')).read()) |
---|
37 | |
---|
38 | |
---|
39 | @task |
---|
40 | def release(ctx, skip_tests=False): |
---|
41 | """ |
---|
42 | Release a new version of `rattail`. |
---|
43 | """ |
---|
44 | if not skip_tests: |
---|
45 | ctx.run('tox') |
---|
46 | shutil.rmtree('rattail.egg-info') |
---|
47 | ctx.run('python setup.py sdist --formats=gztar') |
---|
48 | ctx.run('twine upload dist/rattail-{}.tar.gz'.format(__version__)) |
---|