Skip to content

Commit

Permalink
fix: pin python to v3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Realiserad committed Oct 9, 2024
1 parent 8479c13 commit 92cab9f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ on:
jobs:
python-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# https://devguide.python.org/versions
python-version: ["3.9", "3.10", "3.11", "3.12"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r .devcontainer/requirements-dev.txt
Expand Down
16 changes: 15 additions & 1 deletion conf.d/fish_ai.fish
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ function _fish_ai_install --on-event fish_ai_install
python3 -m venv ~/.fish-ai
echo "🍬 Installing dependencies. This may take a few seconds..."
~/.fish-ai/bin/pip install -qq "$(get_installation_url)"
python_version_check
if ! test -f ~/.config/fish-ai.ini
echo "🤗 You must create a configuration file before the plugin can be used!"
end
end

function _fish_ai_update --on-event fish_ai_update
echo "🍬 Upgrading dependencies. This may take a few seconds..."
echo "🐍 Upgrading Python. This may take a few seconds..."
python3 -m venv --upgrade ~/.fish-ai
echo "🍬 Upgrading dependencies. This may take a few more seconds..."
~/.fish-ai/bin/pip install -qq --upgrade "$(get_installation_url)"
python_version_check
end

function _fish_ai_uninstall --on-event fish_ai_uninstall
Expand All @@ -59,3 +63,13 @@ function get_installation_url
echo -n "fish-ai@git+https://github.com/$plugin"
end
end

function python_version_check
set python_version (python3 -c 'import platform; major, minor, _ = platform.python_version_tuple(); print(major, end="."); print(minor)')
set -l array supported_versions 3.9 3.10 3.11 3.12
if contains python_version supported_versions
echo "🔔 This plugin has not been tested with Python $python_version and may not function correctly."
echo "The following versions are supported: $supported_versions"
echo "Consider running 'python$supported_versions[-1] -m venv --upgrade ~/.fish-ai'."
end
end
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"

[project]
name = "fish_ai"
version = "0.10.0"
version = "0.10.1"
authors = [{ name = "Bastian Fredriksson", email = "realiserad@gmail.com" }]
description = "Provides core functionality for fish-ai, an AI plugin for the fish shell."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
Expand Down

0 comments on commit 92cab9f

Please sign in to comment.