Skip to content

Commit

Permalink
docs: Update CONTRIBUTING.md to mention uv (langflow-ai#3965)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ogabrielluiz authored Sep 30, 2024
1 parent f873309 commit bbeaf68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
24 changes: 6 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


## Reporting bugs or suggesting improvements

Our [GitHub issues](https://github.com/langflow-ai/langflow/issues) page is kept up to date
Expand All @@ -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)
so it only becomes visible on click, making the issue easier to read and follow.


## 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

Expand All @@ -50,23 +48,24 @@ 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.

### Prepare the environment

Setting up hooks:

```bash
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)

Langflow can run locally by cloning the repository and installing the dependencies. We recommend using a virtual environment to isolate the dependencies from your system.

Before you start, make sure you have the following installed:

- Poetry (>=1.4)
- uv (>=0.4)
- Node.js

Then, in the root folder, install the dependencies and start the development server for the backend:
Expand All @@ -81,17 +80,6 @@ And the 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

The documentation is built using [Docusaurus](https://docusaurus.io/). To run the documentation locally, run the following commands:
Expand All @@ -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.


## Opening a pull request

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.
Expand Down
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ patch: ## bump the version in langflow and langflow-base

# check for required 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 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; }
@$(MAKE) check_env
@echo "$(GREEN)All required tools are installed.$(NC)"
Expand Down Expand Up @@ -85,7 +83,7 @@ init: check_tools clean_python_cache clean_npm_cache ## initialize the project
@make install_frontend
@make build_frontend
@echo "$(GREEN)All requirements are installed.$(NC)"
@python -m langflow run
@uv run langflow run

######################
# CLEAN PROJECT
Expand Down Expand Up @@ -342,15 +340,6 @@ ifdef restore
mv uv.lock.bak uv.lock
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

Expand Down

0 comments on commit bbeaf68

Please sign in to comment.