From d8f3a0578fa5bbb6ecad1fb38ce37a0e03161c55 Mon Sep 17 00:00:00 2001 From: Christian Kuss Date: Wed, 7 Dec 2022 13:33:26 -0800 Subject: [PATCH] Issue #199 - Upgrade to Python 3.10 Because of the strictly pinned versions this library would only work with Python 3.7, as stated in the documentation. Since the dependencies are well founded they provide support for newer versions of Python, including Python 3.10. By migrating to the newer versions this library will now support Python3.10 but drop support for other versions. Nose is no longer maintained and does not support 3.9+. This commit removes nose as a dependency in favor of pytest. Fixes #199 --- .travis.yml | 4 ++-- ait/dsn/bch/test/bch_test.py | 2 +- ait/dsn/encrypt/test/test_encrypt.py | 6 +++--- ait/dsn/sle/test/frames_test.py | 2 +- config/leapseconds.dat | Bin 0 -> 497 bytes doc/Makefile | 2 +- doc/make.bat | 0 readthedocs.yml | 2 +- setup.py | 10 ++++------ 9 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 config/leapseconds.dat mode change 100644 => 100755 doc/make.bat diff --git a/.travis.yml b/.travis.yml index def93a0..08407ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "3.7" + - "3.10" branches: only: @@ -12,4 +12,4 @@ env: install: - pip install .[tests] -script: python setup.py nosetests +script: pytest --ignore ait/dsn/bin/examples --cov=ait diff --git a/ait/dsn/bch/test/bch_test.py b/ait/dsn/bch/test/bch_test.py index 29e5136..e4d5c68 100644 --- a/ait/dsn/bch/test/bch_test.py +++ b/ait/dsn/bch/test/bch_test.py @@ -14,7 +14,7 @@ import os import unittest -import mock +from unittest import mock import ait.core from ait.dsn.bch.bch import BCH diff --git a/ait/dsn/encrypt/test/test_encrypt.py b/ait/dsn/encrypt/test/test_encrypt.py index 4c7034f..10d5c8a 100644 --- a/ait/dsn/encrypt/test/test_encrypt.py +++ b/ait/dsn/encrypt/test/test_encrypt.py @@ -18,7 +18,7 @@ import unittest import binascii -import nose.tools +import pytest from unittest import mock import ait.core.cfg as cfg @@ -71,7 +71,7 @@ def test_factory(self): encr = EncrypterFactory().get(null_classname) assert isinstance(encr, NullEncrypter) - with nose.tools.assert_raises(ImportError): + with pytest.raises(ImportError): EncrypterFactory().get(invalid_classname) class TestNullEncrypter(unittest.TestCase): @@ -144,7 +144,7 @@ def test_kmc_encrypter(self): assert ait_result.has_errors # Failed import of KMC lib results in a Name error - #with nose.tools.assert_raises(NameError): + #with pytest.raises(NameError): # encr.connect() encr.connect() assert not encr.is_connected() diff --git a/ait/dsn/sle/test/frames_test.py b/ait/dsn/sle/test/frames_test.py index c3c2118..a222174 100644 --- a/ait/dsn/sle/test/frames_test.py +++ b/ait/dsn/sle/test/frames_test.py @@ -14,7 +14,7 @@ import os import unittest -import mock +from unittest import mock import ait.core from ait.dsn.sle.frames import AOSTransFrame, AOSConfig, AOSDataFieldType diff --git a/config/leapseconds.dat b/config/leapseconds.dat new file mode 100644 index 0000000000000000000000000000000000000000..485afcec3c6fe8562ecd2aca581d880f1cf9156b GIT binary patch literal 497 zcmY++yAHu{7{+0xRa)oS1(@7~(PlR^`cFvekQAH5!qm;@auA6)h1et#iCDM|Qt#mX zrY}$4{KoqHrA5LUNhvUfj@NP}NVra4^;>QA|IVahneTY+Ej@S0f%Z!~Hf;4O0;ykj=Odu}Jd2j(RB$ZUa6+_u4I hUZ=npUZ=rV<_!48oCV*xodZ9Z^WY~(3R6*o@&}HQfT92Z literal 0 HcmV?d00001 diff --git a/doc/Makefile b/doc/Makefile index 1133d32..f3536a7 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,7 +9,7 @@ BUILDDIR = build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) - $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) + $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. diff --git a/doc/make.bat b/doc/make.bat old mode 100644 new mode 100755 diff --git a/readthedocs.yml b/readthedocs.yml index f69b855..0d606b8 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,7 +1,7 @@ formats: - none python: - version: 3.7 + version: 3.10 pip_install: true extra_requirements: - docs diff --git a/setup.py b/setup.py index e6a2672..5573321 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( name = 'ait-dsn', - version = '2.0.1-rc1', + version = '2.1.0', description = description, long_description = long_description, long_description_content_type = 'text/x-rst', @@ -38,8 +38,7 @@ namespace_packages = ['ait'], install_requires = [ - 'greenlet==0.4.16', - 'ait-core>=2.0.0', + 'ait-core>=2.4.0', 'pyasn1', 'bitstring' ], @@ -51,9 +50,8 @@ 'sphinxcontrib-httpdomain' ], 'tests': [ - 'nose', - 'coverage', - 'mock', + 'pytest', + 'pytest-cov', 'pylint' ], },