Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Kartik Mistry
On Sun, Jul 18, 2021 at 2:35 PM Graham Inggs  wrote:
> It looks like you've attached a binary debdiff.   We are looking for a
> source debdiff between the version in testing and unstable.
> i.e.
>
> debdiff apertium-apy_0.11.6-1.dsc apertium-apy_0.11.7-2.dsc

Sorry! Attached source diff now.

-- 
Kartik Mistry | કાર્તિક મિસ્ત્રી
kartikm.wordpress.com
diff -Nru apertium-apy-0.11.6/apertium_apy/apy.py apertium-apy-0.11.7/apertium_apy/apy.py
--- apertium-apy-0.11.6/apertium_apy/apy.py	2020-07-01 13:06:52.0 +0530
+++ apertium-apy-0.11.7/apertium_apy/apy.py	2021-04-01 15:20:33.0 +0530
@@ -1,13 +1,13 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 # coding=utf-8
 # -*- indent-tabs-mode: nil -*-
 
 __author__ = 'Kevin Brubeck Unhammer, Sushain K. Cherivirala'
-__copyright__ = 'Copyright 2013--2018, Kevin Brubeck Unhammer, Sushain K. Cherivirala'
+__copyright__ = 'Copyright 2013--2020, Kevin Brubeck Unhammer, Sushain K. Cherivirala'
 __credits__ = ['Kevin Brubeck Unhammer', 'Sushain K. Cherivirala', 'Jonathan North Washington', 'Xavi Ivars', 'Shardul Chiplunkar']
 __license__ = 'GPLv3'
 __status__ = 'Beta'
-__version__ = '0.11.6'
+__version__ = '0.11.7'
 
 import argparse
 import configparser
@@ -29,6 +29,8 @@
 from tornado.locks import Semaphore
 from tornado.log import enable_pretty_logging
 
+from typing import Sequence, Iterable, Type, List, Tuple, Any  # noqa: F401
+
 from apertium_apy import BYPASS_TOKEN, missing_freqs_db  # noqa: F401
 from apertium_apy import missingdb
 from apertium_apy import systemd
@@ -86,7 +88,7 @@
 
 
 def setup_handler(
-port, pairs_path, nonpairs_path, lang_names, missing_freqs_path, timeout,
+pairs_path, nonpairs_path, lang_names, missing_freqs_path, timeout,
 max_pipes_per_pair, min_pipes_per_pair, max_users_per_pipe, max_idle_secs,
 restart_pipe_after, max_doc_pipes, verbosity=0, scale_mt_logs=False,
 memory=1000, apy_keys=None,
@@ -249,9 +251,9 @@
 
 def setup_application(args):
 if args.stat_period_max_age:
-BaseHandler.STAT_PERIOD_MAX_AGE = timedelta(0, args.stat_period_max_age, 0)
+BaseHandler.stat_period_max_age = timedelta(0, args.stat_period_max_age, 0)
 
-setup_handler(args.port, args.pairs_path, args.nonpairs_path, args.lang_names, args.missing_freqs, args.timeout,
+setup_handler(args.pairs_path, args.nonpairs_path, args.lang_names, args.missing_freqs, args.timeout,
   args.max_pipes_per_pair, args.min_pipes_per_pair, args.max_users_per_pipe, args.max_idle_secs,
   args.restart_pipe_after, args.max_doc_pipes, args.verbosity, args.scalemt_logs,
   args.unknown_memory_limit, args.api_keys)
@@ -274,7 +276,7 @@
 (r'/identifyLang', IdentifyLangHandler),
 (r'/getLocale', GetLocaleHandler),
 (r'/pipedebug', PipeDebugHandler),
-]
+]  # type: List[Tuple[str, Type[tornado.web.RequestHandler]]]
 
 if importlib_util.find_spec('streamparser'):
 handlers.append((r'/speller', SpellerHandler))
@@ -295,7 +297,8 @@
 
 handlers.append((r'/suggest', SuggestionHandler))
 
-return tornado.web.Application(handlers)
+# TODO: fix mypy. Application expects List but List is invariant and we use subclasses
+return tornado.web.Application(handlers)  # type:ignore
 
 
 def setup_logging(args):
@@ -350,10 +353,10 @@
 'certfile': args.ssl_cert,
 'keyfile': args.ssl_key,
 })
-logging.info('Serving at https://localhost:%s', args.port)
+logging.info('Serving on all interfaces/families, e.g. https://localhost:%s', args.port)
 else:
 http_server = tornado.httpserver.HTTPServer(application)
-logging.info('Serving at http://localhost:%s', args.port)
+logging.info('Serving on all interfaces/families, e.g. http://localhost:%s', args.port)
 
 signal.signal(signal.SIGTERM, sig_handler)
 signal.signal(signal.SIGINT, sig_handler)
diff -Nru apertium-apy-0.11.6/apertium_apy/gateway.py apertium-apy-0.11.7/apertium_apy/gateway.py
--- apertium-apy-0.11.6/apertium_apy/gateway.py	2020-07-01 13:06:52.0 +0530
+++ apertium-apy-0.11.7/apertium_apy/gateway.py	2021-04-01 15:20:33.0 +0530
@@ -1,7 +1,6 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 
 import argparse
-import functools
 import itertools
 import json
 import logging
@@ -43,8 +42,7 @@
 def initialize(self, balancer):
 self.balancer = balancer
 
-@tornado.gen.coroutine
-def get(self):
+async def get(self):
 path = self.request.path
 mode, lang_pair, per_word_modes = [None] * 3
 path_to_mode = {
@@ -86,11 +84,12 @@
 logging.info('Redirecting %s?%s to %s%s?%s', path, query, server_port, path, query)
 
 http = tornado.httpclient.AsyncHTTPClient()
-http.fetch(
+response = await http.fetch(
 server_port + path + '?' + query,
-functools.partial(self._on_download, (server, port), lang_pair),
+   

Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Graham Inggs
Hi Kartik

On Sun, 18 Jul 2021 at 10:48, Kartik Mistry  wrote:
>  [x] attach debdiff against the package in testing

It looks like you've attached a binary debdiff.   We are looking for a
source debdiff between the version in testing and unstable.
i.e.

debdiff apertium-apy_0.11.6-1.dsc apertium-apy_0.11.7-2.dsc

Regards
Graham



Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Kartik Mistry
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: kar...@debian.org

Please unblock package apertium-apy

apertium-apy version 0.11.6-1 is broken due incompatibility with
Python-tornado in testing and fails to start (See: RC Bug:
https://bugs.debian.org/990917). I had uploaded 0.11.7-1 to
experimental in April too.

[ Reason ]
0.11.7-2 fixes issue reported in #990917 and unbreaks apertium-apy.

[ Impact ]
apertium-apy is heavily used by users who are using Apertium Machine
Translation system in Production (use case: Wikipedia) and updating to
the next stable release (Bullseye) will break the current working
system.

[ Tests ]
Upstream has added a few tests, but not particularly this bug, AFAIK.
I've tested both versions and 0.11.7-2 is working fine.

[ Risks ]
Not anything I'm aware of.

[ Checklist ]
 [x] all changes are documented in the d/changelog
 [x] I reviewed all changes and I approve them
 [x] attach debdiff against the package in testing

unblock apertium-apy/0.11.7-2

-- 
Kartik Mistry | કાર્તિક મિસ્ત્રી
kartikm.wordpress.com


apertium-apy.debdiff
Description: Binary data


Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Kartik Mistry
On Sun, Jul 18, 2021 at 1:29 PM Graham Inggs  wrote:
> Control: tags -1 + moreinfo
>
> Hi Kartik
>
> Please see the 'Appropriate changes during Hard and Full Freeze'
> section and the 'Applying for an unblock' section below that in the
> Bullseye Freeze Policy [1].  It is recommended that you use (a recent
> version of) reportbug to file the unblock bug, this will give you a
> nice template with a checklist of information to include.  You can run
> reportbug with -o to output to a file instead of sending email, which
> you can then add to this bug.
>
> [1] https://release.debian.org/bullseye/freeze_policy.html#appropriate

Thanks Graham!

I'll send a followup update.

-- 
Kartik Mistry | કાર્તિક મિસ્ત્રી
kartikm.wordpress.com



Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Graham Inggs
Control: tags -1 + moreinfo

Hi Kartik

On Sun, 18 Jul 2021 at 08:33, Kartik Mistry  wrote:
> Please unblock apertium-apy (0.11.7-2) which will fix #990917
>
> Let me know if any additional information is needed.

Please see the 'Appropriate changes during Hard and Full Freeze'
section and the 'Applying for an unblock' section below that in the
Bullseye Freeze Policy [1].  It is recommended that you use (a recent
version of) reportbug to file the unblock bug, this will give you a
nice template with a checklist of information to include.  You can run
reportbug with -o to output to a file instead of sending email, which
you can then add to this bug.

Regards
Graham


[1] https://release.debian.org/bullseye/freeze_policy.html#appropriate



Bug#991233: unblock: apertium-apy/0.11.7-2

2021-07-18 Thread Kartik Mistry
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock

Please unblock apertium-apy (0.11.7-2) which will fix #990917

Let me know if any additional information is needed.

unblock apertium-apy/0.11.7-2

-- 
Kartik Mistry | કાર્તિક મિસ્ત્રી
kartikm.wordpress.com