Skip to content

Commit

Permalink
Merge branch 'main' into metadata-format
Browse files Browse the repository at this point in the history
  • Loading branch information
fpliger committed May 27, 2022
2 parents 142abc1 + 5d733ab commit b58886b
Show file tree
Hide file tree
Showing 126 changed files with 746 additions and 4,533 deletions.
63 changes: 63 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Bug Report
description: Create a report to help us improve
labels: ["type: bug", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Thanks for helping PyScript! 🐍
Going through bugs and issues takes up a lot of time, so please be so kind and take a few minutes to fill out all the areas to the best of your ability.
There will always be more issues than there is time to do them, and so we will need to selectively close issues that don't provide enough information, so we can focus our time on helping people like you who fill out the issue form completely. Thank you for your collaboration!
There are also already a lot of open issues, so please take 2 minutes and search through existing ones to see if what you are experiencing already exists
Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐!
- type: checkboxes
id: checks
attributes:
label: Checklist
description: Please confirm and check all the following options.
options:
- label: I added a descriptive title
required: true
- label: I searched for other issues and couldn't find a solution or duplication
required: true
- label: I already searched in Google and didn't find any good information or help
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: And what should have happened instead? This really helps everyone review quicker and greatly increases the chance that someone can get around to solve your issue
placeholder: Tell us what you see!
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on? (if applicable)
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Other
validations:
required: false
- type: textarea
id: list
attributes:
label: Console info
description: |
If there are errors in your browser console then its helpful to be able to troubleshoot.
- Chrome , Firefox, and Edge: Right-click on the page and select *Inspect*. Alternatively you can press F12 on your keyboard.
- Safari: Find instructions [here](https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac).
render: shell
- type: textarea
id: context
attributes:
label: Additional Context
description: Add any additional context information or screenshots you think are useful.
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://community.anaconda.cloud/c/tech-topics/pyscript
about: For questions or discussions about pyscript
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Feature Request
description: Create a feature request to make PyScript even better
labels: ["type: enhancement", "needs-triage"]
body:
- type: markdown
attributes:
value: |
### Thanks for helping PyScript! 🐍
Going through feature requests and issues takes up a lot of time, so please be so kind and take a few minutes to fill out all the areas to the best of your ability.
There will always be more great ideas than there is time to do them, and so we will need to selectively close issues that don't provide enough information, so everyone can focus our time on helping people like you who fill out the form completely. Thank you for your collaboration!
There are also already a lot of open requests, so please take 2 minutes and search through existing ones to see if your idea already exists. If you find something close, please upvote that request and comment.
Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐!
### Lets make sure you are in the right place. If you have an idea/request for:
- #### A specific package/library (such as pandas or scikit learn):
Search for that respective library on github repo or website. You will have much more success there.
- #### A general Python question/feature request:
Try out a forum post [here](https://discuss.python.org/c/users/7)
- type: checkboxes
id: checks
attributes:
label: Checklist
description: Please confirm and check all the following options
options:
- label: I added a descriptive title
required: true
- label: I searched for other feature requests and couldn't find a duplicate (including also the ``type-feature`` tag)
required: true
- label: I confirmed that it's not related to another project are area (see the above section)
required: true
- type: textarea
id: request-idea
attributes:
label: What is the idea?
description: Describe what the feature is and the desired state
placeholder: This feature would allow any user of PyScript to type in a simple command in the console and show all variables currently in use
validations:
required: true
- type: textarea
id: why
attributes:
label: Why is this needed
description: |
Who would benefit from this and why would this add value to them? What problem does this solve?
placeholder: This would benefit users who would like to see what is being used so they can learn and debug faster
- type: textarea
id: what
attributes:
label: What should happen?
description: |
What should be the user experience with the feature? Describe from a user perpective what they would do and see
placeholder: A user would type in ``PyScript debug`` in the browser console and see a list of all variables created.
- type: textarea
id: context
attributes:
label: Additional Context
description: |
Is there any other information that you think would be valuable for the team to know?
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Miscellaneous
description: For issues that don't belong in other categories
labels: ["type: misc", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Thanks for helping PyScript! 🐍
This issue is for things that doesn't make sense to put into the other issue categories and we don't want it to get lost.
Going through issues takes up a lot of time, so please be so kind and take a few minutes to fill out all the areas to the best of your ability.
There will always be more issues than there is time to do them, and so we will need to selectively close issues that don't provide enough information, so we can focus our time on helping people like you who fill out the issue form completely. Thank you for your collaboration!
There are also already a lot of open issues, so please take 2 minutes and search through existing ones to see if what you are experiencing already exists
Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐!
- type: checkboxes
id: checks
attributes:
label: Checklist
description: Please confirm and check all the following options.
options:
- label: I added a descriptive title
required: true
- label: I searched for other issues and couldn't find a duplication
required: true
- label: I already searched in Google and didn't find any good information or help
required: true
- type: textarea
id: what
attributes:
label: What is the issue/comment/problem?
description: This is a miscellaneous issue so this could be just about anything. We simply ask that you provide as many details as you can to help spur discussion or the outcome you want.
validations:
required: true
11 changes: 3 additions & 8 deletions .github/workflows/build-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,12 @@ jobs:
- name: setup Miniconda
uses: conda-incubator/setup-miniconda@v2

- name: Install dependencies
run: |
npm install
make setup
- name: Setup Environment
run: make setup

- name: Test pyscript
- name: Build and Test
run: make test

- name: Build pyscript
run: make build

# Deploy to S3
- name: Configure AWS credentials
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ jobs:
- name: setup Miniconda
uses: conda-incubator/setup-miniconda@v2

- name: Install dependencies
run: |
npm install
make setup
- name: Setup Environment
run: make setup

- name: Test pyscript
- name: Build and Test
run: make test

- name: Build pyscript
run: make build

# Deploy to S3
- name: Configure AWS credentials
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sync-examples.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: '[CI] Sync Examples'

on:
push: # Only run on merges into main that modify files under pyscriptjs/examples/
push: # Only run on merges into main that modify files under examples/
branches:
- main
paths:
- pyscriptjs/examples/**
- examples/**
- .github/workflows/sync-examples.yml # Test that workflow works when changed

jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
id-token: write
defaults:
run:
working-directory: pyscriptjs/examples
working-directory: examples

steps:

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
pyscriptjs/examples

# Translations
*.mo
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ repos:
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '4']
exclude: .github/ISSUE_TEMPLATE/.*\.yml$

- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PyScript is a Pythonic alternative to Scratch, JSFiddle, and other "easy to use"

To get started see the [getting started tutorial](docs/tutorials/getting-started.md).

For examples see [the pyscript folder](pyscriptjs).
For examples see [here](examples).

### Longer Version
PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.
Expand All @@ -24,7 +24,7 @@ You can then use PyScript components in your html page. PyScript currently imple
* `<py-script>`: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic
* `<py-repl>`: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code

Check out the [pyscriptjs/examples](pyscriptjs/examples) folder for more examples on how to use it, all you need to do is open them in Chrome.
Check out the [the examples directory](examples) folder for more examples on how to use it, all you need to do is open them in Chrome.

## How to Contribute

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In addition to the [Python Standard Library](https://docs.python.org/3/library/)
the `pyscript` module, many 3rd-party OSS packages will work out-of-the-box with PyScript.

In order to use them, you will need to declare the dependencies using the `<py-env>` tag in the
HTML head. You can also link to `.whl` files directly on disk like in our [toga example](https://github.com/pyscript/pyscript/blob/main/pyscriptjs/examples/toga/freedom.html).
HTML head. You can also link to `.whl` files directly on disk like in our [toga example](https://github.com/pyscript/pyscript/blob/main/examples/toga/freedom.html).

```
<py-env>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 12 additions & 15 deletions pyscriptjs/examples/panel.html → examples/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,27 @@
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.13.0-rc.10/dist/panel.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.13.1/dist/panel.min.js"></script>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<py-env>
- bokeh
- numpy
- panel==0.13.1
</py-env>
<body>
<py-env>
- bokeh
- numpy
- panel==0.13.1a2
</py-env>
<h1>Panel Example</h1>
<div id="myplot"></div>
<div id="simple_app"></div>
<py-script>
import asyncio
import panel as pn
import panel as pn

slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')

def callback(new):
return f'Amplitude is: {new}'
def callback(new):
return f'Amplitude is: {new}'

row = pn.Row(slider, pn.bind(callback, slider))

await pn.io.pyodide.show(row, 'myplot')
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app');
</py-script>
</body>
</html>
Loading

0 comments on commit b58886b

Please sign in to comment.