indygreg / indygreg/PyOxidizer
Expose Python -O/-OO options optimization settings during build
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 256
- PR merge metrics
- No merged PRs in 30d
Description
One way to remove sensitive or proprietary information from Python source code is to use `-OO` when compiling `.pyc` files. Since docstrings normally don't affect runtime execution, having this option exposed when building with PyOxidizer would allow a user to strip these strings out of their delivered binary.
This also helps reduce the final size of the binary (#220).
The removing of sensitive information portion of this features relate to #265.
The equivalent CPython command would look like:
```bash
$ python3 -OO -m compileall -b main.py
# Creates main.pyc file without docstrings or assert statements.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing PyOxidizer's build path for Python bytecode and how it could expose compiler optimization settings; the issue names no file or test. Compare behavior with the shown `python3 -OO -m compileall -b main.py` command. Done means builds can select the documented optimization behavior, including removal of docstrings and assert statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100