[arch-commits] Commit in monkeytype/repos (3 files)

Felix Yan felixonmars at archlinux.org
Fri Nov 20 21:57:45 UTC 2020


    Date: Friday, November 20, 2020 @ 21:57:45
  Author: felixonmars
Revision: 758155

archrelease: copy trunk to community-staging-any

Added:
  monkeytype/repos/community-staging-any/
  monkeytype/repos/community-staging-any/PKGBUILD
    (from rev 758154, monkeytype/trunk/PKGBUILD)
  monkeytype/repos/community-staging-any/py3.9.patch
    (from rev 758154, monkeytype/trunk/py3.9.patch)

-------------+
 PKGBUILD    |   45 +++++++++++++++++++++++++++++++++++++++++++++
 py3.9.patch |   31 +++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

Copied: monkeytype/repos/community-staging-any/PKGBUILD (from rev 758154, monkeytype/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2020-11-20 21:57:45 UTC (rev 758155)
@@ -0,0 +1,45 @@
+# Maintainer: Filipe Laíns (FFY00) <lains at archlinux.org>
+
+_pkgname=MonkeyType
+pkgname=monkeytype
+pkgver=20.5.0
+pkgrel=2
+pkgdesc='A system for Python that generates static type annotations by collecting runtime types'
+arch=('any')
+url='https://github.com/instagram/MonkeyType'
+license=('BSD')
+depends=('python-mypy_extensions' 'python-libcst')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest-runner' 'python-pytest-cov' 'python-django')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
+        py3.9.patch)
+sha512sums=('1fd0eb9bd83e7f27de5b7e75d06a89d851220b165d8becd7bac75c196361315669142c5f8838e85696e5dceaeaae6b64b71e3e46010546c65fa4f9d9b62f55d2'
+            '81b37bf0ca06a65d10aa5efe7da200564b234247eb63c619a2ad3243ad243f9aebeaf244dfd69c4032341c47febd12e03c8ac5b4fe8dedf21492600c874ac4d3')
+
+prepare() {
+  cd $_pkgname-$pkgver
+
+  patch -p1 -i ../py3.9.patch
+}
+
+build() {
+  cd $_pkgname-$pkgver
+
+  python setup.py build
+}
+
+check() {
+  cd $_pkgname-$pkgver
+
+  python setup.py pytest
+}
+
+package() {
+  cd $_pkgname-$pkgver
+
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+
+  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$_pkgname/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:

Copied: monkeytype/repos/community-staging-any/py3.9.patch (from rev 758154, monkeytype/trunk/py3.9.patch)
===================================================================
--- community-staging-any/py3.9.patch	                        (rev 0)
+++ community-staging-any/py3.9.patch	2020-11-20 21:57:45 UTC (rev 758155)
@@ -0,0 +1,31 @@
+commit 6a60845958efffcec987ed1c6ce90e74cf7c8456
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Sat Nov 21 05:50:14 2020 +0800
+
+    Fix compatibility with Python 3.9
+    
+    Fixes #205, all tests are passing here.
+
+diff --git a/monkeytype/compat.py b/monkeytype/compat.py
+index 01d5007..111d28e 100644
+--- a/monkeytype/compat.py
++++ b/monkeytype/compat.py
+@@ -22,8 +22,16 @@ try:
+     def is_union(typ: Any) -> bool:
+         return typ is Union or is_generic(typ) and typ.__origin__ is Union
+ 
+-    def is_generic(typ: Any) -> bool:
+-        return typ is Union or isinstance(typ, _GenericAlias)
++    try:
++        # Python 3.9
++        from typing import _SpecialGenericAlias
++
++        def is_generic(typ: Any) -> bool:
++            return typ is Union or isinstance(typ, _GenericAlias) or isinstance(typ, _SpecialGenericAlias)
++
++    except ImportError:
++        def is_generic(typ: Any) -> bool:
++            return typ is Union or isinstance(typ, _GenericAlias)
+ 
+     def is_generic_of(typ: Any, gen: Any) -> bool:
+         return is_generic(typ) and typ.__origin__ is gen.__origin__



More information about the arch-commits mailing list