#1 make it build on python 3.7
Merged 5 years ago by churchyard. Opened 5 years ago by maha.
rpms/ maha/python-stem master  into  master

make it build on python 3.7
Marcel Haerry • 5 years ago  
@@ -0,0 +1,40 @@ 

+ From 6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a Mon Sep 17 00:00:00 2001

+ From: Damian Johnson <atagar@torproject.org>

+ Date: Wed, 11 Jul 2018 09:05:32 -0700

+ Subject: 'async' SyntaxError with python 3.6 and above

+ 

+ Python 3.6 adds a couple new keywords to the language (async and await) so we

+ need to be careful not to use those. 99.9% of our users don't import our test

+ utils so this was mostly moot, but Juan ran into an issue packaging Stem for

+ Fedora...

+ 

+   BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/stem/util/test_tools.py", line 151

+   BUILDSTDERR:     self.method.async = self

+   BUILDSTDERR:                     ^

+   BUILDSTDERR: SyntaxError: invalid syntax

+ 

+   https://trac.torproject.org/projects/tor/ticket/26739

+ 

+ This line aimed to provide a way for tests to reference its AsyncTest instance.

+ This doesn't look to actually be used in practice so think we can simply drop

+ it. Checked with grep and a 'run_tests.py --all --target ONLINE' run.

+ ---

+  docs/change_log.rst     | 1 +

+  stem/util/test_tools.py | 1 -

+  2 files changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py

+ index 722398d..c757320 100644

+ --- a/stem/util/test_tools.py

+ +++ b/stem/util/test_tools.py

+ @@ -148,7 +148,6 @@ class AsyncTest(object):

+      self._threaded = threaded

+  

+      self.method = lambda test: self.result(test)  # method that can be mixed into TestCases

+ -    self.method.async = self

+  

+      self._process = None

+      self._process_pipe = None

+ -- 

+ cgit v1.1

+ 

file modified
+7 -2
@@ -9,7 +9,7 @@ 

  

  Name:           python-stem

  Version:        1.6.0

- Release:        4%{?dist}

+ Release:        5%{?dist}

  Summary:        Python controller library for Tor

  # All source code is LGPLv3 except stem/util/ordereddict.py which is MIT

  License:        LGPLv3 and MIT
@@ -17,6 +17,8 @@ 

  Source0:        https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz

  # https://www.torproject.org/docs/signing-keys.html.en

  Source1:        https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz.asc

+ # adapted from https://gitweb.torproject.org/stem.git/patch/?id=6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a

+ Patch0:         python-3.7-6c677b6a4080d14a56d2d88ab2ddd9766cc60b9a.patch

  

  BuildArch:      noarch

  BuildRequires:  python2-devel
@@ -56,7 +58,7 @@ 

  %description doc %_description

  

  %prep

- %autosetup -n %{srcname}-%{version}

+ %autosetup -p1 -n %{srcname}-%{version}

  

  %build

  %py2_build
@@ -96,6 +98,9 @@ 

  %{_mandir}/man1/%{srcname}.1*

  

  %changelog

+ * Tue Jul 17 2018 mh <mh+fedora@scrit.ch> - 1.6.0-5

+ - Make it build on python 3.7

+ 

  * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-4

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

  

no initial comment

If you add the patch to git instead of lookaside cache, I'll merge.

rebased onto 7bbfdb5

5 years ago

Pushed version with patch in git

Pull-Request has been merged by churchyard

5 years ago