2012-11-25 20:11:59 +00:00
#!/usr/bin/env python
2016-01-02 22:40:29 +00:00
# Copyright 2012-2016, Damian Johnson and The Tor Project
2013-02-17 21:22:54 +00:00
# See LICENSE for licensing information
2017-07-03 18:24:47 +00:00
#
# Release Checklist
# =================
#
# * Recache latest information (cache_manual.py and cache_fallback_directories.py)
#
# * Tag the release
# |- Bump stem's version (in stem/__init__.py and docs/index.rst).
2017-07-03 22:03:56 +00:00
# |- git commit -a -m "Stem release 1.0.0"
2017-07-03 18:24:47 +00:00
# |- git tag -u 9ABBEEC6 -m "stem release 1.0.0" 1.0.0 d0bb81a
# +- git push --tags
#
# * Dry-run release on https://pypi.python.org/pypi/stem/
# |- python setup.py sdist
# |- gpg --detach-sig --armor dist/stem-dry-run-1.0.0.tar.gz
# |- twine upload dist/*
# +- Check that https://pypi.python.org/pypi/stem-dry-run/ looks correct, comparing it to https://pypi.python.org/pypi/stem/
#
# * Final release
# |- rm dist/*
# |- Change the setup.py's DRY_RUN flag to false.
# |- python setup.py sdist
# |- gpg --detach-sig --armor dist/stem-1.0.0.tar.gz
# +- twine upload dist/*
#
# * Contact package maintainers
# * Announce the release (example: https://blog.torproject.org/blog/stem-release-11)
2012-11-25 20:11:59 +00:00
2015-05-24 20:18:15 +00:00
import distutils . core
2016-12-05 22:04:52 +00:00
import os
2015-05-24 20:18:15 +00:00
import stem
2012-11-25 20:11:59 +00:00
2016-11-17 18:06:01 +00:00
DRY_RUN = True
SUMMARY = ' Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/). '
2016-12-05 22:04:52 +00:00
DRY_RUN_SUMMARY = ' Ignore this package. This is dry-run release creation to work around PyPI limitations (https://github.com/pypa/packaging-problems/issues/74#issuecomment-260716129). '
2016-11-17 18:06:01 +00:00
DESCRIPTION = """
2016-12-08 18:41:07 +00:00
For tutorials and API documentation see ` Stem ' s homepage <https://stem.torproject.org/>`_.
2016-11-17 18:06:01 +00:00
Quick Start
- - - - - - - - - - -
To install you can either use . . .
: :
pip install stem
2016-12-05 22:04:52 +00:00
2016-11-17 18:06:01 +00:00
. . . or install from the source tarball . Stem supports both the python 2. x and 3. x series . To use its python3 counterpart you simply need to install using that version of python .
: :
python3 setup . py install
After that , give some ` tutorials < https : / / stem . torproject . org / tutorials . html > ` _ a try ! For questions or to discuss project ideas we ' re available on `irc <https://www.torproject.org/about/contact.html.en#irc>`_ and the `tor-dev@ email list <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev>`_.
""" .strip()
2012-11-25 20:11:59 +00:00
2016-12-05 22:10:52 +00:00
MANIFEST = """
include cache_fallback_directories . py
include cache_manual . py
include LICENSE
include MANIFEST . in
include requirements . txt
include run_tests . py
include tox . ini
graft docs
graft test
global - exclude __pycache__
global - exclude * . orig
global - exclude * . pyc
global - exclude * . swp
global - exclude * . swo
global - exclude . tox
2017-01-30 18:44:13 +00:00
global - exclude * ~
2016-12-05 22:10:52 +00:00
recursive - exclude test / data *
recursive - exclude docs / _build *
""" .strip()
2016-12-08 18:41:07 +00:00
# installation requires us to be in our setup.py's directory
2016-12-05 22:04:52 +00:00
os . chdir ( os . path . dirname ( os . path . abspath ( __file__ ) ) )
2016-12-05 22:10:52 +00:00
with open ( ' MANIFEST.in ' , ' w ' ) as manifest_file :
manifest_file . write ( MANIFEST )
try :
distutils . core . setup (
name = ' stem-dry-run ' if DRY_RUN else ' stem ' ,
version = stem . __version__ ,
description = DRY_RUN_SUMMARY if DRY_RUN else SUMMARY ,
long_description = DESCRIPTION ,
license = stem . __license__ ,
author = stem . __author__ ,
author_email = stem . __contact__ ,
url = stem . __url__ ,
packages = [ ' stem ' , ' stem.descriptor ' , ' stem.interpreter ' , ' stem.response ' , ' stem.util ' ] ,
keywords = ' tor onion controller ' ,
scripts = [ ' tor-prompt ' ] ,
2016-12-06 19:00:03 +00:00
package_data = {
2017-08-25 19:44:32 +00:00
' stem ' : [ ' cached_tor_manual.sqlite ' , ' settings.cfg ' ] ,
2016-12-06 19:00:03 +00:00
' stem.descriptor ' : [ ' fallback_directories.cfg ' ] ,
' stem.interpreter ' : [ ' settings.cfg ' ] ,
' stem.util ' : [ ' ports.cfg ' ] ,
} , classifiers = [
2016-12-05 22:10:52 +00:00
' Development Status :: 5 - Production/Stable ' ,
' Intended Audience :: Developers ' ,
' License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3) ' ,
' Topic :: Security ' ,
' Topic :: Software Development :: Libraries :: Python Modules ' ,
] ,
)
finally :
if os . path . exists ( ' MANIFEST.in ' ) :
os . remove ( ' MANIFEST.in ' )
if os . path . exists ( ' MANIFEST ' ) :
os . remove ( ' MANIFEST ' )