aboutsummaryrefslogtreecommitdiffstats
path: root/poetry_restrict_plugin
diff options
context:
space:
mode:
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.")