aboutsummaryrefslogtreecommitdiffstats
path: root/poetry_restrict_plugin
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-07-28 13:29:59 +0200
committerGravatar Johannes Christ <[email protected]>2024-07-28 13:29:59 +0200
commit271b36bf1c1493dc09a1e05d7caf66f740d298dc (patch)
treee20b59023a816a9afa688dc745f884fd93f73728 /poetry_restrict_plugin
parentDevelop 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.py7
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.")