hasii2011 / pyut

A UML Diagrammer implemented in Python
GNU Affero General Public License v3.0
11 stars 4 forks source link

Turn assertions off when we build Pyut.app ⚡ #327

Closed hasii2011 closed 2 years ago

hasii2011 commented 2 years ago

Now, how can you actually disable your assertions? Well, you have two options:

  1. Run Python with the -O or -OO options.
  2. Set the PYTHONOPTIMIZE environment variable to an appropriate value.

The -O option internally sets debug to False. This change removes the assert statements and any code that you’ve explicitly introduced under a conditional targeting debug. The -OO option does the same as -O and also discards docstrings.

hasii2011 commented 2 years ago

Setting PYTHONOPTIMIZE in .plist has no effect. It is not set.

Specifying --optimize=1 or -O1 on the py2app command line causes this error:

https://github.com/ronaldoussoren/py2app/pull/410

@MAKOMO @ronaldoussoren

I'll delay this for a while

hasii2011 commented 2 years ago

py2app 0.28 fixes this for me thanks @MAKOMO and @ronaldoussoren