Skip to content

Commit

Permalink
Merge pull request #54 from rc10house/52-cross-version-testing
Browse files Browse the repository at this point in the history
chore(testing): Installed tox for python versions 3.8 to 3.11
  • Loading branch information
Jyyjy authored Aug 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 8aadb13 + 20f0acc commit e4c6d2a
Showing 5 changed files with 882 additions and 687 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -54,6 +54,24 @@ test:
poetry run pytest
@echo "Done."

test_all:
@echo "Testing with python3 versions 3.8 and up..."
@echo "This may take a while..."
tox run-parallel

#########
# Setup #
#########
install_py_versions:
@echo "Installing python 3.8 and up..."
ifeq ($(OS),Windows_NT)
@echo "Windows detected..."
@echo "Please run this in Windows Subsystem for Linux (WSL)"
else
@echo "Unix detected"
./install_py_versions.sh
endif

##########################
# LINTING AND FORMATTING #
##########################
35 changes: 35 additions & 0 deletions install_py_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

install_python_versions() {
versions=("3.8" "3.9" "3.10" "3.11")
for version in "${versions[@]}"; do
echo "--------------------------------------------------"
echo "Installing python $version"
echo "--------------------------------------------------"
pyenv install -s "$version"
pyenv local "$version"
done
}

# Install pyenv
if which pyenv; then
install_python_versions
else
echo "Trying to install pyenv for you."
curl https://pyenv.run | bash

user_shell="$SHELL"

if echo "$user_shell" | grep -q "bash"; then
rc_file="$HOME/.bashrc"
elif echo "$user_shell" | grep -q "zsh"; then
rc_file="$HOME/.zshrc"
elif echo "$user_shell" | grep -q "fish"; then
rc_file="$HOME/.config/fish/config.fish"
else
echo "Unsupported shell: $user_shell"
exit 1
fi

install_python_versions
fi
Loading

0 comments on commit e4c6d2a

Please sign in to comment.