Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v0.4.1 PyPI release doesn't work (PyPI package differs to Github files) #163

Closed
ajoubertza opened this issue Jan 11, 2019 · 5 comments
Closed

Comments

@ajoubertza
Copy link

Thanks for releasing v0.4.1 so quickly. Unfortunately the package installed from PyPI has a new error when importing. At least on Python 3.5.6 I haven't tried newer versions.

(venvp3) a@b:~/venvp3$ pip list
Package        Version
-------------- -------
aioconsole     0.1.11 
aiomonitor     0.4.1  
pip            18.1   
setuptools     40.6.3 
terminaltables 3.1.0  
wheel          0.32.3 

(venvp3) a@b:~/venvp3$ python
Python 3.5.6 (default, Aug  4 2018, 00:00:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiomonitor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/a/venvp3/lib/python3.5/site-packages/aiomonitor/__init__.py", line 23, in <module>
    from .monitor import (Monitor, start_monitor,
  File "/home/a/venvp3/lib/python3.5/site-packages/aiomonitor/monitor.py", line 20, in <module>
    from .utils import (_format_stack, cancel_task, task_by_id, console_proxy,
  File "/home/a/venvp3/lib/python3.5/site-packages/aiomonitor/utils.py", line 18, in <module>
    def _get_stack(task: asyncio.Task[Any]) -> List[Any]:
TypeError: 'type' object is not subscriptable
>>> 

The code giving the error doesn't exist in the file on Github. Somehow the code on PyPI differs:

a@b:~/tmp$ curl https://files.pythonhosted.org/packages/fe/df/3e01a3683c407edfb6659b0ff9bb9745403609f466861bea246a7962ba5b/aiomonitor-0.4.1.tar.gz -o aiomonitor-0.4.1.tar.gz
a@b:~/tmp$ tar zxvf aiomonitor-0.4.1.tar.gz 
x aiomonitor-0.4.1/
x aiomonitor-0.4.1/CHANGES.txt
x aiomonitor-0.4.1/LICENSE
x aiomonitor-0.4.1/MANIFEST.in
x aiomonitor-0.4.1/PKG-INFO
x aiomonitor-0.4.1/README.rst
x aiomonitor-0.4.1/aiomonitor/
x aiomonitor-0.4.1/aiomonitor/__init__.py
x aiomonitor-0.4.1/aiomonitor/cli.py
x aiomonitor-0.4.1/aiomonitor/monitor.py
x aiomonitor-0.4.1/aiomonitor/mypy_types.py
x aiomonitor-0.4.1/aiomonitor/utils.py
x aiomonitor-0.4.1/aiomonitor.egg-info/
x aiomonitor-0.4.1/aiomonitor.egg-info/PKG-INFO
x aiomonitor-0.4.1/aiomonitor.egg-info/SOURCES.txt
x aiomonitor-0.4.1/aiomonitor.egg-info/dependency_links.txt
x aiomonitor-0.4.1/aiomonitor.egg-info/requires.txt
x aiomonitor-0.4.1/aiomonitor.egg-info/top_level.txt
x aiomonitor-0.4.1/setup.cfg
x aiomonitor-0.4.1/setup.py

a@b:~/tmp$ git clone git@github.com:aio-libs/aiomonitor.git aiomonitor-clone
Cloning into 'aiomonitor-clone'...
remote: Enumerating objects: 44, done.
remote: Counting objects: 100% (44/44), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 979 (delta 22), reused 15 (delta 8), pack-reused 935
Receiving objects: 100% (979/979), 1.28 MiB | 536.00 KiB/s, done.
Resolving deltas: 100% (538/538), done.
Checking connectivity... done.
a@b:~/tmp/aiomonitor-clone$ git checkout v0.4.1
Note: checking out 'v0.4.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at fa47d78... bump version

a@b:~/tmp/aiomonitor-clone$ cd ..
a@b:~/tmp$ git diff aiomonitor-0.4.1/aiomonitor aiomonitor-clone/aiomonitor
diff --git a/aiomonitor-0.4.1/aiomonitor/utils.py b/aiomonitor-clone/aiomonitor/utils.py
index 2aea5da..e37b169 100644
--- a/aiomonitor-0.4.1/aiomonitor/utils.py
+++ b/aiomonitor-clone/aiomonitor/utils.py
@@ -15,7 +15,7 @@ from .mypy_types import Loop, OptLocals
 Server = asyncio.AbstractServer  # noqa
 
 
-def _get_stack(task: asyncio.Task[Any]) -> List[Any]:
+def _get_stack(task: asyncio.Task) -> List[Any]:
     frames = []  # type: List[Any]
     coro = task._coro  # type: ignore
     while coro:
@@ -28,7 +28,7 @@ def _get_stack(task: asyncio.Task[Any]) -> List[Any]:
     return frames
 
 
-def _format_stack(task: asyncio.Task[Any]) -> str:
+def _format_stack(task: asyncio.Task) -> str:
     extracted_list = []
     checked = set()  # type: Set[str]
     for f in _get_stack(task):
@@ -49,12 +49,12 @@ def _format_stack(task: asyncio.Task[Any]) -> str:
     return resp
 
 
-def task_by_id(taskid: int, loop: Loop) -> Optional[asyncio.Task[Any]]:
+def task_by_id(taskid: int, loop: Loop) -> Optional[asyncio.Task]:
     tasks = asyncio.Task.all_tasks(loop=loop)
     return next(filter(lambda t: id(t) == taskid, tasks), None)
 
 
-async def cancel_task(task: asyncio.Task[Any]) -> None:
+async def cancel_task(task: asyncio.Task) -> None:
     with contextlib.suppress(asyncio.CancelledError):
         task.cancel()
         await task
@notmeta
Copy link

notmeta commented Jan 11, 2019

TypeError: 'type' object is not subscriptable
Can confirm this happens to me on Python 3.7.2 too!

@ajoubertza ajoubertza changed the title v0.4.1 doesn't work on Python 3.5 (PyPI package differs to Github files) v0.4.1 PyPI release doesn't work (PyPI package differs to Github files) Jan 11, 2019
@jettify
Copy link
Member

jettify commented Jan 11, 2019

Thanks for report, will fix that soon, once back home.

@jettify
Copy link
Member

jettify commented Jan 12, 2019

New version https://pypi.org/project/aiomonitor/0.4.2/

@jettify
Copy link
Member

jettify commented Jan 12, 2019

I added automated github/travis deployment process, should fix issue with difference between github and pypi files.

@ajoubertza
Copy link
Author

Thanks @jettify - new version is working for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants