Skip to content

Commit

Permalink
Merge pull request #3216 from purificant/ci_py37_eol
Browse files Browse the repository at this point in the history
sunset python 3.7
  • Loading branch information
stevenbird committed Dec 17, 2023
2 parents b7e9dde + 48b6e10 commit 6c39612
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
needs: [cache_nltk_data, cache_third_party]
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
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 py37` if you are on Python 3.7);
(`tox -e py312` if you are on Python 3.12);
- 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.7`, `3.8`, `3.9`).
- tests against supported Python versions (`3.8`, `3.9`, `3.10`, `3.11`, `3.12`).
- 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 All @@ -189,7 +189,7 @@ The [`.github/workflows/ci.yaml`](https://github.com/nltk/nltk/blob/develop/.git
#### To test with `tox` locally

First setup a new virtual environment, see https://docs.python-guide.org/dev/virtualenvs/
Then run `tox -e py37`.
Then run `tox -e py312`.

For example, using `pipenv`:

Expand All @@ -198,7 +198,7 @@ git clone https://github.com/nltk/nltk.git
cd nltk
pipenv install -r pip-req.txt
pipenv install tox
tox -e py37
tox -e py312
```


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
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.7, 3.8, 3.9, 3.10, 3.11 or 3.12.
Language Processing. NLTK requires Python version 3.8, 3.9, 3.10, 3.11 or 3.12.

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

Expand Down
4 changes: 2 additions & 2 deletions nltk/__init__.py
Original file line number Diff line number Diff line change
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.7, 3.8, 3.9, 3.10 or 3.11."""
natural language processing. NLTK requires Python 3.8, 3.9, 3.10, 3.11 or 3.12."""
__keywords__ = [
"NLP",
"CL",
Expand Down Expand Up @@ -84,11 +84,11 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
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.7, 3.8, 3.9, 3.10, 3.11 or 3.12.""",
natural language processing. NLTK requires Python 3.8, 3.9, 3.10, 3.11 or 3.12.""",
license="Apache License, Version 2.0",
keywords=[
"NLP",
Expand Down Expand Up @@ -95,7 +95,6 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -112,7 +111,7 @@
"Topic :: Text Processing :: Linguistic",
],
package_data={"nltk": ["test/*.doctest", "VERSION"]},
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=[
"click",
"joblib",
Expand Down
20 changes: 10 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
envlist =
py{37,38,39,310,311}
py{38,39,310,311,312}
pypy
py{37,38,39,310,311}-nodeps
py{37,38,39,310,311}-jenkins
py{38,39,310,311,312}-nodeps
py{38,39,310,311,312}-jenkins
py-travis

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

[testenv:py37-nodeps]
basepython = python3.7
deps =
pytest
pytest-mock
commands = pytest

[testenv:py38-nodeps]
basepython = python3.8
deps =
Expand Down Expand Up @@ -90,6 +83,13 @@ deps =
pytest-mock
commands = pytest

[testenv:py312-nodeps]
basepython = python3.12
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/
Expand Down
10 changes: 5 additions & 5 deletions web/dev/local_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ Please consult https://tox.wiki for more info about the tox tool.
Examples
--------

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

tox -e py37 -- -v --failed
tox -e py312 -- -v --failed

Run tree doctests for all available interpreters::

tox -- tree.doctest

Run a selected unit test for Python 3.7::
Run a selected unit test for Python 3.12::

tox -e py37 -- -v nltk.test.unit.test_seekable_unicode_stream_reader
tox -e py312 -- -v nltk.test.unit.test_seekable_unicode_stream_reader

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 py37-nodeps,py37,pypy
tox -e py312-nodeps,py312,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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installing NLTK
===============

NLTK requires Python versions 3.7, 3.8, 3.9, 3.10 or 3.11.
NLTK requires Python versions 3.8, 3.9, 3.10, 3.11 or 3.12.

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 6c39612

Please sign in to comment.