Skip to content

Commit

Permalink
Merge 1d0e19a into 9466f03
Browse files Browse the repository at this point in the history
  • Loading branch information
meejah committed Mar 27, 2019
2 parents 9466f03 + 1d0e19a commit ce719df
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@




.. _NOTE: see docs/index.rst for the starting-point
.. _ALSO: https://txtorcon.readthedocs.org for rendered docs

Expand Down
27 changes: 27 additions & 0 deletions scripts/check_release_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
import sys
import subprocess
from os.path import join


def main():
"""
This does checks on the release metadata for PyPI and pip-licenses:
"""

subprocess.run(
[sys.executable, "setup.py", "bdist_wheel"],
check=True,
)
print(os.listdir("."))
import txtorcon
dist_file = join("dist", "txtorcon-{}-py2.py3-none-any.whl".format(txtorcon.__version__))
print("dist: {}".format(dist_file))
subprocess.run(
[sys.executable, "-m", "twine", "check", dist_file],
check=True,
)


if __name__ == "__main__":
main()
39 changes: 24 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
from os.path import join
from os import listdir
from setuptools import setup
import re

# Hmmmph.
# So we get all the meta-information in one place (yay!) but we call
# exec to get it (boo!). Note that we can't "from txtorcon._metadata
# import *" here because that won't work when setup is being run by
# pip (outside of Git checkout etc)
with open('txtorcon/_metadata.py') as f:
exec(
compile(f.read(), '_metadata.py', 'exec'),
globals(),
locals(),
)
version_string = f.read().strip()
match = re.match("__version__ = '([0-9.]*)'", version_string)
version = match.group(1)

description = '''
Twisted-based Tor controller client, with state-tracking and
configuration abstractions.
https://txtorcon.readthedocs.org
https://github.com/meejah/txtorcon
https://meejah.ca/projects/txtorcon
'''

sphinx_rst_files = [x for x in listdir('docs') if x[-3:] == 'rst']
Expand All @@ -33,11 +33,21 @@

setup(
name='txtorcon',
version=__version__,
version=version,
description=description,
setup_requires="setuptools>=36.2",
long_description=open('README.rst', 'r').read(),
long_description_content_type="text/x-rst",
keywords=['python', 'twisted', 'tor', 'tor controller'],
author='meejah',
author_email='meejah@meejah.ca',
url='https://meejah.ca/projects/txtorcon',
license='MIT',
packages=[
"txtorcon",
"twisted.plugins",
],

install_requires=open('requirements.txt').readlines(),
# "pip install -e .[dev]" will install development requirements
extras_require=dict(
Expand All @@ -61,22 +71,21 @@
'Topic :: Internet',
'Topic :: Security',
],
author=__author__,
author_email=__contact__,
url=__url__,
license=__license__,
packages=[
"txtorcon",
"twisted.plugins",
],

# I'm a little unclear if I'm doing this "properly", especially
# the documentation etc. Do we really want "share/txtorcon" for
# the first member of the tuple? Why does it seem I need to
# duplicate this in MANIFEST.in?

data_files=[
('share/txtorcon', ['INSTALL', 'README.rst', 'TODO', 'meejah.asc']),
('share/txtorcon', [
'INSTALL',
'LICENSE',
'README.rst',
'TODO',
'meejah.asc',
'setup.py',
]),

# this includes the Sphinx source for the
# docs. The "map+filter" construct grabs all .rst
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ commands=
basepython=python3
deps=
readme_renderer
twine

commands=
python setup.py check -r -s
#python setup.py check -r -s
python scripts/check_release_metadata.py
9 changes: 7 additions & 2 deletions txtorcon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
from __future__ import unicode_literals
from __future__ import with_statement

from txtorcon._metadata import __version__, __author__, __contact__
from txtorcon._metadata import __license__, __copyright__, __url__
from txtorcon._metadata import __version__
# not sure if we really need this stuff, but we "used" to have it ... so
__author__ = 'meejah'
__contact__ = 'meejah@meejah.ca'
__license__ = 'MIT'
__copyright__ = 'Copyright 2012-2019'
__url__ = 'https://github.com/meejah/txtorcon'

from txtorcon.router import Router
from txtorcon.circuit import Circuit
Expand Down
7 changes: 1 addition & 6 deletions txtorcon/_metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
__version__ = '19.0.0'
__author__ = 'meejah'
__contact__ = 'meejah@meejah.ca'
__url__ = 'https://github.com/meejah/txtorcon'
__license__ = 'MIT'
__copyright__ = 'Copyright 2012-2019'
__version__ = '19.1.0'

0 comments on commit ce719df

Please sign in to comment.