mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-04-05 08:53:57 -04:00
Fixed dotpath venv guessing
This commit is contained in:
committed by
Martin Donath
parent
88bdcf5f16
commit
6d4f756461
@@ -204,15 +204,16 @@ class InfoPlugin(BasePlugin[InfoConfig]):
|
|||||||
# Guess other Virtual Environment paths in case we forget to activate
|
# Guess other Virtual Environment paths in case we forget to activate
|
||||||
# them or in case we have multiple. Making sure which venv is activated
|
# them or in case we have multiple. Making sure which venv is activated
|
||||||
# is not necessary, as it is an optional step in the guidelines.
|
# is not necessary, as it is an optional step in the guidelines.
|
||||||
for path in glob.iglob(
|
for abs_root, dirnames, filenames in os.walk(os.getcwd()):
|
||||||
pathname = "**/pyvenv.cfg",
|
for filename in filenames:
|
||||||
root_dir = os.getcwd(),
|
if filename.lower() != "pyvenv.cfg":
|
||||||
recursive = True
|
continue
|
||||||
):
|
|
||||||
path = os.path.join(os.getcwd(), os.path.dirname(path))
|
path = abs_root[0].upper() + abs_root[1:]
|
||||||
if path not in site.PREFIXES:
|
|
||||||
print(f"Possible inactive venv: {path}")
|
if path not in site.PREFIXES:
|
||||||
self.exclusion_patterns.append(_resolve_pattern(path))
|
print(f"Possible inactive venv: {path}")
|
||||||
|
self.exclusion_patterns.append(_resolve_pattern(path))
|
||||||
|
|
||||||
# Exclude site_dir for projects
|
# Exclude site_dir for projects
|
||||||
if projects_plugin:
|
if projects_plugin:
|
||||||
|
|||||||
@@ -204,15 +204,16 @@ class InfoPlugin(BasePlugin[InfoConfig]):
|
|||||||
# Guess other Virtual Environment paths in case we forget to activate
|
# Guess other Virtual Environment paths in case we forget to activate
|
||||||
# them or in case we have multiple. Making sure which venv is activated
|
# them or in case we have multiple. Making sure which venv is activated
|
||||||
# is not necessary, as it is an optional step in the guidelines.
|
# is not necessary, as it is an optional step in the guidelines.
|
||||||
for path in glob.iglob(
|
for abs_root, dirnames, filenames in os.walk(os.getcwd()):
|
||||||
pathname = "**/pyvenv.cfg",
|
for filename in filenames:
|
||||||
root_dir = os.getcwd(),
|
if filename.lower() != "pyvenv.cfg":
|
||||||
recursive = True
|
continue
|
||||||
):
|
|
||||||
path = os.path.join(os.getcwd(), os.path.dirname(path))
|
path = abs_root[0].upper() + abs_root[1:]
|
||||||
if path not in site.PREFIXES:
|
|
||||||
print(f"Possible inactive venv: {path}")
|
if path not in site.PREFIXES:
|
||||||
self.exclusion_patterns.append(_resolve_pattern(path))
|
print(f"Possible inactive venv: {path}")
|
||||||
|
self.exclusion_patterns.append(_resolve_pattern(path))
|
||||||
|
|
||||||
# Exclude site_dir for projects
|
# Exclude site_dir for projects
|
||||||
if projects_plugin:
|
if projects_plugin:
|
||||||
|
|||||||
Reference in New Issue
Block a user