Skip to content

Commit

Permalink
modified some lines to work on all operating systems, also with poetr…
Browse files Browse the repository at this point in the history
…y or venv
  • Loading branch information
MohamedNasser8 committed Aug 20, 2024
1 parent e670bfa commit 8762cef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
import subprocess
import sys
import venv

Expand Down Expand Up @@ -40,7 +41,12 @@ def create_venv():
venv_dir = os.path.join(os.getcwd(), ".venv")
if not os.path.exists(venv_dir):
logging.info("Creating virtual environment...")
os.system("py -3 -m venv .venv")
try:
python_executable = "python3" if sys.platform != "win32" else "python"
subprocess.check_call([python_executable, "-m", "venv", venv_dir])
logging.info("Virtual environment created successfully.")
except subprocess.CalledProcessError as e:
logging.error(f"Failed to create virtual environment: {e}")
else:
logging.info("Virtual environment already exists.")

Expand Down
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ theme:

plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
paths: ["src"]
- gallery:
examples_dirs: docs/examples
gallery_dirs: docs/generated/gallery
Expand Down

0 comments on commit 8762cef

Please sign in to comment.