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

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

Closed
hasii2011 opened this issue Mar 2, 2022 · 2 comments
Closed

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

hasii2011 opened this issue Mar 2, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hasii2011
Copy link
Owner

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 hasii2011 added the enhancement New feature or request label Mar 2, 2022
@hasii2011 hasii2011 added this to the Version 6.5.4 milestone Mar 2, 2022
@hasii2011 hasii2011 self-assigned this Mar 2, 2022
@hasii2011
Copy link
Owner Author

hasii2011 commented Mar 8, 2022

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

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

ronaldoussoren/py2app#410

@MAKOMO
@ronaldoussoren

I'll delay this for a while

hasii2011 added a commit that referenced this issue Mar 8, 2022
[See the issue for problems;  Not yet working]

[#327]
@hasii2011 hasii2011 changed the title Turn assertions off when we build Pyut.app Turn assertions off when we build Pyut.app ⚡ Mar 15, 2022
@hasii2011
Copy link
Owner Author

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

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

No branches or pull requests

1 participant