diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 0000000..7f86f38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1,4 @@ +blank_issues_enabled: false +contact_links: + - name: "📑 Read online docs" + about: Find tutorials, use cases, and guides in the OpenManus documentation. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/request_new_features.md b/.github/ISSUE_TEMPLATE/request_new_features.md new file mode 100644 index 0000000..a30bb81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/request_new_features.md @@ -0,0 +1,14 @@ +--- +name: "🤔 Request new features" +about: Suggest ideas or features you’d like to see implemented in OpenManus. +title: '' +labels: kind/features +assignees: '' +--- + +**Feature description** + + +**Your Feature** + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/show_me_the_bug.md b/.github/ISSUE_TEMPLATE/show_me_the_bug.md new file mode 100644 index 0000000..9748f0d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/show_me_the_bug.md @@ -0,0 +1,25 @@ +--- +name: "🪲 Show me the Bug" +about: Report a bug encountered while using OpenManus and seek assistance. +title: '' +labels: kind/bug +assignees: '' +--- + +**Bug description** + + +**Bug solved method** + + + +**Environment information** + + +- System version: +- Python version: +- OpenManus version or branch: +- Installation method (e.g., `pip install -r requirements.txt` or `pip install -e .`): + +**Screenshots or logs** + \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d88d89a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +**Features** + + +- Feature 1 +- Feature 2 + +**Feature Docs** + + +**Influence** + + +**Result** + + +**Other** + \ No newline at end of file diff --git a/.github/workflows/build-package.yaml b/.github/workflows/build-package.yaml new file mode 100644 index 0000000..bc4be72 --- /dev/null +++ b/.github/workflows/build-package.yaml @@ -0,0 +1,33 @@ +name: Build and upload Python package + +on: + workflow_dispatch: + release: + types: [created, published] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install setuptools wheel twine + - name: Set package version + run: | + export VERSION="${GITHUB_REF#refs/tags/v}" + sed -i "s/version=.*/version=\"${VERSION}\",/" setup.py + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py bdist_wheel sdist + twine upload dist/* \ No newline at end of file diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..c9824d0 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,26 @@ +name: Pre-commit checks + +on: + pull_request: + branches: + - '**' + push: + branches: + - '**' + +jobs: + pre-commit-check: + runs-on: ubuntu-latest + steps: + - name: Checkout Source Code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install pre-commit and tools + run: | + python -m pip install --upgrade pip + pip install pre-commit black==23.1.0 isort==5.12.0 autoflake==2.0.1 + - name: Run pre-commit hooks + run: pre-commit run --all-files \ No newline at end of file diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 0000000..edc31d9 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,23 @@ +name: Close inactive issues + +on: + schedule: + - cron: "5 0 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 30 + days-before-issue-close: 14 + stale-issue-label: "inactive" + stale-issue-message: "This issue has been inactive for 30 days. Please comment if you have updates." + close-issue-message: "This issue was closed due to 45 days of inactivity. Reopen if still relevant." + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml new file mode 100644 index 0000000..4ed826a --- /dev/null +++ b/.github/workflows/unittest.yaml @@ -0,0 +1,47 @@ +name: Unit Tests + +on: + pull_request_target: + push: + branches: + - 'main' + - 'dev' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.12'] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest + - name: Run tests with pytest + run: | + pytest app/ | tee unittest.txt + - name: Show failed tests and summary + run: | + grep -E "FAILED|ERROR|[0-9]+ passed," unittest.txt + failed_count=$(grep -E "FAILED|ERROR" unittest.txt | wc -l) + if [[ "$failed_count" -gt 0 ]]; then + echo "$failed_count failed tests found! Task failed." + exit 1 + fi + - name: Upload test results + uses: actions/upload-artifact@v3 + with: + name: pytest-results-${{ matrix.python-version }} + path: ./unittest.txt + retention-days: 3 + if: ${{ always() }} \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ef4004..3b6c1ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,22 +18,22 @@ repos: - id: autoflake args: [ --remove-all-unused-imports, - --ignore-init-module-imports, # 忽略 __init__.py 中的导入 + --ignore-init-module-imports, --expand-star-imports, --remove-duplicate-keys, --remove-unused-variables, --recursive, --in-place, - --exclude=__init__.py, # 排除 __init__.py 文件 + --exclude=__init__.py, ] - files: \.py$ # 只处理 Python 文件 + files: \.py$ - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: - id: isort args: [ - "--profile", "black", # 使用 black 兼容的配置 + "--profile", "black", "--filter-files", "--lines-after-imports=2", ]