source: rattail/tasks.py @ 03c3bded

Last change on this file since 03c3bded was 03c3bded, checked in by Lance Edgar <lance@…>, 8 months ago

Use build module instead of invoking setup.py for release

cf. https://github.com/NeonGeckoCom/neon-messagebus-mq-connector/issues/16

  • Property mode set to 100644
File size: 1.5 KB
Line 
1# -*- coding: utf-8; -*-
2################################################################################
3#
4#  Rattail -- Retail Software Framework
5#  Copyright © 2010-2022 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"""
24Tasks for 'rattail' package
25"""
26
27from __future__ import unicode_literals, absolute_import
28
29import os
30import shutil
31
32from invoke import task
33
34
35here = os.path.abspath(os.path.dirname(__file__))
36exec(open(os.path.join(here, 'rattail', '_version.py')).read())
37
38
39@task
40def 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 -m build --sdist')
48    ctx.run('twine upload dist/rattail-{}.tar.gz'.format(__version__))
Note: See TracBrowser for help on using the repository browser.