Skip to content

Commit

Permalink
fix library
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Feb 2, 2026
1 parent 40f8c9d commit e15f60e
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

THIS=$(basename $0 .sh)
VERSION="1.0.6"
VERSION="1.0.7"

# --- Configuration ---
APP_DIR="${1:-/apps/ansible}"
Expand Down Expand Up @@ -34,6 +34,7 @@ then
umask $UMASK
fi
cd "$APP_DIR"
chmod 755 "$APP_DIR"
# chown $OWNER:$GROUP "$APP_DIR"

# 2. Initialize project
Expand Down Expand Up @@ -64,6 +65,16 @@ EOF
# 4. Create the Venv with Hard Copies
uv venv .venv --python "$PYTHON_VERSION" --seed --link-mode copy

# 4.1. The "Encodings" Fix: Ensure pyvenv.cfg is correct
# We need to tell Python that the 'home' is the venv bin directory
cat <<EOF > .venv/pyvenv.cfg
home = $APP_DIR/.venv/bin
include-system-site-packages = false
version = $PYTHON_VERSION
executable = $APP_DIR/.venv/bin/python
command = $UV_MANAGED_DIR/bin/uv venv .venv --python $PYTHON_VERSION --seed --link-mode copy
EOF

# 5. Sync dependencies
source .venv/bin/activate
uv sync --link-mode copy
Expand All @@ -75,6 +86,12 @@ if [ -L ".venv/bin/python" ]; then
cp "$REAL_PYTHON" .venv/bin/python
fi

# 6.1. Verify the Library structure
# Python needs the 'lib' folder in the same parent as 'bin'
if [ ! -d ".venv/lib" ] && [ -d ".venv/lib64" ]; then
ln -s lib64 .venv/lib
fi

# 7. Optional: Relocatable Shebangs
if [ "$MAKE_RELOCATABLE" -eq 1 ]; then
find .venv/bin -maxdepth 1 -type f -executable -exec \
Expand Down

0 comments on commit e15f60e

Please sign in to comment.