From d8c3063813c56b04e03da45cdbb5d502ed883f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 20 Nov 2019 13:24:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=203rd=20party=20dep?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/index.rst | 1 - docs/bundledplugins/softwareupdate.rst | 2 +- docs/development/environment.rst | 17 ++++++--- docs/events/index.rst | 2 +- docs/plugins/mixins.rst | 2 +- docs/sphinxext/onlineinclude.py | 11 +++--- setup.py | 36 +++++++++---------- .../plugins/pluginmanager/__init__.py | 2 +- src/octoprint/util/__init__.py | 6 +++- tox.ini | 6 ++-- 10 files changed, 48 insertions(+), 37 deletions(-) diff --git a/docs/api/index.rst b/docs/api/index.rst index 6eb090eb1..5fef5214b 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -9,7 +9,6 @@ REST API general.rst version.rst - apps.rst connection.rst files.rst job.rst diff --git a/docs/bundledplugins/softwareupdate.rst b/docs/bundledplugins/softwareupdate.rst index f7f7bc956..d72735ec6 100644 --- a/docs/bundledplugins/softwareupdate.rst +++ b/docs/bundledplugins/softwareupdate.rst @@ -196,7 +196,7 @@ Version checks * ``checkout_folder``: (mandatory) The full path to the folder with a valid git repository to check. - * ``pypi_release``: Checks `pypi.org`_ for new releases of a specified package. + * ``pypi_release``: Checks `pypi.org `_ for new releases of a specified package. * ``package``: (mandatory) Name of the package which to check. diff --git a/docs/development/environment.rst b/docs/development/environment.rst index ea1110153..71c953de3 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -18,20 +18,29 @@ below. * `Git `_ * Checkout the OctoPrint sources from their Git repository: + * ``git clone -b devel https://github.com/foosel/OctoPrint.git`` + * Enter the checked out source folder: ``cd OctoPrint`` * Create virtual environments in the checked out source folder for both Python 2.7 and Python 3.7 to use for installing and running OctoPrint and its dependencies (this avoids potential versioning issues for the dependencies with system wide installed instances): - * PY2: ``virtualenv --python=python2 venv2`` - * PY3: ``virtualenv --python=python3 venv3`` + + * PY2: ``virtualenv --python=python2 venv2`` + * PY3: ``virtualenv --python=python3 venv3`` + * Activate one of the virtual environments: - * PY2: ``source venv2/bin/activate`` (Linux, macOS) or ``source venv2/Scripts/activate`` (Git Bash under Windows, see below) - * PY3: ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below) + + * PY2: ``source venv2/bin/activate`` (Linux, macOS) or ``source venv2/Scripts/activate`` (Git Bash under Windows, see below) + * PY3: ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below) + * Update ``pip`` in the virtual environment: + * ``pip install --upgrade pip`` + * Install OctoPrint in `"editable" mode `_, including its regular *and* development and plugin development dependencies: + * ``pip install -e .[develop,plugins]`` When the virtual environment is activated you can then: diff --git a/docs/events/index.rst b/docs/events/index.rst index 1e3c70b00..93a55066b 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -686,7 +686,7 @@ SettingsUpdated .. _sec-events-available_events-printer_profile: Printer Profile --------- +--------------- PrinterProfileModified A printer profile was modified. diff --git a/docs/plugins/mixins.rst b/docs/plugins/mixins.rst index 386ff3d26..105fb85e2 100644 --- a/docs/plugins/mixins.rst +++ b/docs/plugins/mixins.rst @@ -166,7 +166,7 @@ Now, the execution order of the ``on_after_startup`` method will be determined b This will result in the following messages to be generated: -.. code-block:: plain +.. code-block:: none Plugin B starting up Plugin C starting up diff --git a/docs/sphinxext/onlineinclude.py b/docs/sphinxext/onlineinclude.py index 4769faa21..d60b9af4b 100644 --- a/docs/sphinxext/onlineinclude.py +++ b/docs/sphinxext/onlineinclude.py @@ -11,7 +11,7 @@ import requests from contextlib import closing from sphinx.directives.code import LiteralIncludeReader, LiteralInclude, dedent_lines, \ - nodes, set_source_info, parselinenos, logger, container_wrapper + nodes, parselinenos, logger, container_wrapper if False: # For type annotation @@ -39,11 +39,10 @@ class OnlineIncludeReader(LiteralIncludeReader): return lines except (IOError, OSError): - raise IOError(_('Include file %r not found or reading it failed') % filename) + raise IOError('Include file %r not found or reading it failed' % filename) except UnicodeError: - raise UnicodeError(_('Encoding %r used for reading included file %r seems to ' - 'be wrong, try giving an :encoding: option') % - (self.encoding, filename)) + raise UnicodeError('Encoding %r used for reading included file %r seems to ' + 'be wrong, try giving an :encoding: option' % (self.encoding, filename)) class OnlineIncludeDirective(LiteralInclude): @@ -69,7 +68,7 @@ class OnlineIncludeDirective(LiteralInclude): text, lines = reader.read(location=location) retnode = nodes.literal_block(text, text, source=url) - set_source_info(self, retnode) + self.set_source_info(retnode) if self.options.get('diff'): # if diff is set, set udiff retnode['language'] = 'udiff' elif 'language' in self.options: diff --git a/setup.py b/setup.py index ae4ba6a9a..8bc5199b8 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ INSTALL_REQUIRES = [ # guarantee backwards compatibility for plugins and such with that # version, hence we need to pin to a lower version for now. See #1697 "tornado==4.5.3", # a memory leak was observed in tornado >= 5, see #2585 - "regex!=2018.11.6", # avoid broken 2018.11.6. See #2874 + "regex!=2018.11.6", # avoid broken 2018.11.6. See #2874 # anything below this should be checked on releases for new versions @@ -35,10 +35,10 @@ INSTALL_REQUIRES = [ "Flask-Principal>=0.4,<0.5", "Flask-Babel>=0.12,<0.13", "Flask-Assets>=0.12,<0.13", - "werkzeug>=0.15.1,<0.16", + "werkzeug>=0.16,<0.17", "cachelib>=0.1,<0.2", "PyYAML>=5.1,<6", - "markdown>=3.0,<3.1", + "markdown>=3.1,<3.2", "pyserial>=3.4,<3.5", "netaddr>=0.7.19,<0.8", "watchdog>=0.9.0,<0.10", @@ -47,33 +47,33 @@ INSTALL_REQUIRES = [ "pylru>=1.2,<1.3", "rsa>=4.0,<5", "pkginfo>=1.5.0.1,<1.6", - "requests>=2.21.0,<3", - "semantic_version>=2.6,<2.7", - "psutil>=5.6.1,<5.7", + "requests>=2.22.0,<3", + "semantic_version>=2.8,<2.9", + "psutil>=5.6.5,<5.7", "Click>=7,<8", "awesome-slugify>=1.6.5,<1.7", "feedparser>=5.2.1,<5.3", - "future>=0.17,<0.18", + "future>=0.18.2,<0.19", "websocket-client>=0.56,<0.57", - "wrapt>=1.11.1,<1.12", - "emoji>=0.5.1,<0.6", + "wrapt>=1.11.2,<1.12", + "emoji>=0.5.4,<0.6", "frozendict>=1.2,<1.3", - "sentry-sdk==0.7.7", + "sentry-sdk==0.13.2", "filetype>=1.0.5,<2" ] # Python 2 specific requirements INSTALL_REQUIRES_PYTHON2 = [ - "futures>=3.2,<3.3", + "futures>=3.3,<3.4", "monotonic>=1.5,<1.6", "scandir>=1.10,<1.11", "chainmap>=1.0.3,<1.1", - "typing>=3.6.6,<4" + "typing>=3.7.4.1,<4" ] # OSX specific requirements INSTALL_REQUIRES_OSX = [ - "appdirs>=1.4.0", + "appdirs>=1.4.3", ] # Additional requirements for optional install options @@ -81,8 +81,8 @@ EXTRA_REQUIRES = dict( # Dependencies for developing OctoPrint develop=[ # Testing dependencies - "mock>=2.0.0,<3", - "pytest>=4.2.1,<5.0", + "mock>=3.0.5,<4", + "pytest==4.6.6", "pytest-doctest-custom>=1.0.0,<1.1", "ddt", @@ -90,11 +90,11 @@ EXTRA_REQUIRES = dict( "flake8", # Documentation dependencies - "sphinx>=1.6,<1.7", + "sphinx>=1.8.5,<2", "sphinxcontrib-httpdomain", - "sphinxcontrib-mermaid>=0.3", + "sphinxcontrib-mermaid>=0.3.1", "sphinx_rtd_theme", - "readthedocs-sphinx-ext==0.5.7" + "readthedocs-sphinx-ext==1.0.1" ], # Dependencies for developing OctoPrint plugins diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index 228ae25fd..d1a988eb8 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -866,7 +866,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, inapplicable_arguments = self.__class__.PIP_INAPPLICABLE_ARGUMENTS.get(args[0], list()) for inapplicable_argument in inapplicable_arguments: - additional_args = re.sub("(^|\s)" + re.escape(inapplicable_argument) + "\\b", "", additional_args) + additional_args = re.sub(r"(^|\s)" + re.escape(inapplicable_argument) + r"\\b", "", additional_args) if additional_args: args.append(additional_args) diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index f173ceb09..921485f04 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -1541,7 +1541,11 @@ class CountedEvent(object): class InvariantContainer(object): def __init__(self, initial_data=None, guarantee_invariant=None): - from collections import Iterable + try: + from collections import Iterable + except ImportError: + # Python >= 3.8 + from collections.abc import Iterable from threading import RLock if guarantee_invariant is None: diff --git a/tox.ini b/tox.ini index 98d3b08fb..c34682f92 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -envlist = py27,py37,flake8 +envlist = py27,py37,py38,flake8 [testenv] passenv = APPDATA setenv = PY_IGNORE_IMPORTMISMATCH = 1 deps = - mock>=2.0.0,<3 - pytest>=4.2.1,<5.0 + mock>=3.0.5,<4 + pytest==4.6.6 pytest-doctest-custom>=1.0.0,<1.1 ddt commands = pytest