Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all: build_plugin

build_plugin:
hatch build

clean:
rm -rf dist
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you already have some version of Thonny *that includes Python 3.8+* on your c

1. Download and install the Thonny IDE from [https://github.com/thonny/thonny/releases](https://github.com/thonny/thonny/releases). Expanding the *Assets* will reveal the downloads for Windows/macOS/Linux --

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/01-download-thonny.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/01-download-thonny.png)

For your convenience, here are direct links to the downloads for Thonny 4.1.7:

Expand All @@ -23,41 +23,41 @@ If you already have some version of Thonny *that includes Python 3.8+* on your c

2. Start Thonny. If you're running it for the first time, just accept the *Standard* settings.

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/02-start-splash.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/02-start-splash.png)

3a. Once Thonny is open, select *Tools > Manage packages...*

Then search for and install the __py5__ library --

3b. Still in Thonny, select *Tools > Manage plugins...*

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/03.01-manage-plug-ins.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/03.01-manage-plug-ins.png)

Then search for and install the __thonny-py5mode__ plug-in --

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/03.02-install-plug-in.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/03.02-install-plug-in.png)

You must __restart Thonny__ after this step.

4. When you've restarted Thonny, select *py5 > Imported mode for py5* --

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/04.01-activate-imported-mode.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/04.01-activate-imported-mode.png)

Click *Proceed* to download, extract, and set up JDK-17 (if you need to know: the plug-in installs JDK in the Thonny user-config directory). Thonny only needs to download JDK the first time you switch to imported mode.

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/04.02-download-jdk.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/04.02-download-jdk.png)

You'll be notified once this process completes --

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/04.03-download-jdk-done.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/04.03-download-jdk-done.png)

5. *This step is optional.* There are several Thonny settings that I recommend you apply for working with py5 (including a Processing 4 inspired theme, Kyanite). You can apply those settings in one simple step using *py5 > Apply recommended py5 settings*

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/05-apply-recommended-settings.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/05-apply-recommended-settings.png)

6. When the py5 *Imported mode for py5* option is checked, Thonny can run your py5 code --

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/06.01-imported-activated.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/06.01-imported-activated.png)

Test out an [imported mode](https://py5coding.org/content/py5_modes.html#imported-mode) sketch by clicking the green play button (or using the F5 or Ctrl+R keyboard shortcuts). Here is some code:

Expand All @@ -70,7 +70,7 @@ If you already have some version of Thonny *that includes Python 3.8+* on your c
rect(mouse_x, mouse_y, 10, 10)
```

![](https://raw.githubusercontent.com/tabreturn/thonny-py5mode/main/screenshots/06.02-running-sketch.png)
![](https://raw.githubusercontent.com/py5coding/thonny-py5mode/main/screenshots/06.02-running-sketch.png)

NOTE: This mode also runs [static mode](https://py5coding.org/content/py5_modes.html#static-mode) sketches (when you don't need a `draw()` function for animation).

Expand Down Expand Up @@ -101,7 +101,7 @@ Note that module mode requires an `import py5` and `run_sketch()` line, and `py5

py5 is a new version of Processing for Python 3.8+. It makes the Java Processing jars available to the CPython interpreter using JPype. It can do just about everything Processing can do, except with Python instead of Java code. Here are some useful py5 resources (alphabetically listed) --

* [py5 cheatsheet](https://raw.githubusercontent.com/tabreturn/processing.py-cheat-sheet/master/py5/py5_cc.pdf)
* [py5 cheatsheet](https://raw.githubusercontent.com/py5coding/processing.py-cheat-sheet/master/py5/py5_cc.pdf)
* [py5 discussions/forum](https://github.com/py5coding/py5generator/discussions)
* [py5 documentation](https://py5coding.org/)
* [py5 examples](https://github.com/py5coding/py5examples)
Expand All @@ -116,4 +116,4 @@ Thanks [villares](https://github.com/villares/thonny-py5-runner) for inspiring m

## Todo List

See [discussions on GitHub repo](https://github.com/tabreturn/thonny-py5mode/discussions/17). This plug-in is a work in progress ... please report issues [here](https://github.com/tabreturn/thonny-py5mode/issues).
See [discussions on GitHub repo](https://github.com/py5coding/thonny-py5mode/discussions/17). This plug-in is a work in progress ... please report issues [here](https://github.com/py5coding/thonny-py5mode/issues).
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "thonny-py5mode"
dynamic = ["version"]
description = "py5 mode plugin for Thonny"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
{ name = "Jim Schmitz", email = "jim@ixora.io" },
{ name = "Alexandre Villares", email = "abav@lugaralgum.com" },
]
classifiers = [
"Environment :: Plugins",
"Topic :: Multimedia :: Graphics",
"Topic :: Text Editors :: Integrated Development Environments (IDE)",
]
dependencies = [
"install-jdk==1.1.0",
"py5",
"pyperclip==1.9.0",
]

[project.urls]
Homepage = "https://github.com/py5coding/thonny-py5mode"

[tool.hatch.version]
path = "thonnycontrib/thonny-py5mode/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["/thonnycontrib"]

[tool.hatch.build.targets.sdist]
include = [
"/thonnycontrib",
]
40 changes: 2 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,2 @@
import pathlib
from setuptools import setup

version = pathlib.Path(__file__).parent.absolute()
version = version / 'thonnycontrib/thonny-py5mode/_version.py'
exec(open(version).read())

README = (pathlib.Path(__file__).parent / 'README.md').read_text()

setup(
name='thonny-py5mode',
version=__version__,
description='py5 mode plugin for Thonny',
long_description=README,
long_description_content_type='text/markdown',
url='https://github.com/tabreturn/thonny-py5mode',
author='tabreturn',
author_email='thonny-py5mode@tabreturn.com',
license='MIT',
classifiers=[
# https://pypi.org/pypi?%3Aaction=list_classifiers
'Environment :: Plugins',
'Topic :: Multimedia :: Graphics',
'Topic :: Text Editors :: Integrated Development Environments (IDE)'
],
packages=[
'thonnycontrib.backend',
'thonnycontrib.kyanite_theme_syntax',
'thonnycontrib.kyanite_theme_ui',
'thonnycontrib.thonny-py5mode',
'thonnycontrib.thonny-py5mode.py5colorpicker.tkcolorpicker'
],
install_requires=[
'install-jdk==1.1.0',
'py5',
'pyperclip==1.9.0'
]
)
# setup.py shim for use with applications that require it.
__import__("setuptools").setup()
Loading