Skip to content

Commit

Permalink
Add new Python versions; Drop legacy python versions including 2; dro…
Browse files Browse the repository at this point in the history
…p pkg_resources; drop zopyx.txng3.ext
  • Loading branch information
jamadden committed Oct 11, 2024
1 parent 0f4d90e commit d6959aa
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 69 deletions.
67 changes: 34 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,45 @@ jobs:
test:
strategy:
matrix:
# XXX: PyPy 3, both 3.6 and 3.7 (7.3.4) crash in the test
# suite when calling a C extension. It's likely
# zopyx.txng3.ext, which compiles with many warnings.
python-version: [2.7, pypy2, 3.6, 3.7, 3.8, 3.9]
python-version: ["3.12", "pypy-3.10-v7.3.17", '3.9', '3.10', '3.11', "3.13"]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.*') }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U coverage
python -m pip install -U -e ".[test,docs]"
- name: Test
run: |
coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctests
coverage report -i
- name: Submit to Coveralls
# This is a container action, which only runs on Linux.
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
- name: checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U coverage
python -m pip install -U -e ".[test,docs]"
- name: Test
run: |
coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctests
- name: Report coverage
run: |
python -m coverage combine || true
python -m coverage report -i || true
python -m coverage xml -i || true
- name: Submit to Coveralls
# This is a container action, which only runs on Linux.
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
format: cobertura

coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
Changes
=========

3.0.2 (unreleased)
4.0.0 (unreleased)
==================

- Nothing changed yet.
- Drop support for Python 2. We now only support Python 3.9 and above.
- Add support for Python 3.10, 11, 12, and 13.
- Remove dependency on ``zopyx.txng3.ext``.
- Remove dependency on ``pkg_resources``.


3.0.1 (2021-05-13)
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = [
"wheel",
"setuptools",
]
26 changes: 14 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import codecs
from setuptools import setup, find_packages
from setuptools import setup
from setuptools import find_namespace_packages


TESTS_REQUIRE = [
Expand Down Expand Up @@ -30,32 +31,33 @@ def _read(fname):
'Operating System :: OS Independent',
'Framework :: ZODB',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Programming Language :: Python :: 3 :: Only",
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
url="https://github.com/OpenNTI/nti.zope_catalog",
project_urls={
'Documentation': 'https://ntizope-catalog.readthedocs.io/en/latest/',
},
zip_safe=True,
packages=find_packages('src'),
packages=find_namespace_packages(where='src'),
package_dir={'': 'src'},
include_package_data=True,
namespace_packages=['nti'],
tests_require=TESTS_REQUIRE,
install_requires=[
'setuptools',
'BTrees >= 4.8.0',
'nti.property >= 1.0.0',
'nti.zodb >= 1.0.0',
'persistent',
'pytz',
'six',
'zc.catalog[stemmer] >= 2.0.1',
'zc.catalog >= 2.0.1',
'ZODB >= 5.0.0',
'zope.cachedescriptors',
'zope.catalog',
Expand All @@ -64,14 +66,14 @@ def _read(fname):
'zope.index',
'zope.interface',
'zope.location',
'zopyx.txng3.ext >= 4.0.0'
],
extras_require={
'test': TESTS_REQUIRE,
'docs': [
'Sphinx < 4', # 4 breaks autointerface == 0.8
'Sphinx',
'repoze.sphinx.autointerface',
'sphinx_rtd_theme',
],
},
python_requires=">=3.9",
)
1 change: 0 additions & 1 deletion src/nti/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
22 changes: 2 additions & 20 deletions src/nti/zope_catalog/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,23 +339,5 @@ def test_query_stemmer(self):
index.index_doc(1, self)

assert_that(index.documentCount(), is_(1))

# Make sure the words got stemmed correctly. This fails
# if zopyx.txng3.ext is not installed.
assert_that(index.lexicon.get_wid('resources'), is_(0))
assert_that(index.lexicon.get_wid('resource'), is_(0))
assert_that(index.lexicon.get_wid('resourc'), is_not(0))



assert_that(index.apply("resource"),
contains(1))

assert_that(index.apply("human"),
contains(1))

assert_that(index.apply("valuable"),
contains(1))

assert_that(list(index.apply("resource*")),
is_([]))
# This used to contain tests that the zopyx.txng3.ext stemmer
# was being used. That isn't supported any more.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py27,py36,py37,py38,py39,pypy,pypy3,coverage,docs
py39,py310,py311,py312,py313,pypy,pypy3,coverage,docs

[testenv]
commands =
Expand Down

0 comments on commit d6959aa

Please sign in to comment.