diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 2c19cbee348..2e178927525 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -11,7 +11,9 @@ body: 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 + 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. + + Finally, if you are opening **a bug report related to PyScript.com** please [use this repository instead](https://github.com/anaconda/pyscript-dot-com-issues/issues/new/choose). Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐! - type: checkboxes diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3d816e9750b..591e81853a0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,12 +4,9 @@ ## Changes - + ## Checklist - - -- [ ] All tests pass locally -- [ ] I have updated `CHANGELOG.md` -- [ ] I have created documentation for this(if applicable) +- [ ] I have checked `make build` works locally. +- [ ] I have created / updated documentation for this change (if applicable). diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..e29bff2bead --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Keep GitHub Actions up to date with GitHub's Dependabot... +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" # Group all Actions updates into a single larger pull request + schedule: + interval: weekly diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 6bbb666f2cd..43fe719dbf1 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -7,7 +7,7 @@ on: defaults: run: - working-directory: ./pyscript.core + working-directory: ./core jobs: prepare-release: @@ -17,12 +17,27 @@ jobs: uses: actions/checkout@v4 - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x + + - name: Python venv + run: python -m venv env + + - name: Activate Python + run: source env/bin/activate + + - name: Update pip + run: pip install --upgrade pip + + - name: Install PyMinifier + run: pip install --ignore-requires-python python-minifier + + - name: Install Setuptools + run: pip install setuptools - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -35,20 +50,20 @@ jobs: ${{ runner.os }}- - name: NPM Install - run: npm install && npx playwright install + run: npm install && npx playwright install chromium - name: Build run: npm run build - name: Generate index.html working-directory: . - run: sed 's#_PATH_#./#' ./public/index.html > ./pyscript.core/dist/index.html + run: sed -e 's#_PATH_#./#' -e 's#_DOC_VERSION_#latest#' -e 's#_TAG_VERSION_##' -e 's#_VERSION_#latest#' ./public/index.html > ./core/dist/index.html - name: Zip dist folder run: zip -r -q ./build.zip ./dist - name: Prepare Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: draft: true prerelease: true diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 36828477dc5..5c605299dbc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -6,7 +6,7 @@ on: defaults: run: - working-directory: ./pyscript.core + working-directory: ./core jobs: publish-release: @@ -19,12 +19,27 @@ jobs: uses: actions/checkout@v4 - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x + + - name: Python venv + run: python -m venv env + + - name: Activate Python + run: source env/bin/activate + + - name: Update pip + run: pip install --upgrade pip + + - name: Install PyMinifier + run: pip install --ignore-requires-python python-minifier + + - name: Install Setuptools + run: pip install setuptools - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -37,14 +52,18 @@ jobs: ${{ runner.os }}- - name: npm install - run: npm install && npx playwright install + run: npm install && npx playwright install chromium - name: build run: npm run build - name: Generate index.html in snapshot working-directory: . - run: sed 's#_PATH_#https://pyscript.net/releases/${{ github.ref_name }}/#' ./public/index.html > ./pyscript.core/dist/index.html + run: sed -e 's#_PATH_#https://pyscript.net/releases/${{ github.ref_name }}/#' -e 's#_DOC_VERSION_#${{ github.ref_name }}#' -e 's#_TAG_VERSION_#/tag/${{ github.ref_name }}#' -e 's#_VERSION_#${{ github.ref_name }}#' ./public/index.html > ./core/dist/index.html + + - name: Generate release.tar from snapshot and put it in dist/ + working-directory: . + run: tar -cvf ../release.tar * && mv ../release.tar . - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 944a26f3981..b7f51d52ae7 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -10,7 +10,7 @@ on: defaults: run: - working-directory: ./pyscript.core + working-directory: ./core jobs: publish-snapshot: @@ -23,12 +23,27 @@ jobs: uses: actions/checkout@v4 - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x + + - name: Python venv + run: python -m venv env + + - name: Activate Python + run: source env/bin/activate + + - name: Update pip + run: pip install --upgrade pip + + - name: Install PyMinifier + run: pip install --ignore-requires-python python-minifier + + - name: Install Setuptools + run: pip install setuptools - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -41,7 +56,7 @@ jobs: ${{ runner.os }}- - name: Install Dependencies - run: npm install && npx playwright install + run: npm install && npx playwright install chromium - name: Build Pyscript.core run: npm run build @@ -54,7 +69,7 @@ jobs: - name: Generate index.html in snapshot working-directory: . - run: sed 's#_PATH_#https://pyscript.net/snapshots/${{ inputs.snapshot_version }}/#' ./public/index.html > ./pyscript.core/dist/index.html + run: sed -e 's#_PATH_#https://pyscript.net/snapshots/${{ inputs.snapshot_version }}/#' -e 's#_DOC_VERSION_#${{ inputs.snapshot_version }}#' -e 's#_TAG_VERSION_#/tag/${{ inputs.snapshot_version }}#' -e 's#_VERSION_#${{ inputs.snapshot_version }}#' ./public/index.html > ./core/dist/index.html - name: Copy to Snapshot run: > diff --git a/.github/workflows/publish-unstable.yml b/.github/workflows/publish-unstable.yml index f2a1df45491..89a0e2b8902 100644 --- a/.github/workflows/publish-unstable.yml +++ b/.github/workflows/publish-unstable.yml @@ -1,11 +1,11 @@ name: "Publish Unstable" on: - push: # Only run on merges into main that modify files under pyscript.core/ and examples/ + push: # Only run on merges into main that modify files under core/ and examples/ branches: - main paths: - - pyscript.core/** + - core/** - examples/** workflow_dispatch: @@ -18,18 +18,33 @@ jobs: contents: read defaults: run: - working-directory: ./pyscript.core + working-directory: ./core steps: - name: Checkout uses: actions/checkout@v4 - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x + + - name: Python venv + run: python -m venv env + + - name: Activate Python + run: source env/bin/activate + + - name: Update pip + run: pip install --upgrade pip + + - name: Install PyMinifier + run: pip install --ignore-requires-python python-minifier + + - name: Install Setuptools + run: pip install setuptools - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -42,14 +57,14 @@ jobs: ${{ runner.os }}- - name: NPM Install - run: npm install && npx playwright install + run: npm install && npx playwright install chromium - name: Build run: npm run build - name: Generate index.html in snapshot working-directory: . - run: sed 's#_PATH_#https://pyscript.net/unstable/#' ./public/index.html > ./pyscript.core/dist/index.html + run: sed -e 's#_PATH_#./#' -e 's#_DOC_VERSION_#latest#' -e 's#_TAG_VERSION_##' -e 's#_VERSION_#latest#' ./public/index.html > ./core/dist/index.html - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7b83be7730..785b7cbbf3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,20 +5,20 @@ on: branches: - main paths: - - pyscript.core/** + - core/** - .github/workflows/test.yml pull_request: # Only run on merges into main that modify certain files branches: - main paths: - - pyscript.core/** + - core/** - .github/workflows/test.yml workflow_dispatch: jobs: BuildAndTest: - runs-on: ubuntu-latest-8core + runs-on: ubuntu-latest env: MINICONDA_PYTHON_VERSION: py38 MINICONDA_VERSION: 4.11.0 @@ -37,12 +37,12 @@ jobs: run: git log --graph -3 - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -55,7 +55,7 @@ jobs: ${{ runner.os }}- - name: setup Miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 - name: Create and activate virtual environment run: | @@ -69,24 +69,12 @@ jobs: make setup - name: Build - run: make build + run: make build # Integration tests run in the build step. - - name: Integration Tests - #run: make test-integration-parallel - run: | - make test-integration - - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pyscript path: | - pyscript.core/dist/ + core/dist/ if-no-files-found: error retention-days: 7 - - - uses: actions/upload-artifact@v3 - if: success() || failure() - with: - name: test_results - path: test_results/ - if-no-files-found: error diff --git a/.github/workflows/test_report.yml b/.github/workflows/test_report.yml deleted file mode 100644 index 6debdbdce4d..00000000000 --- a/.github/workflows/test_report.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Test Report -on: - workflow_run: - workflows: ['\[CI\] Test'] - types: - - completed -jobs: - report: - runs-on: ubuntu-latest-8core - steps: - - uses: dorny/test-reporter@v1.6.0 - with: - artifact: test_results - name: Test reports - path: "*.xml" - reporter: java-junit diff --git a/.gitignore b/.gitignore index d19ac9a9b6d..6ccef40cf9e 100644 --- a/.gitignore +++ b/.gitignore @@ -142,10 +142,11 @@ coverage/ test_results # @pyscript/core npm artifacts -pyscript.core/core.* -pyscript.core/dist -pyscript.core/dist.zip -pyscript.core/src/plugins.js -pyscript.core/src/stdlib/pyscript.js -pyscript.core/src/3rd-party/* -!pyscript.core/src/3rd-party/READMEmd +core/test-results/* +core/core.* +core/dist +core/dist.zip +core/src/plugins.js +core/src/stdlib/pyscript.js +core/src/3rd-party/* +!core/src/3rd-party/READMEmd diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ae4bdb5fc6..b18b22ee168 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,10 +4,10 @@ ci: #skip: [eslint] autoupdate_schedule: monthly -default_stages: [commit] +default_stages: [pre-commit] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-builtin-literals - id: check-case-conflict @@ -21,33 +21,33 @@ repos: - id: check-yaml - id: detect-private-key - id: end-of-file-fixer - exclude: pyscript\.core/dist|\.min\.js$ + exclude: core/dist|\.min\.js$ - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 25.1.0 hooks: - id: black - exclude: pyscript\.core/src/stdlib/pyscript/__init__\.py + exclude: core/tests + args: ["-l", "88", "--skip-string-normalization"] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell # See 'pyproject.toml' for args - exclude: \.js\.map$ + exclude: fs\.py|\.js\.map$ additional_dependencies: - tomli + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.8 + hooks: + - id: ruff + exclude: core/tests + - repo: https://github.com/hoodmane/pyscript-prettier-precommit rev: "v3.0.0-alpha.6" hooks: - id: prettier - exclude: pyscript\.core/test|pyscript\.core/dist|pyscript\.core/types|pyscript.core/src/stdlib/pyscript.js|pyscript\.sw/|pyscript.core/src/3rd-party + exclude: core/tests|core/dist|core/types|core/src/stdlib/pyscript.js|pyscript\.sw/|core/src/3rd-party args: [--tab-width, "4"] - - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort (python) - args: [--profile, black] diff --git a/.prettierignore b/.prettierignore index bff93a895e5..32b310b5153 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,3 @@ ISSUE_TEMPLATE *.min.* package-lock.json -docs -examples/panel.html diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index b5324a7e886..00000000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,28 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-20.04 - tools: - python: miniconda3-4.7 - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -conda: - environment: docs/environment.yml - -# If using Sphinx, optionally build your docs in additional formats such as PDF -# formats: -# - pdf - -# Optionally declare the Python requirements required to build your docs -python: - install: - - requirements: docs/requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index c536d8c4907..00000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,87 +0,0 @@ -# Release Notes - -## 2023.05.01 - -### Features - -- Added the `xterm` attribute to `py-config`. When set to `True` or `xterm`, an (output-only) [xterm.js](http://xtermjs.org/) terminal will be used in place of the default py-terminal. -- The default version of Pyodide is now `0.23.2`. See the [Pyodide Changelog](https://pyodide.org/en/stable/project/changelog.html#version-0-23-2) for a detailed list of changes. -- Added the `@when` decorator for attaching Python functions as event handlers -- The `py-mount` attribute on HTML elements has been deprecated, and will be removed in a future release. - -#### Runtime py- attributes - -- Added logic to react to `py-*` attributes changes, removal, `py-*` attributes added to already live nodes but also `py-*` attributes added or defined via injected nodes (either appended or via `innerHTML` operations). ([#1435](https://github.com/pyscript/pyscript/pull/1435)) - -#### <script type="py"> - -- Added the ability to optionally use ` + +
+ + + +