docs: Update CONTRIBUTING.md to mention uv (#3965)
* Remove Poetry check, update uv command, and remove dev target from Makefile * Update CONTRIBUTING.md to reflect new development setup and remove docker-compose instructions
This commit is contained in:
parent
f873309004
commit
bbeaf68a26
2 changed files with 7 additions and 30 deletions
|
|
@ -6,7 +6,6 @@ to contributions, whether it be in the form of a new feature, improved infra, or
|
||||||
|
|
||||||
To contribute to this project, please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow.
|
To contribute to this project, please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow.
|
||||||
|
|
||||||
|
|
||||||
## Reporting bugs or suggesting improvements
|
## Reporting bugs or suggesting improvements
|
||||||
|
|
||||||
Our [GitHub issues](https://github.com/langflow-ai/langflow/issues) page is kept up to date
|
Our [GitHub issues](https://github.com/langflow-ai/langflow/issues) page is kept up to date
|
||||||
|
|
@ -32,10 +31,9 @@ so that more people can benefit from it.
|
||||||
[collapses the content](https://developer.mozilla.org/en/docs/Web/HTML/Element/details)
|
[collapses the content](https://developer.mozilla.org/en/docs/Web/HTML/Element/details)
|
||||||
so it only becomes visible on click, making the issue easier to read and follow.
|
so it only becomes visible on click, making the issue easier to read and follow.
|
||||||
|
|
||||||
|
|
||||||
## Contributing code and documentation
|
## Contributing code and documentation
|
||||||
|
|
||||||
You can develop Langflow locally via Poetry + NodeJS or docker-compose.
|
You can develop Langflow locally via uv + NodeJS.
|
||||||
|
|
||||||
### Clone the Langflow Repository
|
### Clone the Langflow Repository
|
||||||
|
|
||||||
|
|
@ -50,15 +48,16 @@ git remote add fork https://github.com/<your username>/langflow.git
|
||||||
We also provide a .vscode/launch.json file for debugging the backend in VSCode, which is a lot faster than using docker compose.
|
We also provide a .vscode/launch.json file for debugging the backend in VSCode, which is a lot faster than using docker compose.
|
||||||
|
|
||||||
### Prepare the environment
|
### Prepare the environment
|
||||||
|
|
||||||
Setting up hooks:
|
Setting up hooks:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make init
|
make init
|
||||||
```
|
```
|
||||||
|
|
||||||
This will install the pre-commit hooks, which will run `make format` on every commit.
|
This will set up the development environment by installing backend and frontend dependencies, building the frontend static files, and initializing the project. It runs `make install_backend`, `make install_frontend`, `make build_frontend`, and finally `uv run langflow run` to start the application.
|
||||||
|
|
||||||
It is advised to run `make lint` before pushing to the repository.
|
It is advised to run `make lint`, `make format`, and `make unit_tests` before pushing to the repository.
|
||||||
|
|
||||||
### Run locally (Poetry and Node.js)
|
### Run locally (Poetry and Node.js)
|
||||||
|
|
||||||
|
|
@ -66,7 +65,7 @@ Langflow can run locally by cloning the repository and installing the dependenci
|
||||||
|
|
||||||
Before you start, make sure you have the following installed:
|
Before you start, make sure you have the following installed:
|
||||||
|
|
||||||
- Poetry (>=1.4)
|
- uv (>=0.4)
|
||||||
- Node.js
|
- Node.js
|
||||||
|
|
||||||
Then, in the root folder, install the dependencies and start the development server for the backend:
|
Then, in the root folder, install the dependencies and start the development server for the backend:
|
||||||
|
|
@ -81,17 +80,6 @@ And the frontend:
|
||||||
make frontend
|
make frontend
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Run locally (docker compose)
|
|
||||||
|
|
||||||
The following snippet will run the backend and frontend in separate containers. The frontend will be available at `localhost:3000` and the backend at `localhost:7860`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker compose up --build
|
|
||||||
# or
|
|
||||||
make dev build=1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Run documentation
|
### Run documentation
|
||||||
|
|
||||||
The documentation is built using [Docusaurus](https://docusaurus.io/). To run the documentation locally, run the following commands:
|
The documentation is built using [Docusaurus](https://docusaurus.io/). To run the documentation locally, run the following commands:
|
||||||
|
|
@ -104,8 +92,8 @@ npm run start
|
||||||
|
|
||||||
The documentation will be available at `localhost:3000` and all the files are located in the `docs/docs` folder.
|
The documentation will be available at `localhost:3000` and all the files are located in the `docs/docs` folder.
|
||||||
|
|
||||||
|
|
||||||
## Opening a pull request
|
## Opening a pull request
|
||||||
|
|
||||||
Once you wrote and manually tested your change, you can start sending the patch to the main repository.
|
Once you wrote and manually tested your change, you can start sending the patch to the main repository.
|
||||||
|
|
||||||
- Open a new GitHub pull request with the patch against the `main` branch.
|
- Open a new GitHub pull request with the patch against the `main` branch.
|
||||||
|
|
|
||||||
13
Makefile
13
Makefile
|
|
@ -35,10 +35,8 @@ patch: ## bump the version in langflow and langflow-base
|
||||||
|
|
||||||
# check for required tools
|
# check for required tools
|
||||||
check_tools:
|
check_tools:
|
||||||
@command -v poetry >/dev/null 2>&1 || { echo >&2 "$(RED)Poetry is not installed. Aborting.$(NC)"; exit 1; }
|
|
||||||
@command -v uv >/dev/null 2>&1 || { echo >&2 "$(RED)uv is not installed. Aborting.$(NC)"; exit 1; }
|
@command -v uv >/dev/null 2>&1 || { echo >&2 "$(RED)uv is not installed. Aborting.$(NC)"; exit 1; }
|
||||||
@command -v npm >/dev/null 2>&1 || { echo >&2 "$(RED)NPM is not installed. Aborting.$(NC)"; exit 1; }
|
@command -v npm >/dev/null 2>&1 || { echo >&2 "$(RED)NPM is not installed. Aborting.$(NC)"; exit 1; }
|
||||||
@command -v docker >/dev/null 2>&1 || { echo >&2 "$(RED)Docker is not installed. Aborting.$(NC)"; exit 1; }
|
|
||||||
@command -v pipx >/dev/null 2>&1 || { echo >&2 "$(RED)pipx is not installed. Aborting.$(NC)"; exit 1; }
|
@command -v pipx >/dev/null 2>&1 || { echo >&2 "$(RED)pipx is not installed. Aborting.$(NC)"; exit 1; }
|
||||||
@$(MAKE) check_env
|
@$(MAKE) check_env
|
||||||
@echo "$(GREEN)All required tools are installed.$(NC)"
|
@echo "$(GREEN)All required tools are installed.$(NC)"
|
||||||
|
|
@ -85,7 +83,7 @@ init: check_tools clean_python_cache clean_npm_cache ## initialize the project
|
||||||
@make install_frontend
|
@make install_frontend
|
||||||
@make build_frontend
|
@make build_frontend
|
||||||
@echo "$(GREEN)All requirements are installed.$(NC)"
|
@echo "$(GREEN)All requirements are installed.$(NC)"
|
||||||
@python -m langflow run
|
@uv run langflow run
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# CLEAN PROJECT
|
# CLEAN PROJECT
|
||||||
|
|
@ -342,15 +340,6 @@ ifdef restore
|
||||||
mv uv.lock.bak uv.lock
|
mv uv.lock.bak uv.lock
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dev: ## run the project in development mode with docker compose
|
|
||||||
make install_frontend
|
|
||||||
ifeq ($(build),1)
|
|
||||||
@echo 'Running docker compose up with build'
|
|
||||||
docker compose $(if $(debug),-f docker-compose.debug.yml) up --build
|
|
||||||
else
|
|
||||||
@echo 'Running docker compose up without build'
|
|
||||||
docker compose $(if $(debug),-f docker-compose.debug.yml) up
|
|
||||||
endif
|
|
||||||
|
|
||||||
docker_build: dockerfile_build clear_dockerimage ## build DockerFile
|
docker_build: dockerfile_build clear_dockerimage ## build DockerFile
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue