Skip to content

Commit

Permalink
makefile & readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chemik-bit committed Dec 7, 2023
1 parent 0d85209 commit 048b145
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Running tests is essential for ensuring the integrity and functionality of the c

#### For Windows and Mac:

- Execute `pytest` in the command line.
- Execute `make test` in the command line.
- This command runs all test cases in the project.
- Ensure there are no failures; warnings can be ignored.
- Successful test runs indicate that the setup and project code are functioning correctly.
Expand Down
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
# Define shell to use
#SHELL := /bin/bash

# Define Python interpreter
#PYTHON_MAC := python3
#PYTHON_WINDOWS := python

# Define virtual environment directory
VENV := env

# Default target executed when no arguments are given to make.
default: test

test: ## run tests with pytest.
@echo "Running tests..."
@pytest --cov=salesgpt --cov-report=term-missing --cov-report=html
@echo "Tests executed."

# Set up the development environment
setup: install_poetry clone_repo install_dependencies

# Install Poetry for dependency management
install_poetry:
pip install -U pip setuptools
pip install poetry
@echo "Poetry installed."

# Clone the GitHub repository
clone_repo:
git clone https://github.com/filip-michalsky/SalesGPT.git
@echo "Repository cloned."

# Install project dependencies using Poetry
install_dependencies:
cd SalesGPT && poetry install
@echo "Dependencies installed."

# Clean up the environment
clean:
@echo "Cleaning up..."
rm -rf $(VENV)
rm -rf SalesGPT
@echo "Environment cleaned up."

.PHONY: default setup install_poetry clone_repo install_dependencies test clean

43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,26 +173,55 @@ sales_agent.step()

Make sure you have a **python >=3.8,<3.12**:

Create `.env` file just as our `.env.example` and put your API keys there by specifying a new line just as we have done.
Create a virtual environment at a location on your computer. We use the generic "env" name for our virtual environment in the setup. You can rename this, but make sure to then use this name later when working with the environment (also rename the VENV variable in the Makefile accordingly to be able to use make commands successfully):

#### For Windows:

- Open Command Prompt or PowerShell.
- Navigate to your project directory: `cd path\to\your\project`
- Create a virtual environment: `python -m venv env`
- Activate the virtual environment: `.\env\Scripts\activate`

#### For Mac:

- Open Terminal.
- Navigate to your project directory: `cd path/to/your/project`
- Create a virtual environment: `python3 -m venv env`
- Activate the virtual environment: `source env/bin/activate`

To deactivate a virtual environment after you have stopped using it simply run: `deactivate`

Install with pip
If you simply want to work with SalesGPT as an end user without local changes you can install from PyPI using:

`pip install salesgpt`

If you want to work on your own version of SalesGPT or contribute to our open-source version install by activating your virtual environment as aforementioned and then run:

`make setup`

For more detailed installation steps along with the reasons for doing each please visit CONTRIBUTING.md

## Run an Example AI Sales agent

`git clone && cd`
`git clone https://github.com/filip-michalsky/SalesGPT.git`
`cd SalesGPT`
Create `.env` file just as our `.env.example` and put your API keys there by specifying a new line just as we have done.
`python run.py --verbose True --config examples/example_agent_setup.json`

from your terminal.

## Test your setup

1. Activate your environment with `python >=3.8,<3.12 `
2. cd `SalesGPT`
3. `pytest`
1. Activate your environment as described above. (run `source env/bin/activate` on Unix-like systems and `.\env\Scripts\activate` on Windows. Replace *env* with the name of your virtual environment)
2. cd `SalesGPT` If you haven't already navigated to the SalesGPT home directory
3. `make test`

All tests should pass. Warnings can be ignored.

## Uninstall SalesGPT

All tests should pass.
To delete the virtual environment you used for SalesGPT programming and your SalesGPT repository from your system navigate to the directory where you installed your virtual environment and cloned SalesGPT and run:
`make clean`

## Deploy

Expand Down

0 comments on commit 048b145

Please sign in to comment.