[issue32419] Add unittest support for pyc projects
Bassem Girgis added the comment: Please let me know what I need to do in order to close this issue and finally merge the code. -- ___ Python tracker <https://bugs.python.org/issue32419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32419] Add unittest support for pyc projects
Bassem Girgis added the comment: I Robert, One use scenario is to run deployment tests for sourceless packages and to ensure the integrity of the production environment. Very useful in container environments! In regards to the looking for the __init__ file, it is obvious that the logic you mentioned is the reason behind that. However, if the unittest code used a standard way to figure out "loadable" packages, whatever that is, it would have captured the fact that python3 can indeed function with all pyc files. I would say the fix in here is a dirty one. A better way to solve it is to call a standard utility which can detect if a package is loadable. This would resolve this issue and help with any future changes in the standard as well. Best regards, Bassem Bassem Girgis, PhD Email: brgir...@gmail.com On Sat, Mar 31, 2018 at 8:52 PM, Robert Collins wrote: > > Robert Collins added the comment: > > Oh, and why look for __init__ - in part, because it predates namespace > packages, but also because unlike regular imports unittest will do negative > things like reading the entire filesystem otherwise. > > -- > > ___ > Python tracker > <https://bugs.python.org/issue32419> > ___ > -- ___ Python tracker <https://bugs.python.org/issue32419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32419] Add unittest support for pyc projects
New submission from Bassem Girgis : This PR makes it possible to "unittest" projects that are all pyc with no __init__.py which is hardcoded in few checks in unittest.loader -- components: Extension Modules messages: 308970 nosy: brgirgis priority: normal pull_requests: 4888 severity: normal status: open title: Add unittest support for pyc projects type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue32419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32419] Add unittest support for pyc projects
Bassem Girgis added the comment: Hi Eric, Yes it is like David said. For the projects you don't distribute the code with the deployment package, you end up distributing only pyc files. As of how to get these files, you can make use of py_compile or compileall modules. For compileall, however, you have to pass the legacy flag to avoid the __pycache__ standard. What I found strange in the unittest code while trying to resolve this issue is that, it is relying on hardcoded searches for __init__.py to find if a module is loadable. I would have imagined that there is a standard why to answer this question. Best regards, Bassem Bassem Girgis, PhD Email: brgir...@gmail.com On Sun, Dec 24, 2017 at 10:53 AM, Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > -- > stage: -> test needed > > ___ > Python tracker > <https://bugs.python.org/issue32419> > ___ > -- ___ Python tracker <https://bugs.python.org/issue32419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com