Skip to content

Commit

Permalink
Merge pull request #770 from NatLibFi/drop-python-3.8-support
Browse files Browse the repository at this point in the history
Drop Python 3.8 support
  • Loading branch information
juhoinkinen authored Feb 26, 2024
2 parents f467aa4 + ec7b79a commit 1e182b2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: "Prepare: restore caches, install Poetry, set up Python"
uses: ./.github/actions/prepare
with:
python-version: "3.10"
python-version: "3.11"
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Python dev dependencies
run: |
Expand All @@ -47,7 +47,7 @@ jobs:
id: prepare
uses: ./.github/actions/prepare
with:
python-version: "3.9"
python-version: "3.10"
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Python dependencies
run: |
Expand All @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
name: test on Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -79,19 +79,15 @@ jobs:
- name: Install Python dependencies
run: |
# Selectively install the optional dependencies for some Python versions
# For Python 3.8:
if [[ ${{ matrix.python-version }} == '3.8' ]]; then
poetry install -E "nn omikuji yake voikko stwfsa";
fi
# For Python 3.9:
if [[ ${{ matrix.python-version }} == '3.9' ]]; then
poetry install -E "fasttext 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
poetry install -E "nn omikuji yake voikko stwfsa";
fi
# For Python 3.10:
if [[ ${{ matrix.python-version }} == '3.10' ]]; then
poetry install -E "nn omikuji yake stwfsa";
poetry install -E "fasttext 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
# For Python 3.11:
if [[ ${{ matrix.python-version }} == '3.11' ]]; then
Expand All @@ -103,7 +99,7 @@ jobs:
- name: Test with pytest
run: |
poetry run pytest --cov=./ --cov-report xml
if [[ ${{ matrix.python-version }} == '3.9' ]]; then
if [[ ${{ matrix.python-version }} == '3.10' ]]; then
poetry run pytest --cov=./ --cov-report xml --cov-append -m slow
fi
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ checks:
duplicate_code: true
build:
environment:
python: 3.8.12
python: 3.9.17
dependencies:
override:
- pip install .[dev]
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.8+ to install Annif.
You will need Python 3.9+ to install Annif.

The recommended way is to install Annif from
[PyPI](https://pypi.org/project/annif/) into a virtual environment.
Expand Down
2 changes: 1 addition & 1 deletion annif/backend/yake.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def is_trained(self):

@property
def label_types(self) -> list[URIRef]:
if type(self.params["label_types"]) == str: # Label types set by user
if isinstance(self.params["label_types"], str): # Label types set by user
label_types = [lt.strip() for lt in self.params["label_types"].split(",")]
self._validate_label_types(label_types)
else:
Expand Down
5 changes: 2 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.8,<3.12"
python = ">=3.9,<3.12"

connexion = {version = "2.14.2", extras = ["swagger-ui"]}
flask = "2.2.*"
Expand All @@ -52,7 +52,6 @@ jsonschema = "4.17.*"
fasttext-wheel = {version = "0.9.2", optional = true}
voikko = {version = "0.5.*", optional = true}
tensorflow-cpu = {version = "2.13.*", optional = true}
tensorflow-io-gcs-filesystem = {version = "<=0.34.*", optional = true, python = "3.8"}
lmdb = {version = "1.4.1", optional = true}
omikuji = {version = "0.5.*", optional = true}
yake = {version = "0.4.5", optional = true}
Expand All @@ -75,7 +74,7 @@ schemathesis = "3.*.*"
[tool.poetry.extras]
fasttext = ["fasttext-wheel"]
voikko = ["voikko"]
nn = ["tensorflow-cpu", "tensorflow-io-gcs-filesystem", "lmdb"]
nn = ["tensorflow-cpu", "lmdb"]
omikuji = ["omikuji"]
yake = ["yake"]
spacy = ["spacy"]
Expand Down

0 comments on commit 1e182b2

Please sign in to comment.