Skip to content

Commit

Permalink
drop python 3.7 support and fix lingua versions
Browse files Browse the repository at this point in the history
  • Loading branch information
svirpioj committed Jan 3, 2024
1 parent 1ccb30d commit 366c2e1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
requirements-file: ["requirements.txt"]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -57,11 +57,11 @@ jobs:
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]*)?$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Set up Python 3.7
- name: Set up Python 3.8
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install pypa/build
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: >-
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Install from source:

### Troubleshooting

OpusFilter should generally work fine on Python 3.7 to 3.11. In the case of troubles, try installing the exact versions in `requirements.txt`:
OpusFilter should generally work fine on Python 3.8 to 3.11. In the case of troubles, try installing the exact versions in `requirements.txt`:

* `pip install -r requirements.txt`

Expand Down
8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- support `lingua` based for language detection (https://github.com/Helsinki-NLP/OpusFilter/pull/65)

### Removed

- Python 3.7 support

## [3.0.0] - 2023-10-11

### Added
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ issues page. We are also happy to consider pull requests. There are a
few rules for pull requests:

* Make a pull request to the `develop` branch instead of `master`.
* The code should support at least Python versions from 3.7 to 3.11.
* The code should support at least Python versions from 3.8 to 3.11.
* Please follow [PEP 8](https://www.python.org/dev/peps/pep-0008/). Exception: The maximum line length is 127 characters instead of 79.
* Especially for new features, please include test cases for unit testing.

Expand All @@ -19,8 +19,8 @@ work, if you have VariKN and eflomal set up as instructed - `pytest`
skips the respective tests if not.)

GitHub workflows defined in the project run automatically `flake8`
checks and unit testing with `pytest` using Python 3.7, 3.8, 3.9,
3.10, and 3.11.
checks and unit testing with `pytest` using Python 3.8, 3.9, 3.10,
and 3.11.

Especially for larger contributions, consider using a code analysis
tool like [Pylint](https://github.com/PyCQA/pylint). Install it
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install from source:

Note that all required libraries are not available to install via PyPI
on Windows OS. On Linux and MacOS, it should work directly for Python
versions from 3.7 to 3.11.
versions from 3.8 to 3.11.

## Required libraries

Expand Down
4 changes: 2 additions & 2 deletions opusfilter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class LanguageIDFilter(FilterABC):
* langid (default): see :cite:`lui-baldwin-2012-langid`
* cld2: see https://github.com/CLD2Owners/cld2
* fasttext: see :cite:`joulin-etal-2016-fasttext` and :cite:`joulin-etal-2017-bag`
* lingua-py: see https://github.com/pemistahl/lingua-py
* lingua: see https://github.com/pemistahl/lingua-py
"""

Expand Down Expand Up @@ -341,7 +341,7 @@ def __init__(self, languages=None, id_method='langid', thresholds=None,
elif lingua_mode == "low":
self.lingua_detector = from_languages.with_low_accuracy_mode().build()
else:
assert False, f"{lingua_mode} lingua mode is not supported."
raise ConfigurationError(f"lingua mode '{lingua_mode}' is not supported.")

# global options
self.languages = languages
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ mecab-python3>=1.0.8
unidic-lite==1.0.8
subword-nmt==0.3.8
Morfessor==2.0.6
lingua-language-detector==2.0.1
lingua-language-detector==2.0.2
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"scikit-learn",
"subword_nmt",
"tqdm",
"lingua-language-detector"
"lingua-language-detector>=1.3.0"
]

eflomal_require = [
Expand Down Expand Up @@ -85,5 +85,5 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
),
python_requires=">=3.7",
python_requires=">=3.8",
)

0 comments on commit 366c2e1

Please sign in to comment.