Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/dev_setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$ErrorActionPreference = "Stop"

python -m venv .venv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

On Windows, using the Python launcher py -3 is a more robust way to ensure you're using a Python 3 interpreter, as python could point to an older version or a Microsoft Store stub. This helps prevent potential environment setup issues.

py -3 -m venv .venv

.\.venv\Scripts\Activate.ps1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Venv Activation Not Sticking

The virtual environment activation won't affect subsequent commands in the script. Calling Activate.ps1 directly runs it in a child scope, so the PATH modifications don't persist. This causes python and pip commands on lines 5 and 8 to use the system Python instead of the virtual environment, defeating the purpose of creating the venv.

Fix in Cursor Fix in Web

python -m pip install --upgrade pip

if (Test-Path "requirements.txt") {
pip install -r requirements.txt
}
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The script currently only installs dependencies from requirements.txt. The repository also contains openspp-requirements.txt, which seems to be the primary file for a full development setup as it includes other requirement files. To make the setup script more comprehensive, it would be better to prioritize openspp-requirements.txt if it exists.

if (Test-Path "openspp-requirements.txt") {
  pip install -r openspp-requirements.txt
} elseif (Test-Path "requirements.txt") {
  pip install -r requirements.txt
}


Write-Host "✅ Environment Ready"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The script successfully prepares the environment, but the virtual environment activation doesn't persist in the user's shell after the script finishes. It would be helpful to add a message instructing the user on how to activate it manually for their development work.

Write-Host "✅ Environment Ready"
Write-Host "Now activate the virtual environment by running: .\.venv\Scripts\Activate.ps1"

13 changes: 13 additions & 0 deletions scripts/dev_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
Comment on lines +8 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The script currently only installs dependencies from requirements.txt. The repository also contains openspp-requirements.txt, which seems to be the primary file for a full development setup as it includes other requirement files. To make the setup script more comprehensive, it would be better to prioritize openspp-requirements.txt if it exists.

Suggested change
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
if [ -f "openspp-requirements.txt" ]; then
pip install -r openspp-requirements.txt
elif [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi


echo "✅ Environment Ready"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

After the script runs, the user needs to activate the virtual environment to use the installed packages. It would be helpful to explicitly state this as the next step.

Suggested change
echo "✅ Environment Ready"
echo "✅ Environment Ready"
echo "Run 'source .venv/bin/activate' to activate the virtual environment."

echo "Now create Postgres DB and run Odoo with addons-path pointing to this repo."
Loading