From b3cd096f674db5970df49fe26807d58f9c327242 Mon Sep 17 00:00:00 2001 From: Aav Date: Mon, 3 Apr 2023 17:57:44 -0700 Subject: [PATCH 1/5] Create installer as a .zsh script. --- installers/install_spyglass.zsh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 installers/install_spyglass.zsh diff --git a/installers/install_spyglass.zsh b/installers/install_spyglass.zsh new file mode 100644 index 0000000..e201c1d --- /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 v3.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 From 9cf96aaf4a839f1ee9dd8295d2516f898379bed4 Mon Sep 17 00:00:00 2001 From: Aav Date: Mon, 3 Apr 2023 18:00:55 -0700 Subject: [PATCH 2/5] Bump build-release.yml Python setup dependencies, add caching behavior to speed up release builds. --- .github/workflows/build-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: | From f4ffbb783d161c1a79a0f6cc2cb3282b09d25831 Mon Sep 17 00:00:00 2001 From: Aav Date: Mon, 3 Apr 2023 20:37:16 -0700 Subject: [PATCH 3/5] Wrong tag in checkout. --- installers/install_spyglass.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/install_spyglass.zsh b/installers/install_spyglass.zsh index e201c1d..2734bf0 100644 --- a/installers/install_spyglass.zsh +++ b/installers/install_spyglass.zsh @@ -9,7 +9,7 @@ cd Spyglass # 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 v3.0.1 +git checkout 3.0.1 $py3 = python3 --version # Check if python 3 is 3.9 or higher From 6cc895445364c6e68d113298175bd082c20e4b11 Mon Sep 17 00:00:00 2001 From: Aav Date: Mon, 3 Apr 2023 20:48:19 -0700 Subject: [PATCH 4/5] Actually store variable --- installers/install_spyglass.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/install_spyglass.zsh b/installers/install_spyglass.zsh index 2734bf0..8501bea 100644 --- a/installers/install_spyglass.zsh +++ b/installers/install_spyglass.zsh @@ -11,7 +11,7 @@ cd Spyglass # 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 +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." From 2ac1e17a38e3bfdda01a5a19526021c7eb67fbf9 Mon Sep 17 00:00:00 2001 From: Aav Date: Sun, 9 Apr 2023 22:15:01 -0700 Subject: [PATCH 5/5] Fix cumulative nation counting --- spyglass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]}")