From 13d9414237be22d8627d056a8314f546cdf75594 Mon Sep 17 00:00:00 2001 From: Mark Susol Date: Sun, 23 Apr 2023 17:43:59 -0600 Subject: [PATCH] fixing project testing - TypeError: assert_frame_equal() got an unexpected keyword argument 'check_less_precise' - upgrade requirements.txt for numpy/pandas - upgrading minimum python version: py3.9+ - other misc changes --- .travis.yml | 4 ++-- CONTRIBUTING.rst | 2 +- Pipfile | 8 ++++---- requirements.txt | 4 ++-- setup.py | 6 +++--- tests/pyLDAvis/test_prepare.py | 4 ++-- tox.ini | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b529737..34df957b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: python python: + - "3.11" + - "3.10" - "3.9" - - "3.8" - - "3.7" env: - DEPS="pytest gensim smart_open==2.0.0" diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 791990d8..62ccadf3 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -99,7 +99,7 @@ Before you submit a pull request, check that it meets these guidelines: 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. -3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11, and for PyPI. Check +3. The pull request should work for Python 3.9, 3.10, 3.11, and for PyPI. Check https://travis-ci.org/bmabey/pyLDAvis/pull_requests and make sure that the tests pass for all supported Python versions. diff --git a/Pipfile b/Pipfile index f42ec3bf..76f40124 100644 --- a/Pipfile +++ b/Pipfile @@ -5,9 +5,9 @@ name = "pypi" [packages] pyLDAvis = {editable = true, path = "."} -numpy = ">=1.22.0" +numpy = ">=1.24.2" scipy = "*" -pandas = ">=1.3.4" +pandas = ">=2.0.0" joblib = ">=1.2.0" numexpr = "*" funcy = "*" @@ -17,7 +17,7 @@ Jinja2 = "*" reproducer = {editable = true, path = "."} [dev-packages] -pytest = ">=3.8" +pytest = ">=3.9" [requires] -python_version = "3.10" +python_version = "3.11" diff --git a/requirements.txt b/requirements.txt index 7d713cfb..a37396fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -numpy>=1.22.0 +numpy>=1.24.2 scipy -pandas>=1.3.4 +pandas>=2.0.0 joblib>=1.2.0 jinja2 numexpr diff --git a/setup.py b/setup.py index 5ddc92e6..6313de72 100755 --- a/setup.py +++ b/setup.py @@ -20,15 +20,16 @@ name='pyLDAvis', version='3.4.1', description='Interactive topic model visualization. Port of the R package.', + long_description_content_type="text/x-rst", long_description=readme, author='Ben Mabey', author_email='ben@benmabey.com', url='https://github.com/bmabey/pyLDAvis', - download_url='https://github.com/bmabey/pyLDAvis/tarball/3.4.0', + download_url='https://github.com/bmabey/pyLDAvis/tarball/3.4.1', packages=['pyLDAvis'], package_dir={'pyLDAvis': 'pyLDAvis'}, tests_require=['pytest'], - python_requires=">=3.8", + python_requires=">=3.9", include_package_data=True, install_requires=requirements, license='BSD-3-Clause', @@ -41,7 +42,6 @@ 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', diff --git a/tests/pyLDAvis/test_prepare.py b/tests/pyLDAvis/test_prepare.py index 0324e82d..c55ee221 100644 --- a/tests/pyLDAvis/test_prepare.py +++ b/tests/pyLDAvis/test_prepare.py @@ -61,7 +61,7 @@ def both(f): join_percent = float(len(joined)) / len(etinfo) print('Topic Info join was %.0f%%' % (100 * join_percent)) - assert_frame_equal(ejoined, ojoined, check_less_precise=True) + assert_frame_equal(ejoined, ojoined, check_exact=False, rtol=0.1) assert join_percent > 0.95 def abs_basis(df): @@ -71,7 +71,7 @@ def abs_basis(df): emds, omds = both(lambda r: abs_basis(pd.DataFrame(r['mdsDat']))) assert_frame_equal(emds.reindex(sorted(oddf.columns), axis=1), - omds.reindex(sorted(oddf.columns), axis=1), check_less_precise=True) + omds.reindex(sorted(oddf.columns), axis=1), check_exact=False, rtol=0.1) def rounded_token_table(r): tt = pd.DataFrame(r['token.table']) diff --git a/tox.ini b/tox.ini index 2ce2352e..1346b5ae 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, py39, py310, py311 +envlist = py39, py310, py311 [testenv] install_command = pip3 install {opts} {packages}