Skip to content

Commit

Permalink
chore: Update 3.11 version to rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrelg committed Oct 11, 2022
1 parent af680ce commit 812c0db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -9,7 +9,7 @@ on: pull_request
env:
# JSON variables (used in our strategy/matrix)
SUPPORTED_POETRY_VERSIONS: '\"poetry-version\":[\"1.1.14\", \"1.2.1\"]'
SUPPORTED_PYTHON_VERSIONS: '\"python-version\":[\"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11.0-rc.1\"]'
SUPPORTED_PYTHON_VERSIONS: '\"python-version\":[\"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11.0-rc.2\"]'
SUPPORTED_OPERATING_SYSTEMS: '\"os\":[\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"]'

# Normal variables (used in steps/*)
Expand All @@ -26,7 +26,7 @@ jobs:
python-version: 3.8
- uses: snok/install-poetry@v1.3.2
with:
version: 1.2.1
version: 1.2.2
virtualenvs-create: false

build-windows-38-local:
Expand All @@ -38,7 +38,7 @@ jobs:
python-version: 3.8
- uses: ./
with:
version: 1.2.1
version: 1.2.2
virtualenvs-create: false

# # The set-env job translates our json variables to a format we
Expand Down
29 changes: 26 additions & 3 deletions main.sh
@@ -1,31 +1,50 @@
#!/usr/bin/env bash

# Make the action fail if the exit code of anything below is 1
set -eo pipefail

# Generate a unique filename to curl to. This way
# we don't have to worry about name collisions
installation_script="$(mktemp)"
curl --ssl-no-revoke https://install.python-poetry.org/ --output "$installation_script"

# Fetch the official Poetry installation script
curl --sSL https://install.python-poetry.org/ --output "$installation_script"

# Specify the installation path
if [ "${RUNNER_OS}" == "Windows" ]; then
path="C:/Users/runneradmin/AppData/Roaming/Python/Scripts"
else
# The path for mac and ubuntu runners should be different,
# but we ran into an issue where a small % of mac-runners
# were installing to the ubuntu path, so decided to just
# use the same path for both
path="$HOME/.local"
fi

echo -e "\n\033[33mSetting Poetry installation path as $path\033[0m\n"
echo -e "\033[33mInstalling Poetry 👷\033[0m\n"

echo $(ls -la "$path/bin")

# Install Poetry
if [ "${VERSION}" == "latest" ]; then
# Note: If we quote installation arguments, the call below fails
# shellcheck disable=SC2086
POETRY_HOME=$path python3 "${installation_script}" --yes ${INSTALLATION_ARGUMENTS}
POETRY_HOME=$path python3 ${installation_script} --yes ${INSTALLATION_ARGUMENTS}
else
# shellcheck disable=SC2086
POETRY_HOME=$path python3 "${installation_script}" --yes --version="${VERSION}" ${INSTALLATION_ARGUMENTS}
POETRY_HOME=$path python3 ${installation_script} --yes --version=${VERSION} ${INSTALLATION_ARGUMENTS}
fi

echo "Finished installation"

# Add to GITHUB_PATH, which is like PATH, but persisted to other workflow steps
echo "$path/bin" >>"$GITHUB_PATH"

# Add to PATH
export PATH="$path/bin:$PATH"

# Specify path to the Poetry executable
if [ "${RUNNER_OS}" == "Windows" ]; then
poetry_="$path/bin/poetry.exe"
else
Expand All @@ -39,8 +58,11 @@ $poetry_ config virtualenvs.create "${VIRTUALENVS_CREATE}"
$poetry_ config virtualenvs.in-project "${VIRTUALENVS_IN_PROJECT}"
$poetry_ config virtualenvs.path "${VIRTUALENVS_PATH}"

# TODO: remove this
config="$("$poetry_" config --list)"

echo "$config"

if echo "$config" | grep -q -c "installer.parallel"; then
"$poetry_" config installer.parallel "${INSTALLER_PARALLEL}"
fi
Expand All @@ -59,6 +81,7 @@ echo -e "\n\033[33mDone ✅\033[0m"
if [ "${VIRTUALENVS_CREATE}" == true ] || [ "${VIRTUALENVS_CREATE}" == "true" ]; then
echo -e "\n\033[33mIf you are creating a venv in your project, you can activate it by running '$act'. If you're running this in an OS matrix, you can use 'source \$VENV' instead, as an OS agnostic option\033[0m"
fi

if [ "${RUNNER_OS}" == "Windows" ]; then
echo -e "\n\033[33mMake sure to set your default shell to bash when on Windows.\033[0m"
echo -e "\n\033[33mSee the github action docs for more information and examples.\033[0m"
Expand Down

0 comments on commit 812c0db

Please sign in to comment.