Compare commits

..
17 Commits
Author SHA1 Message Date
Gina Häußge 650d54d188 📌 rsa 4.1+ requires python 3
I really wish people would adhere to semver...
2020-07-08 10:02:54 +02:00
Gina Häußge a2510cf32a 🔖 Preparing release of 1.4.1rc2 2020-07-08 09:47:24 +02:00
Gina Häußge 42abcd7009 📝 Fix docs for virtual printer 2020-07-07 12:01:11 +02:00
Gina Häußge 736dca4d07 💚 Disable login tests for now
They aren't stable and currently can't be relied upon. For some reason
the page sometimes just doesn't reload in the test browsers.
2020-07-06 22:56:58 +02:00
Gina Häußge f2ca247731 💚 Fix cypress login test's wobbliness
Hopefully at least...
2020-07-06 22:30:36 +02:00
Gina Häußge fa148a8b7e 🐛 Fix async issue with logging on shutdown
Asynchronous components might be active after on_shutdown, and
AsyncLogHandlerMixin should be able to cope with logs generated by
them.

Closes #3629
2020-07-06 21:56:43 +02:00
Gina Häußge 20a3700a2c 🐛 Fix busy loop
Closes #3633
2020-07-06 21:49:18 +02:00
Gina Häußge f1cc40a87c 🐛 PMGR: Fix single file plugins under Py2.7
filetype dependency requires paths as str, so we need to make sure
we provide what will be identified as a native str type under both
py2 and 3.

Closes #3630
2020-07-06 18:31:30 +02:00
Gina Häußge a19c9366ed 🐛 Fix german translation
Contains some mismatched/broken tags causing severe rendering issues.

Closes #3628
2020-07-06 18:17:28 +02:00
Gina Häußge 46203fd43c 🐛 Fix auto detect with auto port and set baudrate
Closes #3627
2020-07-06 15:34:14 +02:00
Gina Häußge 38f1c74379 👷‍ Enable pypi push for releases 2020-07-06 15:12:08 +02:00
Gina Häußge 113dcd3fc9 🔖 staging/maintenance is now 1.4.1rc2.dev 2020-07-06 14:32:23 +02:00
Gina Häußge 0b471aae9e Merge branch 'rc/maintenance' into staging/maintenance 2020-07-06 14:29:56 +02:00
Gina Häußge 5b795014e2 Merge branch 'master' into staging/maintenance 2020-03-04 13:01:15 +01:00
Gina Häußge 504137d249 Merge branch 'rc/maintenance' into staging/maintenance 2020-03-03 12:37:34 +01:00
Gina Häußge fe7894fb5f Merge branch 'rc/maintenance' into staging/maintenance 2020-03-02 13:46:29 +01:00
Gina Häußge 38e8878ded Merge branch 'rc/maintenance' into staging/maintenance 2020-03-02 13:08:45 +01:00
19 changed files with 1280 additions and 2981 deletions

No files matched your search

+15 -15
View File
@@ -158,18 +158,18 @@ jobs:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
#publish-on-pypi:
# name: 📦 Publish tagged releases to PyPI
# if: github.event_name == 'release'
# needs: publish-on-testpypi
# runs-on: ubuntu-latest
# steps:
# - name: ⬇ Download build result
# uses: actions/download-artifact@v1
# with:
# name: dist
# path: dist
# - name: 📦 Publish to index
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.pypi_password }}
publish-on-pypi:
name: 📦 Publish tagged releases to PyPI
if: github.event_name == 'release'
needs: publish-on-testpypi
runs-on: ubuntu-latest
steps:
- name: ⬇ Download build result
uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: 📦 Publish to index
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
+4 -4
View File
@@ -26,11 +26,11 @@ improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.4.0rc7
# so is regressionfix/...
staging/maintenance 1.4.0rc7 d99af420acb9d5b18a4f60f9cae8abb458e131d4 pep440-dev
regressionfix/.* 1.4.0rc7 d99af420acb9d5b18a4f60f9cae8abb458e131d4 pep440-dev
staging/maintenance 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
regressionfix/.* 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
# staging/devel is currently inactive (but has the 1.4.0rc7 namespace)
staging/devel 1.4.0rc7 d99af420acb9d5b18a4f60f9cae8abb458e131d4 pep440-dev
# staging/devel is currently inactive (but has the 1.4.1rc2 namespace)
staging/devel 1.4.1rc2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
+1 -1
View File
@@ -66,4 +66,4 @@ thanks to everyone who contributed!
* Sven Mueller
* Ulrich Kempken
and 1886 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
and 1892 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
+2 -1
View File
@@ -10,6 +10,7 @@ Bundled Plugins
action_command_notification.rst
action_command_prompt.rst
announcements.rst
tracking.rst
appkeys.rst
backup.rst
discovery.rst
@@ -22,4 +23,4 @@ Bundled Plugins
pluginmanager.rst
printer_safety_check.rst
softwareupdate.rst
tracking.rst
virtual_printer.rst
+26
View File
@@ -0,0 +1,26 @@
.. _sec-bundledplugins-virtual_printer:
Virtual Printer
===============
The Virtual Printer plugin provides a virtual printer to connect to during development. It is able to simulate various
firmware quirks, communication issues and can be heavily configured through ``config.yaml``. See
:ref:`the development documentation on details and usage <sec-development-virtual-printer>`.
The virtual printer has been included in OctoPrint ever since the first releases back in 2013, however as of
OctoPrint 1.4.1 it has finally been fully extracted into its own bundled plugin.
.. _sec-bundledplugins-virtual_printer-configuration:
Configuring the plugin
----------------------
Please refer to :ref:`the development documentation <sec-development-virtual-printer-config>`.
.. _sec-bundledplugins-virtual_printer-sourcecode:
Source Code
-----------
The source of the Virtual Printer plugin is bundled with OctoPrint and can be
found in its source repository under ``src/octoprint/plugins/virtual_printer``.
+3 -5
View File
@@ -3,7 +3,7 @@
Setting up the virtual printer for debugging
============================================
OctoPrint includes, by default, a virtual printer plugin. This plugin allows you to debug OctoPrint's serial
OctoPrint includes, by default, a :ref:`virtual printer plugin <sec-bundledplugins-virtual_printer>`. This plugin allows you to debug OctoPrint's serial
communication without connecting to an actual printer. Furthermore, it is possible to create certain edge conditions
that may be hard to reproduce with a real printer.
@@ -19,9 +19,7 @@ The virtual printer can be enabled through its Settings pane.
Virtual printer configuration options
-------------------------------------
The config.yaml file has many configuration options for the virtual printer that allow you to fine-tune its behavior.
Please see the relevant :ref:`config.yaml section <sec-configuration-config_yaml-devel>` for the full details.
There many configuration options via ``config.yaml`` for the virtual printer that allow you to fine-tune its behavior:
.. code-block:: yaml
@@ -201,7 +199,7 @@ Log file
--------
Once activated, the virtual printer will log all serial communication in the ``plugin_virtual_printer_serial.log`` file
that can be found in the OctoPrint settings folder.
that can be found in the OctoPrint logs folder.
.. _sec-development-virtual-printer-debug:
+2 -2
View File
@@ -25,7 +25,7 @@ SETUP_REQUIRES = [
INSTALL_REQUIRES = [
# additional OctoPrint plugins that are maintained on a different release cycle
"OctoPrint-FirmwareCheck>=2020.06.22",
"OctoPrint-FileCheck>=2020.06.22",
"OctoPrint-FileCheck>=2020.07.06",
# the following dependencies are non trivial to update since later versions introduce backwards incompatible
# changes that might affect plugins, or due to other observed problems
@@ -33,6 +33,7 @@ INSTALL_REQUIRES = [
"markupsafe>=1.1,<2.0", # Jinja dependency, newer versions require Python 3
"tornado==5.1.1", # newer versions require Python 3
"markdown>=3.1,<3.2", # newer versions require Python 3
"rsa==4.0", # newer versions require Python 3
"regex!=2018.11.6", # avoid broken 2018.11.6. See #2874
# anything below this should be checked on releases for new versions
@@ -51,7 +52,6 @@ INSTALL_REQUIRES = [
"sarge==0.1.5post0",
"netifaces>=0.10.9,<1",
"pylru>=1.2,<2",
"rsa>=4.0,<5",
"pkginfo>=1.5.0.1,<2",
"requests>=2.23.0,<3",
"semantic_version>=2.8.5,<3",
+7
View File
@@ -16,6 +16,9 @@ class AsyncLogHandlerMixin(logging.Handler):
super(AsyncLogHandlerMixin, self).__init__(*args, **kwargs)
def emit(self, record):
if getattr(self._executor, "_shutdown", False):
return
try:
self._executor.submit(self._emit, record)
except Exception:
@@ -25,6 +28,10 @@ class AsyncLogHandlerMixin(logging.Handler):
# noinspection PyUnresolvedReferences
super(AsyncLogHandlerMixin, self).emit(record)
def close(self):
self._executor.shutdown(wait=True)
super(AsyncLogHandlerMixin, self).close()
class CleaningTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify
from flask_babel import gettext
SENTRY_URL_SERVER = "https://a928e3eb40864ed086f765d6976bf792@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://26fe846c0ff34995a39bbb67a04b3f42@o118517.ingest.sentry.io/1374096"
SENTRY_URL_SERVER = "https://183f89aa959044fa8ff4e2a55383ed36@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://fcd757c96a204000828449be1ba53d3b@o118517.ingest.sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False,
@@ -14,7 +14,7 @@ from octoprint.settings import valid_boolean_trues
from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking, check_etag
from octoprint.access import ADMIN_GROUP
from octoprint.access.permissions import Permissions
from octoprint.util import to_bytes, TemporaryDirectory
from octoprint.util import to_bytes, to_native_str, TemporaryDirectory
from octoprint.util.pip import LocalPipCaller
from octoprint.util.version import get_octoprint_version_string, get_octoprint_version, is_octoprint_compatible, is_python_compatible
from octoprint.util.platform import get_os, is_os_compatible
@@ -429,7 +429,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
if ext in PluginManagerPlugin.ARCHIVE_EXTENSIONS:
return True
kind = filetype.guess(path)
kind = filetype.guess(to_native_str(path))
if kind:
return ".{}".format(kind.extension) in PluginManagerPlugin.ARCHIVE_EXTENSIONS
return False
@@ -102,6 +102,7 @@ class TrackingPlugin(octoprint.plugin.SettingsPlugin,
if not self._settings.get_boolean(["enabled"]):
return
self._track_shutdown()
self._executor.shutdown(wait=True)
##~~ EventHandlerPlugin
+2
View File
@@ -903,6 +903,8 @@ class Server(object):
observer.stop()
observer.join()
eventManager.fire(events.Events.SHUTDOWN)
self._logger.info("Calling on_shutdown on plugins")
octoprint.plugin.call_plugin(octoprint.plugin.ShutdownPlugin,
"on_shutdown",
sorting_context="ShutdownPlugin.on_shutdown")
File diff suppressed because it is too large. Load diff
+26 -14
View File
@@ -2405,17 +2405,20 @@ class MachineCom(object):
else:
timeout = settings().getFloat(["serial", "timeout", "detection"])
def attempt_handshake():
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = monotonic_time() + timeout
log("Handshake attempt #{}".format(self._detection_retry + 1))
self._detection_retry += 1
self._do_send_without_checksum(b"", log=False) # new line to reset things
self.sayHello(tags={"trigger:detection", })
while len(self._detection_candidates) > 0:
if self._detection_retry < self.DETECTION_RETRIES:
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = monotonic_time() + timeout
log("Handshake attempt #{}".format(self._detection_retry + 1))
self._detection_retry += 1
self._do_send_without_checksum(b"", log=False) # new line to reset things
self.sayHello(tags={"trigger:detection", })
attempt_handshake()
return
else:
@@ -2429,13 +2432,12 @@ class MachineCom(object):
else:
self._serial.baudrate = b
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = monotonic_time() + timeout
log("Trying port {}, baudrate {}".format(p, b))
self._detection_retry = 0
attempt_handshake()
return
except Exception:
self._log("Unexpected error while setting baudrate {}: {}".format(b, get_exception_string()))
self._logger.exception("Unexpected error while setting baudrate {}".format(b))
@@ -5023,7 +5025,7 @@ class BufferedReadlineWrapper(wrapt.ObjectProxy):
timeout = serial.Timeout(self._timeout)
while not timeout.expired():
self._buffered += self.read(min(self.in_waiting, 1))
self._buffered += self.read(self.in_waiting)
# check for terminator, if it's there we have found our line
termpos = self._buffered.find(terminator)
@@ -5033,6 +5035,16 @@ class BufferedReadlineWrapper(wrapt.ObjectProxy):
del self._buffered[:termpos + termlen]
return bytes(line)
if timeout.expired():
break
c = self.read(1)
if not c:
# EOF
break
self._buffered += c
return b""
+1 -1
View File
@@ -42,7 +42,7 @@ describe('Connection test against virtual printer', () => {
.should('contain', 'Connect')
.click();
cy.get('#connection .accordion-inner')
cy.get('#connection .accordion-inner', {timeout: 10000})
.should('not.be.visible');
cy.get('#state .accordion-inner strong:first')
.should('contain', 'Operational');
+3 -2
View File
@@ -2,7 +2,8 @@ describe('Login tests', () => {
const username = 'admin';
const password = 'test';
context('Successful login', () => {
describe.skip('Successful login', () => {
it('logs in', () => {
cy.visit('/');
cy.get('#login-user')
@@ -76,7 +77,7 @@ describe('Login tests', () => {
})
});
context('Unauthorized', () => {
context('Unauthorized login attempts', () => {
it('uses wrong user name', () => {
cy.visit('/');
Binary file not shown.
File diff suppressed because it is too large. Load diff