Skip to content

Commit

Permalink
Remove deprecated StrictVersion usage (Fixes #85)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jul 16, 2022
1 parent c79961d commit 02a8392
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.6', '3.7', '3.8', '3.9', 'pypy3']
python: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.8']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions src/flask_moment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from distutils.version import StrictVersion
from datetime import datetime
from packaging.version import parse as version_parse
from markupsafe import Markup
from flask import current_app

Expand Down Expand Up @@ -92,7 +92,7 @@ def include_moment(cls, version=default_moment_version, local_js=None,
elif version is not None:
if with_locales:
js_filename = 'moment-with-locales.min.js' \
if StrictVersion(version) >= StrictVersion('2.8.0') \
if version_parse(version) >= version_parse('2.8.0') \
else 'moment-with-langs.min.js'
else:
js_filename = 'moment.min.js'
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=flake8,py36,py37,py38,py39,pypy3,docs
envlist=flake8,py36,py37,py38,py39,py310,pypy3,docs
skip_missing_interpreters=true

[gh-actions]
Expand All @@ -8,7 +8,8 @@ python =
3.7: py37
3.8: py38
3.9: py39
pypy3: pypy3
3.10: py310
pypy-3: pypy3

[testenv]
commands=
Expand Down

0 comments on commit 02a8392

Please sign in to comment.