Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,37 @@ To set up the development environment:

1. **Clone the Repository**:

```bash
git clone https://github.com/plexe-ai/plexe.git
cd plexe
```
```bash
git clone https://github.com/plexe-ai/plexe.git
cd plexe
```

2. **Install Dependencies**:

```
-pip install poetry
-poetry env activate or poetry shell depending on the Poetry version being used
-python setup.py
```

```bash
pip install poetry
# Enter the virtual environment bubble.
# Modern Poetry uses 'shell', while older versions might need 'env activate'
poetry shell
# OR: poetry env activate (for older versions or specific setups)

# Install specific extras as needed (e.g. AWS, PySpark)
# Note: pyspark and databricks-connect are mutually exclusive
poetry install -E aws -E pyspark

# Run setup.py to configure pre-commit hooks
python setup.py
```

3. **Run Tests**:

```bash
pytest
```
```bash
# If 'poetry shell' above was successful, you can run directly:
pytest

# If you encounter "ModuleNotFoundError", use the more robust:
poetry run pytest
```

Ensure all tests pass before making contributions.

Expand All @@ -103,6 +115,6 @@ Write clear and concise commit messages:

- **Example**:

```bash
feat(model): add support for gemini
```
```bash
feat(model): add support for gemini
```
16 changes: 10 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
"""
Setup script for the plexe project.

Installs core dependencies and configures pre-commit hooks.
"""

import subprocess
import sys
import shlex


def run_command(command):
try:
subprocess.run(command, check=True, shell=True)
# shell=False is safer; command should be a list of arguments
if isinstance(command, str):
command = shlex.split(command)

subprocess.run(command, check=True, shell=False)
except subprocess.CalledProcessError:
print(f"Failed to run: {command}")
# Command is always a list here due to normalization above
cmd_str = " ".join(map(str, command))
print(f"Failed to run: {cmd_str}")
sys.exit(1)


def main():
print("Installing dependencies...")
print("Note: This installs the lightweight version of plexe by default.")
print("Available installation options:")
print(" poetry install # Default lightweight installation")
print(" poetry install -E lightweight # Explicitly install lightweight version")
print(" poetry install -E all # Full installation with deep learning support")
print(" poetry install -E deep-learning # Only deep learning dependencies")
run_command("poetry install")

print("Installing pre-commit hooks...")
run_command("pre-commit install")
print("Configuring pre-commit hooks...")
print("(Note: Ensure you've run 'poetry install' first to install dependencies)")
run_command(["poetry", "run", "pre-commit", "install"])

print("Setup complete!")

Expand Down