-
Notifications
You must be signed in to change notification settings - Fork 14
Reorganize shinychat
into a monorepo
#56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6c2e263
3816f5b
cc36b9f
49bc4bc
1ef928a
c2ce16e
7af739e
d835495
35fed38
084033e
27a8f2a
7750aeb
92edaec
1b1233f
c1dbf3c
a962dfd
d0634f1
bc6f1a8
05daf9e
150a70c
c999229
711514d
99fd212
84fac05
86236c0
051a5ce
7f0dc35
24381e9
b460dd2
11ffd2c
080f5ca
3626e7b
f151339
30a7ebc
e064d63
fb78b61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: py-check.yaml | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- 'pkg-py/**/*' | ||
- 'pyproject.toml' | ||
- '.github/workflows/py-check.yaml' | ||
pull_request: | ||
paths: | ||
- 'pkg-py/**/*' | ||
- 'pyproject.toml' | ||
- '.github/workflows/py-check.yaml' | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
UV_VERSION: "0.7.x" | ||
|
||
jobs: | ||
py-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 🚀 Install uv | ||
uses: astral-sh/[email protected] | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
|
||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
run: uv python install ${{ matrix.python-version }} | ||
|
||
- name: 📦 Install the project | ||
run: uv sync --python ${{ matrix.python-version }} --all-extras | ||
|
||
- name: 📜 Show uv.lock | ||
run: cat uv.lock | ||
|
||
- name: 🧪 Check tests | ||
run: make py-check-tests | ||
|
||
- name: 📝 Check types | ||
run: make py-check-types | ||
|
||
- name: 📐 Check formatting | ||
run: make py-check-format |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: py-release.yaml | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
UV_VERSION: "0.7.x" | ||
PYTHON_VERSION: 3.13 | ||
|
||
jobs: | ||
py-release: | ||
name: Build and release Python package | ||
runs-on: ubuntu-latest | ||
|
||
# Python release tags start with "py/v*" | ||
if: startsWith(github.ref, 'refs/tags/py/v') | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/shinychat/ | ||
|
||
permissions: # for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 🚀 Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
|
||
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }} | ||
run: uv python install ${{ env.PYTHON_VERSION }} | ||
|
||
- name: 📦 Install the project | ||
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras | ||
|
||
- name: 🧪 Check tests | ||
run: make py-check-tests | ||
|
||
- name: 📝 Check types | ||
run: make py-check-types | ||
|
||
- name: 📐 Check formatting | ||
run: make py-check-format | ||
|
||
- name: 🧳 Build package | ||
run: uv build | ||
|
||
# TODO: https://pypi.org/manage/project/shinychat/settings/publishing/ | ||
- name: 🚢 Publish release on PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "docs/**/*" | ||
- .github/workflows/quartodoc.yaml | ||
workflow_dispatch: | ||
|
||
name: quartodoc.yaml | ||
|
||
env: | ||
UV_VERSION: "0.7.x" | ||
PYTHON_VERSION: 3.13 | ||
QUARTO_VERSION: 1.7.31 | ||
|
||
jobs: | ||
docs-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # full history needed for correct versioning of py pkg | ||
|
||
- name: 🔵 Set up Quarto | ||
uses: quarto-dev/quarto-actions/setup@v2 | ||
with: | ||
version: ${{ env.QUARTO_VERSION }} | ||
|
||
- name: 🚀 Install uv | ||
uses: astral-sh/[email protected] | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
|
||
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }} | ||
run: uv python install ${{ env.PYTHON_VERSION }} | ||
|
||
- name: 📦 Install shinychat and dependencies | ||
run: uv sync --python ${{ env.PYTHON_VERSION }} --no-dev --extra docs | ||
|
||
- name: 🔌 Activate venv | ||
run: | | ||
source .venv/bin/activate | ||
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH | ||
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | ||
|
||
- name: 🏭 Update Python docs | ||
run: make py-docs | ||
|
||
- name: 🚢 Deploy to GitHub pages | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/[email protected] | ||
with: | ||
clean: false | ||
folder: docs | ||
branch: gh-pages |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Verify built assets | ||
|
||
on: | ||
push: | ||
branches: ["main", "rc-*"] | ||
pull_request: | ||
|
||
jobs: | ||
verify_js_built: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🔎 Extract node version from .nvmrc | ||
id: nvm | ||
working-directory: js | ||
run: | | ||
echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT | ||
|
||
- name: 🟡 Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "${{ steps.nvm.outputs.version }}" | ||
|
||
- name: 🆙 Install dependencies | ||
run: make js-setup-ci | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: 🏭 Build | ||
run: make js-build | ||
|
||
- name: 🧐 Check for uncommitted changes | ||
run: | | ||
if [[ `git status --porcelain` ]]; then | ||
git diff | ||
echo "Uncommitted changes found. Please commit any changes that result from 'make js-setup-ci js-build'." | ||
exit 1 | ||
else | ||
echo "No uncommitted changes found." | ||
fi | ||
working-directory: js |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,9 @@ | |
.RData | ||
.Ruserdata | ||
.Renviron | ||
docs | ||
_dev | ||
.venv | ||
docs/r | ||
docs/py | ||
_dev | ||
uv.lock | ||
.coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"Posit.air-vscode", | ||
"dbaeumer.vscode-eslint" | ||
gadenbuie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"[r]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "Posit.air-vscode" | ||
}, | ||
"[python]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit", | ||
"source.organizeImports": "explicit" | ||
}, | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascript]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "always" | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"typescript", | ||
"jsx", | ||
"tsx" | ||
], | ||
"quarto.path": "~/.local/share/qvm/versions/v1.7.31/bin/quarto", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels off There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is tricky because The idea here is that the Quarto version used in the project is controlled with the Unfortunately, It also means that in CI, we install |
||
"cSpell.words": [ | ||
"shinychat" | ||
], | ||
"python.testing.pytestArgs": [ | ||
"pkg-py" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
YEAR: 2024 | ||
COPYRIGHT HOLDER: Posit Software, PBC | ||
# MIT License | ||
|
||
Copyright (c) 2024 Posit Software, PBC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Uh oh!
There was an error while loading. Please reload this page.