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

Drop unsupported pythons #1

Merged
merged 2 commits into from
Jul 8, 2022
Merged

Conversation

matthewhughes934
Copy link
Owner

@matthewhughes934 matthewhughes934 commented Jul 8, 2022

Drop support for pythons <3.7 (including python 2).

Since this makes it part of the standard library, replace mock with
unittest.mock in tests. I also bumped the ubuntu version used in CI to
one that has python3.10 installable.

This also required replacing nose with pytest in tests This is
because nose is not under active development[1], and the version
specified fails to run on python3 (and newer versions fail to run on
python3.10[2]):

$ python -m nose
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/mjh/src/pystatsd/.venv/lib/python3.10/site-packages/nose/__init__.py", line 1, in <module>
    from nose.core import collector, main, run, run_exit, runmodule
  File "/home/mjh/src/pystatsd/.venv/lib/python3.10/site-packages/nose/core.py", line 143
    print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

pytest is pinned at the lowest version supporting python3.10[3],
similarly for coverage[4], flake8 was also bump to a more recent
version.

[1] https://nose.readthedocs.io/en/latest/#note-to-users
[2] nose-devs/nose#1122
[3] https://docs.pytest.org/en/7.1.x/changelog.html#pytest-6-2-5-2021-08-29
[4] https://coverage.readthedocs.io/en/6.4.1/changes.html#version-6-0-2021-10-03

@matthewhughes934 matthewhughes934 force-pushed the drop-unsupported-pythons branch 4 times, most recently from fafbe77 to c979628 Compare July 8, 2022 14:10
Drop support for pythons <3.7 (including python 2).

Since this makes it part of the standard library, replace `mock` with
`unittest.mock` in tests. I also bumped the ubuntu version used in CI to
one that has python3.10 installable.

This also required replacing `nose` with `pytest` in tests This is
because `nose` is not under active development[1], and the version
specified fails to run on python3 (and newer versions fail to run on
python3.10[2]):

    $ python -m nose
    Traceback (most recent call last):
      File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
        __import__(pkg_name)
      File "/home/mjh/src/pystatsd/.venv/lib/python3.10/site-packages/nose/__init__.py", line 1, in <module>
        from nose.core import collector, main, run, run_exit, runmodule
      File "/home/mjh/src/pystatsd/.venv/lib/python3.10/site-packages/nose/core.py", line 143
        print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

`pytest` is pinned at the lowest version supporting python3.10[3],
similarly for coverage[4], `flake8` was also bump to a more recent
version.

[1] https://nose.readthedocs.io/en/latest/#note-to-users
[2] nose-devs/nose#1122
[3] https://docs.pytest.org/en/7.1.x/changelog.html#pytest-6-2-5-2021-08-29
[4] https://coverage.readthedocs.io/en/6.4.1/changes.html#version-6-0-2021-10-03
Following the previous commit. This is just the result of running:

        $ git ls-files -- '*.py' | xargs pyupgrade --py37-plus
@matthewhughes934 matthewhughes934 merged commit 67fd3a3 into master Jul 8, 2022
@matthewhughes934 matthewhughes934 deleted the drop-unsupported-pythons branch July 8, 2022 18:46
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.

1 participant