Merge branch 'maintenance' into devel
# Conflicts: # .github/workflows/build.yml # docs/conf.py # docs/development/environment.rst # docs/sphinxext/codeblockext.py # docs/sphinxext/onlineinclude.py # setup.py # src/octoprint/access/groups.py # src/octoprint/access/permissions.py # src/octoprint/access/users.py # src/octoprint/cli/__init__.py # src/octoprint/cli/analysis.py # src/octoprint/cli/client.py # src/octoprint/cli/config.py # src/octoprint/cli/plugins.py # src/octoprint/cli/server.py # src/octoprint/cli/user.py # src/octoprint/environment.py # src/octoprint/events.py # src/octoprint/filemanager/__init__.py # src/octoprint/filemanager/analysis.py # src/octoprint/filemanager/destinations.py # src/octoprint/filemanager/storage.py # src/octoprint/filemanager/util.py # src/octoprint/logging/__init__.py # src/octoprint/logging/handlers.py # src/octoprint/plugin/__init__.py # src/octoprint/plugin/core.py # src/octoprint/plugins/action_command_notification/__init__.py # src/octoprint/plugins/action_command_prompt/__init__.py # src/octoprint/plugins/appkeys/__init__.py # src/octoprint/plugins/backup/__init__.py # src/octoprint/plugins/corewizard/__init__.py # src/octoprint/plugins/corewizard/subwizards.py # src/octoprint/plugins/discovery/__init__.py # src/octoprint/plugins/errortracking/__init__.py # src/octoprint/plugins/gcodeviewer/__init__.py # src/octoprint/plugins/logging/__init__.py # src/octoprint/plugins/pi_support/__init__.py # src/octoprint/plugins/softwareupdate/cli.py # src/octoprint/plugins/softwareupdate/updaters/single_file_plugin.py # src/octoprint/plugins/softwareupdate/updaters/sleep_a_bit.py # src/octoprint/plugins/softwareupdate/version_checks/always_current.py # src/octoprint/plugins/softwareupdate/version_checks/bitbucket_commit.py # src/octoprint/plugins/softwareupdate/version_checks/github_release.py # src/octoprint/plugins/softwareupdate/version_checks/httpheader.py # src/octoprint/plugins/softwareupdate/version_checks/jsondata.py # src/octoprint/plugins/softwareupdate/version_checks/never_current.py # src/octoprint/plugins/softwareupdate/version_checks/pypi_release.py # src/octoprint/plugins/tracking/__init__.py # src/octoprint/plugins/virtual_printer/virtual.py # src/octoprint/printer/__init__.py # src/octoprint/printer/estimation.py # src/octoprint/printer/profile.py # src/octoprint/printer/standard.py # src/octoprint/server/__init__.py # src/octoprint/server/api/__init__.py # src/octoprint/server/api/system.py # src/octoprint/server/api/users.py # src/octoprint/server/util/flask.py # src/octoprint/server/util/tornado.py # src/octoprint/server/util/webassets.py # src/octoprint/settings.py # src/octoprint/slicing/__init__.py # src/octoprint/timelapse.py # src/octoprint/util/__init__.py # src/octoprint/util/comm.py # src/octoprint/util/commandline.py # src/octoprint/util/connectivity.py # src/octoprint/util/fixes.py # src/octoprint/util/gcodeInterpreter.py # src/octoprint/util/jinja.py # src/octoprint/util/json/__init__.py # src/octoprint/util/net.py # src/octoprint_client/__init__.py # src/octoprint_setuptools/__init__.py # tests/filemanager/test_filemanager.py # tests/filemanager/test_localstorage.py # tests/plugin/test_core.py # tests/plugin/test_settings.py # tests/plugin/test_types_blueprint.py # tests/plugin/test_types_settings.py # tests/server/api/test_system.py # tests/server/util/test_flask.py # tests/server/util/test_tornado.py # tests/slicing/test_slicingmanager.py # tests/test_daemon.py # tests/timelapse/test_timelapse_helpers.py # tests/util/test_comm.py # tests/util/test_file_helpers.py # tests/util/test_pip.py # tests/util/test_repeated_timer.py # tests/util/test_resettable_timer.py # versioneer.py
This commit is contained in:
commit
18e6bfc7f8
377 files changed
+77456
-60363
No files matched your search
@@ -33,7 +33,8 @@ below.
|
||||
binary cannot be found on your ``PATH`` like this you'll need to specify the full path to it here,
|
||||
e.g. ``virtualenv --python=/path/to/python3/bin/python venv``
|
||||
|
||||
* Activate one of the virtual environments:
|
||||
* Activate one of the virtual environments (the Python 3 venv should be considered the
|
||||
primary one at this point):
|
||||
|
||||
* ``source venv/bin/activate`` (Linux, macOS) or ``source venv/Scripts/activate`` (Git Bash under Windows, see below)
|
||||
|
||||
@@ -46,10 +47,20 @@ below.
|
||||
|
||||
* ``pip install -e '.[develop,plugins,docs]'``
|
||||
|
||||
* Set up the pre-commit hooks that make sure any changes you do adhere to the styling rules:
|
||||
|
||||
* ``pre-commit install``
|
||||
|
||||
* Tell ``git`` where to find the file with revisions to exclude for ``git blame``:
|
||||
|
||||
* ``git config blame.ignoreRevsFile .git-blame-ignore-revs``
|
||||
|
||||
When the virtual environment is activated you can then:
|
||||
|
||||
* run the OctoPrint server via ``octoprint serve``
|
||||
* run the test suite from the checked out source folder via ``pytest``
|
||||
* trigger the pre-commit check suite manually from the checked out source folder via
|
||||
``pre-commit run --hook-stage manual --all-files``
|
||||
|
||||
To switch the activated virtual environment, simply activate the new environment as described above.
|
||||
|
||||
@@ -95,14 +106,12 @@ Then:
|
||||
cd ~/devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv --python=python2 venv2
|
||||
virtualenv --python=python3 venv3
|
||||
source ./venv2/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
source ./venv3/bin/activate
|
||||
virtualenv --python=python3 venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins,docs]
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
You can then start OctoPrint via ``octoprint`` after activating one of the two virtual environments.
|
||||
|
||||
@@ -133,14 +142,12 @@ Open the Git Bash you just installed and in that:
|
||||
cd /c/Devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv --python=C:\Python27\python.exe venv2
|
||||
virtualenv --python=C:\Python38\python.exe venv3
|
||||
source ./venv2/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
source ./venv3/Scripts/activate
|
||||
virtualenv --python=C:\Python38\python.exe venv
|
||||
source ./venv/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins,docs]
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
@@ -190,6 +197,8 @@ You'll need a user account with administrator privileges.
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
pre-commit install
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
@@ -211,11 +220,9 @@ PyCharm
|
||||
- Register virtual environments:
|
||||
|
||||
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...",
|
||||
select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2`` or ``C:\Devel\OctoPrint\venv2``).
|
||||
select OctoPrint ``venv`` folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``).
|
||||
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." >
|
||||
"Virtualenv Environment > "Existing Environment", select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2``).
|
||||
|
||||
Repeat for the ``venv3`` folder.
|
||||
"Virtualenv Environment > "Existing Environment", select OctoPrint ``venv`` folder (e.g. ``~/devel/OctoPrint/venv``).
|
||||
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
@@ -260,7 +267,7 @@ PyCharm
|
||||
* Module name: ``sphinx.cmd.build``
|
||||
* Parameters: ``-v -T -E ./docs ./docs/_build -b html``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: ``venv3`` environment (the docs build requires Python 3)
|
||||
* Python interpreter: ``venv`` environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update when building
|
||||
the documentation, see above on how to set this up.
|
||||
@@ -268,6 +275,18 @@ PyCharm
|
||||
Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as
|
||||
described above via ``pip install -e .[develop,plugins,docs]``.
|
||||
|
||||
- Settings > Tools > File Watchers (you might have to enable this, it's a bundled plugin), add new:
|
||||
|
||||
* Name: pre-commit
|
||||
* File type: Python
|
||||
* Scope: Module 'OctoPrint'
|
||||
* Program: ``$PyInterpreterDirectory$/bin/pre-commit`` (Linux) or ``$PyInterpreterDirectory$/Scripts/pre-commit`` (Windows)
|
||||
* Arguments: ``run --hook-stage manual --files $FilePath$``
|
||||
* Output paths to refresh: ``$FilePath$``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
* disable "Auto-save edited files to trigger the watched"
|
||||
* enable "Trigger the watched on external changes"
|
||||
|
||||
To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restart
|
||||
OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.
|
||||
Otherwise go through Settings.
|
||||
|
||||
Reference in new issue
Block a user