diff options
author | 2024-07-28 13:29:59 +0200 | |
---|---|---|
committer | 2024-07-28 13:29:59 +0200 | |
commit | 271b36bf1c1493dc09a1e05d7caf66f740d298dc (patch) | |
tree | e20b59023a816a9afa688dc745f884fd93f73728 /poetry_restrict_plugin | |
parent | Develop on alpha 3 (diff) |
Add escape hatch via POETRY_NO_RESTRICT=1
Diffstat (limited to 'poetry_restrict_plugin')
-rw-r--r-- | poetry_restrict_plugin/plugin.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/poetry_restrict_plugin/plugin.py b/poetry_restrict_plugin/plugin.py index 4c59bbc..652f7a2 100644 --- a/poetry_restrict_plugin/plugin.py +++ b/poetry_restrict_plugin/plugin.py @@ -92,6 +92,13 @@ class RestrictPlugin(Plugin): ruleset.apply() def activate(self, poetry: Poetry, io: IO): + if os.getenv("POETRY_NO_RESTRICT") == "1": + io.write_line( + "<info>poetry-restrict-plugin</info>: " + "<comment>Disabled via POETRY_NO_RESTRICT environment variable!</comment>" + ) + return + try: self.landlock(poetry) io.write_line("<info>poetry-restrict-plugin</info>: Landlock engaged.") |