contribute
About 877 wordsAbout 3 min
2025-12-20 18:56:17
SecRandom welcomes anyone to submit code to our repository. You can help us with many things, including but not limited to:
- Submitting patches to fix bugs
- Adding new features
- Optimizing existing features
- Optimizing code performance
- Improving documentation and translations
- And more...
By reading this guide, you will understand the various processes for contributing code to SecRandom. You will also learn how to use commit messages for binary builds. Let's get started now!
Quick Start
Before contributing code to the SecRandom project, please make sure you have completed the following preparations:
Note
Besides using the command line, you can also use GitHub Desktop or built-in features/plugins in your IDE.
Fork the Project
- Visit the SecRandom GitHub Repository
- Click the "Fork" button in the upper right corner to create your own copy of the repository
Clone the Repository
Warning
Make sure that before this step, you have switched the terminal's working directory to where you want to save/modify the SecRandom source code.
git clone https://github.com/your-username/SecRandom.git cd SecRandomAdd Upstream Repository
git remote add upstream https://github.com/SECTL/SecRandom.gitInstall Virtual Environment (Optional)
Tips
If you do not need to run the code to test the effects, you can skip this section.
SecRandom uses
uvto manage virtual environments. You need to get it first before executing the following commands. You can get information aboutuvin the uv official documentation.uv venv uv syncThen you can run the code like this (in the virtual environment):
uv run ./main.py
Submit Your Contribution
Create a Branch
git checkout -b feature/feature-nameMake Changes
- Write your code
- Add necessary comments (please use Chinese if possible, or English)
- Ensure compliance with project code standards
Commit Changes
git add . git commit -m "Describe your changes"Sync Upstream Changes
git fetch upstream git rebase upstream/masterPush and Create Pull Request (PR)
git push origin feature/your-feature-name- Visit your GitHub Fork repository
- Click the "Compare & pull request" button
- Fill in the PR description and submit
Contribution Guidelines
Code Standards
- Use comments in code, don't forget to write Docstrings
- Follow the style guide advocated by PEP8, check existing code if there are objections
- Ensure importing all classes/functions/variables you used, do not use
from module import * - Verify the existence of third-party UI components and classes/functions/variables in other libraries
Tips
You can use tools like PyRight, Ruff to check if the code has defects/complies with standards.
Commit Message Standards
- Use clear, concise commit messages
- Start with conventional words like fix, feat, etc.
- Avoid overly simple descriptions (e.g., "fix bug")
Tips
We recommend using Conventional Commits to write commit messages.
PR Requirements
- PR title should clearly describe the changes (if there is only one commit, you can also directly use the title of this commit)
- Provide detailed change description, including:
- Added/Modified/Deleted features
- Added/Modified version/Deleted dependency libraries and Python version changes
- Please also inform about other breaking changes
- Ensure all tests pass
- Ensure your modified code runs normally at least on your computer
- Link related Issues (if any)
The Last Step...
When SecRandom maintainers have reviewed your PR and ensured there are no issues, your contributed code will be merged into the main branch.
Now we congratulate you on becoming a member of SecRandom contributors!
If your PR is not passed, it doesn't matter. Please carefully read the suggestions given by our maintainers and continue to work hard. One day, you will become a member of SecRandom contributors. Keep it up !
Actions Build Workflow
If you need to test the automatically built binary program, you can read the following text to get more information.
GitHub Actions Unified Build Workflow Guide
The SecRandom project uses a unified GitHub Actions workflow for building and releasing, with the configuration file located at .github/workflows/build-unified.yml. This workflow supports multiple triggering methods and configuration options.
Trigger Specific Builds via Commit Messages
You can trigger different build behaviors by including specific keywords in the git commit message:
Trigger Package Build
- Include the
打包(Package) keyword in the commit message - Example:
git commit -m "Add feature 打包"
- Include the
Specify Build Platform
win- Windows platformlinux- Linux platformall- All platforms- Example:
git commit -m "Fix bug 打包 linux"
Trigger All Platform Builds
- Create a tag that conforms to the version number specification (Format:
vNumber.Number.Number.Number) - Example:
git tag v1.2.3.4 && git push origin v1.2.3.4
- Create a tag that conforms to the version number specification (Format:
Build Parameter Keywords Description
Commit messages can include the following keywords to control build behavior:
| Keyword | Meaning | Example |
|---|---|---|
打包 | General packaging trigger | git commit -m "Add feature 打包" |
win | Windows platform | git commit -m "Fix UI 打包 win" |
linux | Linux platform | git commit -m "Optimize performance 打包 linux" |
all | All platforms | git commit -m "Major update 打包 all" |
Combination Usage Examples:
git commit -m "Optimize performance 打包 pi"- Use PyInstaller to build for Windows platformgit commit -m "Fix bug 打包 pi"- Use PyInstaller to build for Linux platform
Contributors
Changelog
f2b1e-docs: 增加中英文间空格on
Copyright
Copyright Ownership:SECTL
License under:CC BY-NC-SA 4.0
