Skip to content

Commit cc9b172

Browse files
committed
fix: handle no pyproject case for user module
1 parent fdc4ee0 commit cc9b172

File tree

4 files changed

+1243
-11
lines changed

4 files changed

+1243
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
A lightweight, open-source tool for Python code obfuscation. CodeEnigma helps protect your logic from reverse engineering and unauthorized access, making it secure to distribute your Python applications.
1111

1212
## 🔒 Why CodeEnigma?
13-
After searching extensively for a free and open-source Python obfuscation tool, I realized that most available options were either paid, closed-source, or opaque in how they worked. I wasn't comfortable letting a black-box tool encrypt my production code without knowing exactly what it was doing — especially when it had access to sensitive logic.
13+
After searching extensively for a free and open-source Python obfuscation tool, I realized that most available options were either paid, closed-source, or opaque in how they worked. I wasn't comfortable letting a black-box tool obfuscate my production code without knowing exactly what it was doing — especially when it had access to sensitive logic.
1414

1515
So I built **CodeEnigma** — a transparent, self-contained solution that gives you full control over the obfuscation process, with no hidden logic and no external servers involved.
1616

codeenigma/orchestrator.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ def run_obfuscation(self):
9191

9292
def build_obfuscated_wheel(self):
9393
"""Builds the obfuscated wheel for the module"""
94+
if not (self.module_path.parent / "pyproject.toml").exists():
95+
rich.print("[yellow]Skipping obfuscated wheel build, since no pyproject.toml found in the module. Hence can't build obfuscated module into wheel. Consider creating a pyproject.toml file in the module directory. Refer pep621 or poetry for more details.[/yellow]")
96+
rich.print(f"[white]You can build the wheel manually later too. You can find the obfuscated module in the {self.output_dir} directory.[/white]")
97+
return 0
98+
9499
shutil.copy(
95100
self.module_path.parent / "pyproject.toml",
96101
self.output_dir / "pyproject.toml",
@@ -126,3 +131,5 @@ def run(self):
126131

127132
# Cleanup
128133
shutil.rmtree(self.output_dir / "dist", ignore_errors=True)
134+
135+
rich.print("[green]✓ Obfuscation completed successfully[/green]")

0 commit comments

Comments
 (0)