Skip to content

Commit 9ec3a6a

Browse files
committed
➖ Remove python-dateutil dependency
It's no longer installable from source under OctoPi 0.14 due to an unpinned setup_requires dependency on setuptools_scm, and since we still have to support that installation scenario that is a problem. Thankfully it's only used in the plugin manager for parsing the notice date, and we can just use datetime.strptime for that.
1 parent ec2ba63 commit 9ec3a6a

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

THIRDPARTYLICENSES.md

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
3737
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
3838
* [Click](http://click.pocoo.org/): BSD
39-
* [dateutil](https://dateutil.readthedocs.io/): BSD
4039
* [emoji](https://github.com/carpedm20/emoji/): BSD
4140
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
4241
* [Flask](http://flask.pocoo.org/): BSD

setup.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
# the following dependencies are non trivial to update since later versions introduce backwards incompatible
2121
# changes that might affect plugins, or due to other observed problems
2222

23-
"flask>=0.10.1,<0.11", # newer versions require newer Jinja versions
24-
"Jinja2>=2.8.1,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
25-
# guarantee backwards compatibility for plugins and such with that
26-
# version, hence we need to pin to a lower version for now. See #1697
27-
"tornado==4.5.3", # a memory leak was observed in tornado >= 5, see #2585
28-
"Flask-Login>=0.2.11,<0.3", # some functions changed to properties in 0.3
29-
"regex!=2018.11.6", # avoid broken 2018.11.6. See #2874
23+
"flask>=0.10.1,<0.11", # newer versions require newer Jinja versions
24+
"Jinja2>=2.8.1,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
25+
# guarantee backwards compatibility for plugins and such with that
26+
# version, hence we need to pin to a lower version for now. See #1697
27+
"tornado==4.5.3", # a memory leak was observed in tornado >= 5, see #2585
28+
"Flask-Login>=0.2.11,<0.3", # some functions changed to properties in 0.3
29+
"regex!=2018.11.6", # avoid broken 2018.11.6. See #2874
3030

3131
# anything below this should be checked on releases for new versions
3232

@@ -55,7 +55,6 @@
5555
"future>=0.17.1,<0.18",
5656
"scandir>=1.10,<1.11",
5757
"websocket-client>=0.56,<0.57",
58-
"python-dateutil>=2.8,<2.9",
5958
"wrapt>=1.11.1,<1.12",
6059
"futures>=3.2,<3.3",
6160
"emoji>=0.5.1,<0.6",

src/octoprint/plugins/pluginmanager/__init__.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
import re
2929
import os
3030
import copy
31-
import dateutil.parser
3231
import time
3332
import threading
3433

34+
from datetime import datetime
35+
3536
_DATA_FORMAT_VERSION = "v2"
3637

3738

@@ -868,7 +869,12 @@ def _refresh_notices(self, notice_data=None):
868869
key = notice["plugin"]
869870

870871
try:
871-
parsed_date = dateutil.parser.parse(notice["date"])
872+
# Jekyll turns "%Y-%m-%d %H:%M:%SZ" into "%Y-%m-%d %H:%M:%S +0000", so be sure to ignore "+0000"
873+
#
874+
# Being able to use dateutil here would make things way easier but sadly that can no longer get
875+
# installed (from source) under OctoPi 0.14 due to its setuptools-scm dependency, so we have to do
876+
# without it for now until we can drop support for OctoPi 0.14.
877+
parsed_date = datetime.strptime(notice["date"], "%Y-%m-%d %H:%M:%S +0000")
872878
notice["timestamp"] = parsed_date.timetuple()
873879
except Exception as e:
874880
self._logger.warn("Error while parsing date {!r} for plugin notice "

0 commit comments

Comments
 (0)