Skip to content

chore: 增加Makefile,方便build#450

Merged
MaojiaSheng merged 1 commit intomainfrom
fix/build
Mar 6, 2026
Merged

chore: 增加Makefile,方便build#450
MaojiaSheng merged 1 commit intomainfrom
fix/build

Conversation

@chuanbao666
Copy link
Collaborator

chore: 增加Makefile,方便build

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Documentation (docs)
  • Refactoring (refactor)
  • Other

Testing

  • Unit tests pass
  • Manual testing completed

Related Issues

Checklist

  • Code follows project style guidelines
  • Tests added for new functionality
  • Documentation updated (if needed)
  • All tests pass

@MaojiaSheng
Copy link
Collaborator

啥时候需要用 make

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Redundant Cleanup Path

The **/__pycache__/ entry in CLEAN_DIRS may not work as intended because Make does not enable globstar by default. However, the subsequent find commands for __pycache__ and .pyc files provide complete coverage, making this entry redundant.

**/__pycache__/

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use MIN_PYTHON_VERSION variable in check

The Python version check hardcodes version 3.10 instead of using the
MIN_PYTHON_VERSION variable. Use tuple comparison with the variable for better
maintainability.

Makefile [55]

-@$(PYTHON) -c "import sys; v=sys.version_info; exit(0 if v.major > 3 or (v.major == 3 and v.minor >= 10) else 1)" || (echo "Error: Python >= $(MIN_PYTHON_VERSION) is required."; exit 1)
+@$(PYTHON) -c "import sys; req = tuple(map(int, sys.argv[1].split('.'))); v = sys.version_info; exit(0 if (v.major, v.minor) >= req else 1)" "$(MIN_PYTHON_VERSION)" || (echo "Error: Python >= $(MIN_PYTHON_VERSION) is required."; exit 1)
Suggestion importance[1-10]: 5

__

Why: The Python version check currently hardcodes version 3.10 instead of using the MIN_PYTHON_VERSION variable, which harms maintainability. The improved code uses the variable for consistency.

Low
Remove redundant __pycache__ entry

The /pycache/ entry in CLEAN_DIRS is redundant because the clean target
already uses find to remove pycache directories, and the glob may not expand
correctly in the shell loop.**

Makefile [31]

-**/__pycache__/
 
+
Suggestion importance[1-10]: 4

__

Why: The **/__pycache__/ entry in CLEAN_DIRS is redundant because the clean target already uses find to remove pycache directories, and the glob may not expand correctly in the shell loop.

Low
Quote path in rm command

Quote the directory variable in rm -rf to handle paths with spaces correctly, even
if spaces are not expected in this project.

Makefile [98]

-rm -rf $$dir;
+rm -rf "$$dir";
Suggestion importance[1-10]: 4

__

Why: Quoting the $$dir variable in the rm -rf command improves robustness by handling paths with spaces correctly, even if spaces are not expected in this project.

Low

@chuanbao666
Copy link
Collaborator Author

啥时候需要用 make

make clean && make build
清理掉之前旧产物,重新编译。和直接执行 uv pip install -e . 效果类似。
但setup.py会判断是否已有产物,有的话会跳过,导致编译会跳过。clean一下就可以全部重新编译了

@chuanbao666
Copy link
Collaborator Author

加上 check-deps命令,遇到有人本地环境依赖装的不对,手动检查有点麻烦

@MaojiaSheng MaojiaSheng merged commit e71f091 into main Mar 6, 2026
7 checks passed
@MaojiaSheng MaojiaSheng deleted the fix/build branch March 6, 2026 03:50
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants