Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot install psutil with PYTHONOPTIMIZE=2 #948

Closed
yajo opened this issue Jan 4, 2017 · 0 comments
Closed

Cannot install psutil with PYTHONOPTIMIZE=2 #948

yajo opened this issue Jan 4, 2017 · 0 comments
Labels

Comments

@yajo
Copy link

yajo commented Jan 4, 2017

Steps to reproduce:

$ docker run -e PYTHONOPTIMIZE=2 -it --rm python:2-alpine pip install psutil
Collecting psutil
  Downloading psutil-5.0.1.tar.gz (326kB)
    100% |████████████████████████████████| 327kB 1.1MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-UayZX7/psutil/setup.py", line 322, in <module>
        main()
      File "/tmp/pip-build-UayZX7/psutil/setup.py", line 258, in main
        description=__doc__.replace('\n', '').strip(),
    AttributeError: 'NoneType' object has no attribute 'replace'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-UayZX7/psutil/

When using PYTHONOPTIMIZE=2, __doc__ are removed from the generated *.pyo files, assuming that in a production deployment you never need the docstrings.

Could you please use an alternative method to get that docstring and make it work with maximum optimization?

Thanks!

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

No branches or pull requests

2 participants