Target branch: Pull requests should target the dev branch.
Description: Briefly describe the changes in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests for the changes?
Code Review: Have you self-reviewed your code and addressed any coding standard issues?
Description
Packaging open-webui as a Python package with minimum modification. It is not rye-only, any package support PEP 517 can build and package at the root of this project.
I also noticed that openwebui is currently not token in pypi.org, maybe it is a better choice?
after packaging and publishing to pypi, we can declare namespace package as plugin system, then langchain agent support could be easily implemented.
Changelog Entry
Added
Python packaging
Changed
Use file relative (relative path to backend/config.py) instead of pwd relative path in backend/config.py, so it can start backend at the root directory of this project.
Additional Information
now we can produce the wheel file and sdist for publishing
$ rye build # file will place at dist/$ rye publish # after you config pypi account, you can upload the backend file to Pypi.org
backend/requirements.txt, backend/dev.sh, backend/start.sh and backend/start_windows.bat now can be removed, but weather delete them or not is depend on you.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/2245
**Author:** [@tcztzy](https://github.com/tcztzy)
**Created:** 5/14/2024
**Status:** ✅ Merged
**Merged:** 5/22/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `dev`
---
### 📝 Commits (3)
- [`d5a4ab4`](https://github.com/open-webui/open-webui/commit/d5a4ab46f49c3b99b63a28084ee7b6d92edd806d) changed: packaging using rye and use file relative path instead of pwd relative.
- [`a018df2`](https://github.com/open-webui/open-webui/commit/a018df2734595080112d61c28b8c3cae5f6cca05) infra: build
- [`b609896`](https://github.com/open-webui/open-webui/commit/b60989627ef1b790bb86bbfe3763bfb4efd023c7) add: github action
### 📊 Changes
**8 files changed** (+1612 additions, -17 deletions)
<details>
<summary>View changed files</summary>
➕ `.github/workflows/ci.yml` (+31 -0)
📝 `backend/apps/web/internal/db.py` (+4 -2)
📝 `backend/config.py` (+21 -15)
➕ `backend/open_webui/__init__.py` (+60 -0)
➕ `hatch_build.py` (+21 -0)
➕ `pyproject.toml` (+115 -0)
➕ `requirements-dev.lock` (+680 -0)
➕ `requirements.lock` (+680 -0)
</details>
### 📄 Description
…d relative.
## Pull Request Checklist
- [x] **Target branch:** Pull requests should target the `dev` branch.
- [x] **Description:** Briefly describe the changes in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests for the changes?
- [x] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues?
---
## Description
Packaging `open-webui` as a Python package with minimum modification. It is not [rye](https://github.com/astral-sh/rye)-only, any package support PEP 517 can build and package at the root of this project.
I also noticed that `openwebui` is currently not token in pypi.org, maybe it is a better choice?
after packaging and publishing to pypi, we can declare namespace package as plugin system, then langchain agent support could be easily implemented.
---
### Changelog Entry
### Added
- Python packaging
### Changed
- Use file relative (relative path to `backend/config.py`) instead of pwd relative path in `backend/config.py`, so it can start backend at the root directory of this project.
---
### Additional Information
- now we can produce the wheel file and sdist for publishing
```console
$ rye build # file will place at dist/
$ rye publish # after you config pypi account, you can upload the backend file to Pypi.org
```
- `backend/requirements.txt`, `backend/dev.sh`, `backend/start.sh` and `backend/start_windows.bat` now can be removed, but weather delete them or not is depend on you.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/2245
Author: @tcztzy
Created: 5/14/2024
Status: ✅ Merged
Merged: 5/22/2024
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (3)
d5a4ab4changed: packaging using rye and use file relative path instead of pwd relative.a018df2infra: buildb609896add: github action📊 Changes
8 files changed (+1612 additions, -17 deletions)
View changed files
➕
.github/workflows/ci.yml(+31 -0)📝
backend/apps/web/internal/db.py(+4 -2)📝
backend/config.py(+21 -15)➕
backend/open_webui/__init__.py(+60 -0)➕
hatch_build.py(+21 -0)➕
pyproject.toml(+115 -0)➕
requirements-dev.lock(+680 -0)➕
requirements.lock(+680 -0)📄 Description
…d relative.
Pull Request Checklist
devbranch.Description
Packaging
open-webuias a Python package with minimum modification. It is not rye-only, any package support PEP 517 can build and package at the root of this project.I also noticed that
openwebuiis currently not token in pypi.org, maybe it is a better choice?after packaging and publishing to pypi, we can declare namespace package as plugin system, then langchain agent support could be easily implemented.
Changelog Entry
Added
Changed
backend/config.py) instead of pwd relative path inbackend/config.py, so it can start backend at the root directory of this project.Additional Information
backend/requirements.txt,backend/dev.sh,backend/start.shandbackend/start_windows.batnow can be removed, but weather delete them or not is depend on you.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.