Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #199 - Upgrade to Python 3.10 #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christianmkuss
Copy link

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.

Fixes #199

@christianmkuss christianmkuss requested review from a team as code owners December 7, 2022 23:07
@nttoole
Copy link
Contributor

nttoole commented Dec 8, 2022

@christianmkuss When running the tests, I am seeing an error related to collections.Callable
Do you experience this on your end? Or perhaps you are including a new version of a dependency?

(venv) nttoole@MT-202661 AIT-DSN % python setup.py nosetests
...Traceback (most recent call last):
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/AIT-DSN/setup.py", line 27, in <module>
    setup(
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_commands
    self.run_command(cmd)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
    cmd_obj.run()
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/commands.py", line 158, in run
    TestProgram(argv=argv, config=self.__config)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/core.py", line 118, in __init__
    unittest.TestProgram.__init__(
  File "/Users/nttoole/.pyenv/versions/3.10.5/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/core.py", line 179, in parseArgs
    self.createTests()
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/core.py", line 193, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames)
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/loader.py", line 481, in loadTestsFromNames
    return unittest.TestLoader.loadTestsFromNames(self, names, module)
  File "/Users/nttoole/.pyenv/versions/3.10.5/lib/python3.10/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/Users/nttoole/.pyenv/versions/3.10.5/lib/python3.10/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/loader.py", line 454, in loadTestsFromName
    return LazySuite(
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/suite.py", line 53, in __init__
    super(LazySuite, self).__init__()
  File "/Users/nttoole/.pyenv/versions/3.10.5/lib/python3.10/unittest/suite.py", line 22, in __init__
    self._tests = []
  File "/Users/nttoole/Development/ait/git_repos/py3.10_112822/venv/lib/python3.10/site-packages/nose/suite.py", line 106, in _set_tests
    if isinstance(tests, collections.Callable) and not is_suite:
AttributeError: module 'collections' has no attribute 'Callable'

@christianmkuss
Copy link
Author

Hmm, looks like nose is no longer maintained and doesn't support Python 3.9+ (nose-devs/nose#1099). I was able to run the tests with pytest --ignore ait/dsn/bin/examples and can completely remove nose as a dependency by changing

with nose.tools.assert_raises(ImportError):

in ait/dsn/encrypt/test/test_encrypt.py to

with pytest.raises(ImportError):

If you want to fully transition to pytest and drop nose I can add that to this PR. Otherwise I don't think there is a way to run the tests with 3.10.

@nttoole
Copy link
Contributor

nttoole commented Dec 9, 2022

@christianmkuss I believe our plan is to fully transition to pytest (as part of transitioning the GUI and DSN to poetry builds). So yes, if you wouldn't mind including those changes with the PR, we would appreciate it. Thanks

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 NASA-AMMOS#199
Copy link

sonarcloud bot commented Sep 18, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.10 Support
2 participants