Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:berinhard/pyp5js into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
berinhard committed Oct 18, 2021
2 parents ef3ba21 + 1ddb595 commit bf19d2a
Show file tree
Hide file tree
Showing 128 changed files with 4,685 additions and 3,681 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Development
-----------

0.7.0
-----
- Remove `from pyp5js import *` requirement under transcrypt [PR #183](https://github.com/berinhard/pyp5js/pull/183/)
- Make local code editor collapsible [PR #184](https://github.com/berinhard/pyp5js/pull/184/)
- Add `mouseWheel` event to Pyodide's demo [PR #185](https://github.com/berinhard/pyp5js/pull/185/)

0.6.0
-----
- Add transcrypt interpreter choice to web editor [PR #175](https://github.com/berinhard/pyp5js/pull/175)
Expand Down
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Contributing to pyp5js

Here you'll find all possible ways to contribute to the project.

### Testing, testing and testing

Since pyp5js have a lot of moving parts, it would be great to have the p5.js API fully covered and tested. So, use your imagination, code your sketches and, if pyp5js breaks or starts to annoy you with something, you're very welcome to [open an issue](https://github.com/berinhard/pyp5js/issues/new) documenting your thoughts. Test it and let me know how can I improve it.

### What about these shinning examples?

If you fell confortable with that, I'd be happy to add some of your pyp5js sketches to our [examples list](https://berinhard.github.io/pyp5js/examples/)! To do so, you'll have [to fork this repository](https://help.github.com/en/articles/fork-a-repo) and add your new sketch example in the `docs/examples` directory. Once you've your sketch ready, you can [open a pull request](https://help.github.com/en/articles/about-pull-requests) and I'll take a look at it.

### I want to hack!

Okay, if you want to contribute with pyp5js's code, let's go! I really advise you to use [virtualenv with virtualenvwrapper](http://www.indjango.com/python-install-virtualenv-and-virtualenvwrapper/) or [pyenv](https://amaral.northwestern.edu/resources/guides/pyenv-tutorial) to isolate your pyp5js fork from the rest of your system. Once you have everything ready, you can run:

```
$ git clone git@github.com:YOUR_GITHUB_PROFILE/pyp5js.git
$ cd pyp5js
$ pip install -r dev-requirements.txt
$ python setup.py develop
$ make test
```

After that, you should have the `pyp5js` command enabled and it will respect all the changes you introduce to the code. Now, a brief explanation about the code under `pyp5js` directory:

- `config` module: centralize pieces of code used to configure how `pyp5js` runs
- `cli.py`: the entrypoint for `pyp5js` commands such as `new` or `compile`
- `commands.py`: just functions responsible for the real implementations for `pyp5js` commands
- `compiler.py`: where all the magic happens!
- `exception.py`: custom exceptions used by `pyp5js`
- `monitor.py`: module with the objects used by the `monitor` command
- `sketch.py`: class to abstract Sketches' files, directories and configuration
- `template_renderers.py`: simple module with the renderization logic for the code templates like `target_sketch.py`
- `http/web_app.py`: Flask application for the web interface.

Now go [fetch yourself an issue](https://github.com/berinhard/pyp5js/issues) and happy hacking!
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ upload_pypi:

# helper command for the maintainer to refresh the docs files
refresh_transcrypt_docs:
cd docs/examples/transcrypt; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/transcrypt" pyp5js compile $$x --refresh; done;
cd docs/examples/transcrypt; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/transcrypt/" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/index.html.template"; done;

refresh_pyodide_docs:
cd docs/examples/pyodide; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/pyodide" pyp5js compile $$x --refresh; done;
cd docs/examples/pyodide; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/pyodide" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/pyodide/index.html.template"; done;

refresh_demo:
SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/" pyp5js compile pyodide --refresh --template "/home/bernardo/envs/pyp5js/docs/pyodide/index.html.template";
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0
0.7.0
2 changes: 2 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ pytest-env==0.6.2
Flask-Testing==0.8.0
blinker==1.4
pyaml==20.4.0
wheel==0.37.0
twine==3.4.2
3 changes: 0 additions & 3 deletions docs/examples/transcrypt/sketch_001/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
<code>
# https://p5js.org/examples/interaction-wavemaker.html


from pyp5js import *

t = 0

def setup():
Expand Down
3 changes: 0 additions & 3 deletions docs/examples/transcrypt/sketch_001/sketch_001.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# https://p5js.org/examples/interaction-wavemaker.html


from pyp5js import *

t = 0

def setup():
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ class Exception (BaseException):
#__pragma__ ('kwargs')
def __init__ (self, *args, **kwargs):
self.__args__ = args
try:
if kwargs.error != None:
self.stack = kwargs.error.stack # Integrate with JavaScript Error object
except:
elif Error:
self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
else:
self.stack = 'No stack trace available'
#__pragma__ ('nokwargs')

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/transcrypt/sketch_001/target/pyp5js.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bf19d2a

Please sign in to comment.