Skip to content

Commit

Permalink
Drop support for Python 3.6, support Python 3.10 (#2920)
Browse files Browse the repository at this point in the history
This reverts commit 0b8c2d5.
This was reverted initially to allow Python 3.6 users to use NLTK 3.6.7,
which contains a bug-fix for NLTK 3.6.6.
  • Loading branch information
tomaarsen committed Dec 28, 2021
1 parent 9f4de18 commit 555ec60
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -76,7 +76,7 @@ jobs:
needs: [cache_nltk_data, cache_third_party]
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9']

This comment has been minimized.

Copy link
@bryant1410

bryant1410 Jan 11, 2022

Contributor

Shouldn't it also test on 3.10?

This comment has been minimized.

Copy link
@tomaarsen

tomaarsen Jan 11, 2022

Author Member

It should (preferably, anyways), but a dependency of ours, scikit-learn, did not have a working Python 3.10 version for Windows. See 177614c for the commit where we removed Python 3.10 from the CI.
However, it seems that scikit-learn has now been updated: https://github.com/scikit-learn/scikit-learn/releases/tag/1.0.2. So, we can try to add 3.10 (back) to the CI. Thanks for reminding us!

This comment has been minimized.

Copy link
@purificant

purificant Jan 11, 2022

Member

Hm ... it was testing in 3.10 - https://github.com/nltk/nltk/pull/2920/files
But now it isn't: https://github.com/nltk/nltk/blob/develop/.github/workflows/ci.yaml#L79

We should add it for sure, assuming the CI pipeline will pass.

This comment has been minimized.

This comment has been minimized.

Copy link
@tomaarsen

tomaarsen Jan 11, 2022

Author Member

@purificant It is indeed. See my message above. I've re-added the tests for 3.10 on tomaarsen/nltk first. If it passes there, then I can push the commit to nltk/nltk too.

This comment has been minimized.

Copy link
@purificant

purificant Jan 11, 2022

Member

Seems GH is not having a good day, I didn't see your messages until just now. Thanks @tomaarsen!
CI pipeline also passes for me with 3.10

os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -10,7 +10,7 @@ repos:
rev: v2.23.3
hooks:
- id: pyupgrade
args: ["--py36-plus"]
args: ["--py37-plus"]
- repo: https://github.com/ambv/black
rev: 21.7b0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -77,7 +77,7 @@ Summary of our git branching model:
- Do many small commits on that branch locally (`git add files-changed`,
`git commit -m "Add some change"`);
- Run the tests to make sure nothing breaks
(`tox -e py36` if you are on Python 3.6);
(`tox -e py37` if you are on Python 3.7);
- Add your name to the `AUTHORS.md` file as a contributor;
- Push to your fork on GitHub (with the name as your local branch:
`git push origin branch-name`);
Expand Down Expand Up @@ -169,7 +169,7 @@ The [`.github/workflows/ci.yaml`](https://github.com/nltk/nltk/blob/develop/.git
- Otherwise, download all the data packages through `nltk.download('all')`.

- The `test` job
- tests against supported Python versions (`3.6`, `3.7`, `3.8`, `3.9`).
- tests against supported Python versions (`3.7`, `3.8`, `3.9`).
- tests on `ubuntu-latest` and `macos-latest`.
- relies on the `cache_nltk_data` job to ensure that `nltk_data` is available.
- performs these steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@

NLTK -- the Natural Language Toolkit -- is a suite of open source Python
modules, data sets, and tutorials supporting research and development in Natural
Language Processing. NLTK requires Python version 3.6, 3.7, 3.8, or 3.9.
Language Processing. NLTK requires Python version 3.7, 3.8, 3.9 or 3.10.

For documentation, please visit [nltk.org](https://www.nltk.org/).

Expand Down
4 changes: 2 additions & 2 deletions nltk/__init__.py
Expand Up @@ -52,7 +52,7 @@
# Description of the toolkit, keywords, and the project's primary URL.
__longdescr__ = """\
The Natural Language Toolkit (NLTK) is a Python package for
natural language processing. NLTK requires Python 3.6, 3.7, 3.8, or 3.9."""
natural language processing. NLTK requires Python 3.7, 3.8, 3.9 or 3.10."""
__keywords__ = [
"NLP",
"CL",
Expand Down Expand Up @@ -84,10 +84,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Expand Up @@ -67,7 +67,7 @@
},
long_description="""\
The Natural Language Toolkit (NLTK) is a Python package for
natural language processing. NLTK requires Python 3.6, 3.7, 3.8, or 3.9.""",
natural language processing. NLTK requires Python 3.7, 3.8, 3.9 or 3.10.""",
license="Apache License, Version 2.0",
keywords=[
"NLP",
Expand Down Expand Up @@ -95,10 +95,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
Expand All @@ -110,7 +110,7 @@
"Topic :: Text Processing :: Linguistic",
],
package_data={"nltk": ["test/*.doctest", "VERSION"]},
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=[
"click",
"joblib",
Expand Down
28 changes: 10 additions & 18 deletions tox.ini
@@ -1,9 +1,9 @@
[tox]
envlist =
py{36,37,38,39}
py{37,38,39,310}
pypy
py{36,37,38,39}-nodeps
py{36,37,38,39}-jenkins
py{37,38,39,310}-nodeps
py{37,38,39,310}-jenkins
py-travis

[testenv]
Expand Down Expand Up @@ -51,13 +51,6 @@ deps =
commands =
pytest

[testenv:py36-nodeps]
basepython = python3.6
deps =
pytest
pytest-mock
commands = pytest

[testenv:py37-nodeps]
basepython = python3.7
deps =
Expand All @@ -79,18 +72,17 @@ deps =
pytest-mock
commands = pytest

[testenv:py310-nodeps]
basepython = python3.10
deps =
pytest
pytest-mock
commands = pytest

# Use minor version agnostic basepython, but specify testenv
# control Python2/3 versions using jenkins' user-defined matrix instead.
# Available Python versions: http://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/python/fc25/

[testenv:py3.6.4-jenkins]
basepython = python3
commands = {toxinidir}/jenkins.sh
setenv =
STANFORD_MODELS = {homedir}/third/stanford-parser/
STANFORD_PARSER = {homedir}/third/stanford-parser/
STANFORD_POSTAGGER = {homedir}/third/stanford-postagger/

[testenv:py-travis]
extras = all
setenv =
Expand Down
6 changes: 3 additions & 3 deletions web/dev/local_testing.rst
Expand Up @@ -25,10 +25,10 @@ Please consult https://tox.wiki for more info about the tox tool.
Examples
--------

Run tests for python 3.6 in verbose mode; executing only tests
Run tests for python 3.7 in verbose mode; executing only tests
that failed in the last test run::

tox -e py36 -- -v --failed
tox -e py37 -- -v --failed

Run tree doctests for all available interpreters::

Expand All @@ -42,7 +42,7 @@ By default, numpy, scipy and scikit-learn are installed in tox virtualenvs.
This is slow, requires working build toolchain and is not always feasible.
In order to skip numpy & friends, use ``..-nodeps`` environments::

tox -e py36-nodeps,py37,pypy
tox -e py37-nodeps,py37,pypy

It is also possible to run tests without tox. This way NLTK would be tested
only under single interpreter, but it may be easier to have numpy and other
Expand Down
2 changes: 1 addition & 1 deletion web/install.rst
@@ -1,7 +1,7 @@
Installing NLTK
===============

NLTK requires Python versions 3.6, 3.7, 3.8, or 3.9
NLTK requires Python versions 3.7, 3.8, 3.9 or 3.10

For Windows users, it is strongly recommended that you go through this guide to install Python 3 successfully https://docs.python-guide.org/starting/install3/win/#install3-windows

Expand Down

0 comments on commit 555ec60

Please sign in to comment.