Skip to content

Commit

Permalink
Merge pull request #200 from waynew/release-helpers
Browse files Browse the repository at this point in the history
Release helpers
  • Loading branch information
waynew authored Nov 1, 2020
2 parents 18d930f + e6cca34 commit 60c422b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aiosmtpd/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from warnings import warn


__version__ = '1.2+'
__version__ = '1.2.2'
__ident__ = 'Python SMTP {}'.format(__version__)
log = logging.getLogger('mail.log')

Expand Down
28 changes: 28 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3

import os
import subprocess
import sys

import aiosmtpd.smtp as smtpd

version = smtpd.__version__

choice = input(f'Release aiosmtpd {version} - correct? [y/N]: ')
if choice.lower() not in ('y', 'yes'):
sys.exit('Release aborted')
else:
# We're probably already in the right place
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Let's use *this* python to build, please
subprocess.run([sys.executable, "setup.py", "sdist"])
# Assuming twine is installed. And that we're only building .tar.gz
subprocess.run(["twine", "check", f"dist/aiosmtpd-{version}.tar.gz"])
# You should have an aiosmtpd bit setup in your ~/.pypirc - for twine
subprocess.run(["twine", "upload", "--config-file", "~/.pypirc", "-r", "aiosmtpd", "dist/aiosmptd-{version}.tar.gz"])
# Only tag when we've actually built and uploaded. If something goes wrong
# we may need the tag somewhere else!
# The annotation information should come from the changelog
subprocess.run(["git", "tag", "-a", version])
# And now push the tag, of course.
subprocess.run(["git", "push", "upstream", "--tags"])
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
This is a server for SMTP and related protocols, similar in utility to the
standard library's smtpd.py module, but rewritten to be based on asyncio for
Python 3.""",
long_description_content_type="text/x-rst",
url='http://aiosmtpd.readthedocs.io/',
keywords='email',
packages=find_packages(),
Expand Down

0 comments on commit 60c422b

Please sign in to comment.