Skip to content

Commit

Permalink
Updated scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoyt Koepke committed May 16, 2024
1 parent 8ff9c9b commit 222333a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
21 changes: 6 additions & 15 deletions python/pyxet/scripts/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,19 @@ fi
export MACOSX_DEPLOYMENT_TARGET=10.9
unset CONDA_PREFIX

# Clear out the old virtual env.
rm -rf .venv_build

OS=$(uname -s)
python_executable=$(./scripts/find_python.sh release)

if [[ -z "$PYTHON_EXECUTABLE" ]] ; then
if [[ "$OS" == "Darwin" ]]; then
# Use system universal one
PYTHON_EXECUTABLE=/usr/bin/python3
else
PYTHON_EXECUTABLE=$(which python3)
fi
fi

$PYTHON_EXECUTABLE -m venv .venv_build
# Clear out and rebuild the virtual env
rm -rf .venv_build
$python_executable -m venv .venv_build
. .venv_build/bin/activate

pip install --upgrade pip
pip install -r scripts/dev_requirements.txt

# Clear out any old wheels
mv target/wheels/ target/old_wheels/ || echo ""
mkdir -p target/old_wheels/
mv target/wheels/* target/old_wheels/ || echo ""

if [[ "$OS" == "Darwin" ]]; then
maturin build --profile=cli-release --target=universal2-apple-darwin
Expand Down
6 changes: 3 additions & 3 deletions python/pyxet/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ -z "$VIRTUAL_ENV" ]] ; then

source ./scripts/set_python_executable.sh
python_executable=$(./scripts/find_python.sh)

if [[ ! -e pyproject.toml ]] ; then
echo "Run this script in the pyxet directory using ./scripts/$0"
Expand All @@ -11,8 +11,8 @@ if [[ -z "$VIRTUAL_ENV" ]] ; then

if [[ ! -e venv/ ]] ; then
echo "Setting up virtual environment."
echo "Python version = $($PYTHON_EXECUTABLE --version)"
$PYTHON_EXECUTABLE -m venv ./venv
echo "Python version = $($python_executable--version)"
$python_executable -m venv ./venv

source ./venv/bin/activate || ls -R ./

Expand Down

0 comments on commit 222333a

Please sign in to comment.