diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c5dea81..b0a1a1c 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -36,9 +36,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.10' + cache: 'pip' - name: Build with pyInstaller run: | diff --git a/installers/install_spyglass.zsh b/installers/install_spyglass.zsh new file mode 100644 index 0000000..8501bea --- /dev/null +++ b/installers/install_spyglass.zsh @@ -0,0 +1,33 @@ +#!/bin/zsh + +echo "Installing Spyglass..." +# Get the latest version of Spyglass +git clone https://github.com/Derpseh/Spyglass.git +cd Spyglass + +# Check out the latest tag (the latest release) +# NOTE: Hardcoding this to v3.0.1 for now because releases after that +# are not considered stable. Leaving in my tag search code for now though. +# git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) # Uncomment this line to get the latest release +git checkout 3.0.1 + +py3=$(python3 --version) +# Check if python 3 is 3.9 or higher +if [[ $py3 == *"3.9"* || $py3 == *"3.10"* || $py3 == *"3.11"* ]]; then + echo "Python 3.9 or higher detected." +else + echo "Python 3.9 or higher not detected. Please install Python 3.9 or higher." + exit 1 +fi + +# Check to see if the user wants a virtual environment +read -q "REPLY?Do you want to create a virtual environment? (y/n) " +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Creating virtual environment..." + python3 -m venv venv + source venv/bin/activate +fi + +# Install requirements +pip install -r requirements.txt diff --git a/spyglass.py b/spyglass.py index f129ecd..20d60f7 100644 --- a/spyglass.py +++ b/spyglass.py @@ -334,7 +334,7 @@ def sanitize(string: str) -> Optional[str]: for region in regions: CumuNatList.append(CumuNatList[-1] + region["num_nations"]) - region.update({"cumu_nations": CumuNatList[-1] + region["num_nations"]}) + region.update({"cumu_nations": CumuNatList[-1]}) logger.info("Cumulative nation list created!") logger.info(f"Total number of nations: {CumuNatList[-1]}")