-
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* re-organize dirs + start using hatch * setup root pyproject.toml + basic invoke tasks * add publish task * more ruff fixes * get workflows to run * split up script runs * rename to check * change matrix order * make ruff happy * get tests to pass * check semver * more fixes * ignore missing coverage * fix cov * fix import sort * try build in env-js * try latest hatch-build-scripts * misc fixes * try to fix npm in gh action * do not set registry url by default * allow re-runs * no need for extra build * fix doc build and tests * remove scripts * fix tests * update contributor guide
- Loading branch information
Showing
198 changed files
with
3,859 additions
and
1,916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
name: Nox Session | ||
name: hatch-run | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
job-name: | ||
required: true | ||
type: string | ||
nox-args: | ||
hatch-run: | ||
required: true | ||
type: string | ||
nox-session-args: | ||
required: false | ||
type: string | ||
runs-on-array: | ||
required: false | ||
type: string | ||
|
@@ -20,6 +17,10 @@ on: | |
required: false | ||
type: string | ||
default: '["3.x"]' | ||
node-registry-url: | ||
required: false | ||
type: string | ||
default: "" | ||
secrets: | ||
node-auth-token: | ||
required: false | ||
|
@@ -29,30 +30,30 @@ on: | |
required: false | ||
|
||
jobs: | ||
nox-session: | ||
hatch: | ||
name: ${{ format(inputs.job-name, matrix.python-version, matrix.runs-on) }} | ||
strategy: | ||
matrix: | ||
runs-on: ${{ fromJson(inputs.runs-on-array) }} | ||
python-version: ${{ fromJson(inputs.python-version-array) }} | ||
runs-on: ${{ fromJson(inputs.runs-on-array) }} | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14.x" | ||
registry-url: "https://registry.npmjs.org" | ||
registry-url: ${{ inputs.node-registry-url }} | ||
- name: Pin NPM Version | ||
run: npm install -g [email protected] | ||
- name: Use Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python Dependencies | ||
run: pip install -r requirements/nox-deps.txt | ||
- name: Run Sessions | ||
run: pip install hatch poetry | ||
- name: Run Scripts | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.node-auth-token }} | ||
PYPI_USERNAME: ${{ secrets.pypi-username }} | ||
PYPI_PASSWORD: ${{ secrets.pypi-password }} | ||
run: nox ${{ inputs.nox-args }} --stop-on-first-error -- ${{ inputs.nox-session-args }} | ||
run: hatch run ${{ inputs.hatch-run }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
test-py-cov: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "python-{0}" | ||
hatch-run: "test-py" | ||
lint-py: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "python-{0}" | ||
hatch-run: "lint-py" | ||
test-py-matrix: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "python-{0} {1}" | ||
hatch-run: "test-py --no-cov" | ||
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]' | ||
python-version-array: '["3.9", "3.10", "3.11"]' | ||
test-docs: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "python-{0}" | ||
hatch-run: "test-docs" | ||
test-js: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "{1}" | ||
hatch-run: "test-js" | ||
lint-js: | ||
uses: ./.github/workflows/.hatch-run.yml | ||
with: | ||
job-name: "{1}" | ||
hatch-run: "lint-js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# --- Build Artifacts --- | ||
src/reactpy/_client | ||
|
||
# --- Jupyter --- | ||
*.ipynb_checkpoints | ||
*Untitled*.ipynb | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,42 +8,26 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - | |
RUN apt-get install -yq nodejs build-essential | ||
RUN npm install -g [email protected] | ||
|
||
# Create Python Venv | ||
# ------------------ | ||
ENV VIRTUAL_ENV=/opt/venv | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
RUN pip install --upgrade pip | ||
|
||
# Install ReactPy | ||
# Install Pipx | ||
# ------------ | ||
COPY requirements ./requirements | ||
RUN pip install -r requirements/build-docs.txt | ||
RUN pip install pipx | ||
|
||
# Copy Files | ||
# ---------- | ||
COPY LICENSE ./ | ||
COPY src ./src | ||
COPY scripts ./scripts | ||
COPY setup.py ./ | ||
COPY pyproject.toml ./ | ||
COPY MANIFEST.in ./ | ||
COPY README.md ./ | ||
RUN pip install .[all] | ||
|
||
# COPY License | ||
# ----------- | ||
COPY LICENSE /app/ | ||
|
||
# Build the Docs | ||
# -------------- | ||
COPY docs/__init__.py ./docs/ | ||
COPY docs/app.py ./docs/ | ||
COPY docs/examples.py ./docs/ | ||
COPY docs/source ./docs/source | ||
COPY docs ./docs | ||
COPY branding ./branding | ||
RUN sphinx-build -v -W -b html docs/source docs/build | ||
|
||
# Install and Build Docs | ||
# ---------------------- | ||
WORKDIR /app/docs | ||
RUN pipx run poetry install | ||
RUN pipx run poetry run sphinx-build -v -W -b html source build | ||
|
||
# Define Entrypoint | ||
# ----------------- | ||
ENV PORT 5000 | ||
ENV REACTPY_DEBUG_MODE=1 | ||
ENV REACTPY_CHECK_VDOM_SPEC=0 | ||
CMD python scripts/run_docs.py | ||
CMD pipx run poetry run python main.py |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import os | ||
|
||
from docs_app.app import make_app | ||
|
||
app = make_app("docs_prod_app") | ||
|
||
|
||
def main() -> None: | ||
app.run( | ||
host="0.0.0.0", # noqa: S104 | ||
port=int(os.environ.get("PORT", 5000)), | ||
workers=int(os.environ.get("WEB_CONCURRENCY", 1)), | ||
debug=bool(int(os.environ.get("DEBUG", "0"))), | ||
) |
Oops, something went wrong.