Skip to content

Commit

Permalink
Merge branch 'feat/more-pip-fixes-and-cicd' into sweep/replace_the_uv…
Browse files Browse the repository at this point in the history
…_install_section_in_the_do
  • Loading branch information
kevinlu1248 committed Mar 14, 2024
2 parents 64a8a14 + 13726c8 commit 7dca5f7
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 218 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/black.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/e2e.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/pylint.yml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Python CI All

on:
pull_request:
branches:
- main
- dev
# paths:
# - 'sweepai/**'
# - 'tests/**'
push:
branches:
- main
- dev
paths:
- 'sweepai/**'
- 'tests/**'

jobs:
python-ci:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
# python-version: ["3.10", "3.11"]
os: [ubuntu-latest]
outputs:
cache-key: ${{ steps.cache-dependencies.outputs.cache-key }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.67.0
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Restore dependencies
id: restore-dependencies
uses: actions/cache/restore@v4
with:
path: "~"
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
${{ runner.os }}-python-
- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
if: steps.restore-dependencies.outputs.cache-hit != 'true'
- run: pip install uv
if: steps.restore-dependencies.outputs.cache-hit != 'true'
- run: uv pip install -r requirements.txt
if: steps.restore-dependencies.outputs.cache-hit != 'true'
- run: uv pip install ruff pylint pytest pytest-xdist black
if: steps.restore-dependencies.outputs.cache-hit != 'true'
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache/save@v4
with:
path: "~"
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}

- name: Format with Black
run: black sweepai

- name: Lint with Ruff
run: ruff check sweepai

- name: Lint with Pylint
run: pylint sweepai --errors-only

- name: Run Unit Tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python -m unittest sweepai/**/*_test.py

- name: Set up Redis (for e2e tests)
run: |
sudo apt-get update
sudo apt-get install redis-server
sudo lsof -i :6379 || true
- name: Run e2e Tests
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}
GITHUB_APP_ID: ${{ secrets.GH_APP_ID }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_APP_PEM: ${{ secrets.GH_APP_PEM }}
OPENAI_API_TYPE: azure
OPENAI_API_BASE: ${{ secrets.GH_OPENAI_API_BASE }}
OPENAI_API_VERSION: 2024-02-15-preview
AZURE_API_KEY: ${{ secrets.GH_AZURE_API_KEY }}
AZURE_OPENAI_DEPLOYMENT: ${{ secrets.GH_AZURE_OPENAI_DEPLOYMENT }}
run: PYTHONPATH=. pytest -n 4 tests/e2e -s
timeout-minutes: 30
46 changes: 0 additions & 46 deletions .github/workflows/unittest.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<a href="https://github.com/sweepai/sweep">
<img src="https://img.shields.io/github/commit-activity/m/sweepai/sweep" />
</a>
<a href="https://uptime.betterstack.com/?utm_source=status_badge">
<img src="https://uptime.betterstack.com/status-badges/v1/monitor/v3bu.svg" alt="Better Stack Badge">
<a href="https://pypi.org/project/sweepai">
<img src="https://badge.fury.io/py/sweepai.svg" alt="PyPI version" height="18">
</a>
<a href="https://hub.docker.com/r/sweepai/sweep">
<img alt="Self Host Sweep Docker Image" src="https://img.shields.io/badge/Host Sweep-Docker Image-2496ED?link=https://hub.docker.com/r/sweepai/sweep">
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Callout, Tabs, Steps } from 'nextra/components'
import { FaInfoCircle, FaExclamationCircle } from 'react-icons/fa'

# Sweep CLI Installation
<Callout type="info">Prerequisites: **python 3.10, pip, OpenAI account, GitHub account**</Callout>
<Callout type="info">Prerequisites: **python 3.10 and pip**</Callout>

Sweep CLI is a locally running version of Sweep (no data will enter our servers).<br/>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Homepage = "https://sweep.dev"

[project]
name = "sweepai"
version = "1.0.12"
version = "1.1.0"
description = "Sweep fixes GitHub issues"
authors = [
{name = "Kevin Lu", email = "[email protected]"},
Expand Down
Loading

0 comments on commit 7dca5f7

Please sign in to comment.