Skip to content

Commit

Permalink
Merge pull request #780 from NatLibFi/python3.12-support
Browse files Browse the repository at this point in the history
Python 3.12 support
  • Loading branch information
juhoinkinen committed Apr 25, 2024
2 parents 545662a + 3d79b67 commit 88b9f8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: test on Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand Down Expand Up @@ -95,6 +95,12 @@ jobs:
# download the small English pretrained spaCy model needed by spacy analyzer
poetry run python -m spacy download en_core_web_sm --upgrade-strategy only-if-needed
fi
# For Python 3.12:
if [[ ${{ matrix.python-version }} == '3.12' ]]; then
poetry install -E "fasttext yake voikko spacy";
# download the small English pretrained spaCy model needed by spacy analyzer
poetry run python -m spacy download en_core_web_sm --upgrade-strategy only-if-needed
fi
poetry run python -m nltk.downloader punkt
- name: Test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ already functional for many common tasks.

Annif is developed and tested on Linux. If you want to run Annif on Windows or Mac OS, the recommended way is to use Docker (see below) or a Linux virtual machine.

You will need Python 3.9+ to install Annif.
You will need Python 3.9-3.12 to install Annif.

The recommended way is to install Annif from
[PyPI](https://pypi.org/project/annif/) into a virtual environment.
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python = ">=3.9,<3.13"

connexion = { version = "~3.0.5", extras = ["flask", "uvicorn", "swagger-ui"] }
click = "8.1.*"
Expand All @@ -51,12 +51,12 @@ huggingface-hub = "0.22.*"

fasttext-wheel = { version = "0.9.2", optional = true }
voikko = { version = "0.5.*", optional = true }
tensorflow-cpu = { version = "2.15.*", optional = true }
tensorflow-cpu = { version = "2.15.*", optional = true, python = "<3.12" }
lmdb = { version = "1.4.1", optional = true }
omikuji = { version = "0.5.*", optional = true }
yake = { version = "0.4.8", optional = true }
spacy = { version = "3.7.*", optional = true }
stwfsapy = { version = "0.4.*", optional = true }
stwfsapy = { version = "0.4.*", optional = true, python = "<3.12" }

[tool.poetry.dev-dependencies]
py = "*"
Expand Down

0 comments on commit 88b9f8e

Please sign in to comment.