Skip to content

Commit

Permalink
Build fixups (#1462)
Browse files Browse the repository at this point in the history
* (Ironically) ignore build script during package publication:
  - Avoids platform-specific wheels.
  - Ensures build script is not included in sdist.
* Remove legacy Node package build, now that poetry is leading.
* Run builds also for PR's to release branches.

The road to hell is paved with dirty workarounds.
  • Loading branch information
dokterbob authored Oct 25, 2024
1 parent 939fb99 commit 67de9c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_call:
workflow_dispatch:
pull_request:
branches: [main, dev]
branches: [main, dev, 'release/**']
push:
branches: [main, dev]
branches: [main, dev, 'release/**']

permissions: read-all

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
name: Install Python, poetry and Python dependencies
with:
poetry-working-directory: ${{ env.BACKEND_DIR }}
- name: Build Python distribution
run: poetry self add poetry-plugin-ignore-build-script && poetry build --ignore-build-script
working-directory: ${{ env.BACKEND_DIR }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
4 changes: 2 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Chainlit is an open-source async Python framework which allows developers to bui

Full documentation is available [here](https://docs.chainlit.io). You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/), an app built using Chainlit!

> [!NOTE]
> [!NOTE]
> Check out [Literal AI](https://literalai.com), our product to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and [seamlessly](https://docs.chainlit.io/data-persistence/overview) with Chainlit by adding a `LITERAL_API_KEY` in your project.
>
> Chainlit is developed and maintained by the Literal AI team, which is currently focused on expanding the capabilities of Literal AI. While we continue to support and maintain Chainlit, we are also committed to enabling the community to contribute, particularly in areas like integrations and data layers.
Expand All @@ -43,7 +43,7 @@ If this opens the `hello app` in your browser, you're all set!
The latest in-development version can be installed straight from GitHub with:

```sh
pip install git+https://github.com/Chainlit/chainlit.git@dokterbob/build_frontend_on_poetry_build#subdirectory=backend/
pip install git+https://github.com/Chainlit/chainlit.git#subdirectory=backend/
```

(Requires Node and pnpm installed on the system.)
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"formatUi": "cd frontend && pnpm run format",
"lintPython": "cd backend && poetry run mypy chainlit/ tests/",
"formatPython": "black `git ls-files | grep '.py$'` && isort --profile=black .",
"buildUi": "cd libs/react-client && pnpm run build && cd ../copilot && pnpm run build && cd ../../frontend && pnpm run build",
"build": "pnpm run buildUi && (mkdir -p backend/chainlit/frontend && cp -R frontend/dist backend/chainlit/frontend) && (mkdir -p backend/chainlit/copilot && cp -R libs/copilot/dist backend/chainlit/copilot) && (cd backend && poetry build)"
"buildUi": "cd libs/react-client && pnpm run build && cd ../copilot && pnpm run build && cd ../../frontend && pnpm run build"
},
"pnpm": {
"overrides": {
Expand Down

0 comments on commit 67de9c7

Please sign in to comment.