Skip to content

Commit c0fc422

Browse files
authored
Merge pull request #11 from SongshGeo/dev
✨ 适配 AI Agent workflow
2 parents 765aacd + cd872c6 commit c0fc422

7 files changed

Lines changed: 41 additions & 2 deletions

File tree

.cursor/.cursorignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
legacy-code/
3+
debug.log

.cursor/plans/.keep

Whitespace-only changes.

.cursor/rules/cursorrules.mdc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
You are an AI assistant specialized in Python development. Your approach emphasizes:
2+
3+
- Clear project structure with separate directories for source code, tests, docs, and config.
4+
- Modular design with distinct files for models, services, controllers, and utilities.
5+
- Configuration management using environment variables.
6+
- Robust error handling and logging, including context capture.
7+
- Comprehensive testing with pytest.
8+
- Detailed documentation using docstrings and README files.
9+
- Dependency management via https://github.com/astral-sh/uv and virtual environments.
10+
- Code style consistency using Ruff.
11+
- CI/CD implementation with GitHub Actions or GitLab CI.
12+
13+
AI-friendly coding practices:
14+
- You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.
15+
16+
Follow the following rules:
17+
- For any Python file, ALWAYS add typing annotations to each function or class. Include explicit return types (including None where appropriate). Add descriptive docstrings to all Python functions and classes.
18+
- Please follow PEP 257 docstring conventions. Update existing docstrings as needed.
19+
- Make sure you keep any comments that exist in a file.
20+
- When writing tests, ONLY use pytest or pytest plugins (not unittest). All tests should have typing annotations. Place all tests under ./tests. Create any necessary directories. If you create packages under ./tests or ./src/<package_name>, be sure to add an __init__.py if one does not exist.
21+
22+
All tests should be fully annotated and should contain docstrings. Be sure to import the following if TYPE_CHECKING:
23+
from _pytest.capture import CaptureFixture
24+
from _pytest.fixtures import FixtureRequest
25+
from _pytest.logging import LogCaptureFixture
26+
from _pytest.monkeypatch import MonkeyPatch
27+
from pytest_mock.plugin import MockerFixture
28+
29+
Before you begin, carefully read all documents in ./cache/

cache/architecture.md

Whitespace-only changes.

cache/progress.md

Whitespace-only changes.

cache/project-design.md

Whitespace-only changes.

makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
GIT := $(shell command -v git 2> /dev/null)
33
UV := $(shell command -v uv 2> /dev/null)
44
POETRY := $(shell command -v poetry 2> /dev/null)
5+
# Control optional dependency groups (1 to enable, 0 to skip)
6+
DEV ?= 1
7+
DOCS ?= 0
58

69
# 检查是否安装了包管理器
710
check-package-manager:
@@ -21,9 +24,13 @@ check-package-manager:
2124
setup: check-package-manager
2225
@echo "安装依赖..."
2326
@if [ -n "$(UV)" ]; then \
24-
uv sync --all-extras; \
27+
uv sync \
28+
$(if $(DEV),--extra dev,) \
29+
$(if $(DOCS),--extra docs,); \
2530
elif [ -n "$(POETRY)" ]; then \
26-
poetry install; \
31+
poetry install \
32+
$(if $(DEV),--with dev,) \
33+
$(if $(DOCS),--with docs,); \
2734
fi
2835
@echo "初始化项目..."
2936
@make configure-project

0 commit comments

Comments
 (0)