You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9be45dd
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+51-41Lines changed: 51 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,10 @@ Our README is like the opening act at a concert. It's where the party starts, an
19
19
- GitHub repositories? π We love stars! If it's got at least 1k stars, bring it on!
20
20
- Practice resources? ποΈββοΈ We've got Python exercises to keep you in shape.
21
21
22
+
### π README Translations & Global Sync
23
+
24
+
Please update `README.md` (English) first β it's our source of truth! Whenever you add or reorder lesson links, remember to mirror that link across all corresponding `README.<lang>.md` files. Our CI runs `python check_readmes.py` to ensure all 8 translations stay in perfect harmony, so keeping them in sync guarantees your PR passes smoothly! Thanks β your help keeps the docs welcoming for learners worldwide! ππ
25
+
22
26
## π Get into Python Modules
23
27
24
28
Our Python modules are like mini-python-parties that you can host anywhere! They're packed with energy and make learning a blast! π
@@ -35,9 +39,11 @@ We organize our Python modules into clean, logical categories:
35
39
36
40
If you are adding a new lesson, please place it in the appropriate folder.
37
41
38
-
### π·οΈ Python Version Badges
42
+
### π·οΈ Web UI Navigation & Version Badges
39
43
40
-
If your new lesson showcases a cutting-edge feature (like a new syntax feature in Python 3.8+), please update the `LESSON_ANNOTATIONS` dictionary in [ui/parse_lessons.py](file:///Users/samhuang/Playground/projects/ultimate-python/ui/parse_lessons.py). This will automatically display the version badge (e.g., `Python 3.10`) on the web UI!
44
+
Our web UI is powered by [ui/parse_lessons.py](ui/parse_lessons.py). When adding a new module:
45
+
- Add your lesson's file name (without `.py`) to `LESSON_ORDER` under its category so it appears in the sidebar and navigation sequence.
46
+
- If your new lesson showcases a cutting-edge feature (like a new syntax feature in Python 3.8+), update the `LESSON_ANNOTATIONS` dictionary. This will automatically display the version badge (e.g., `Python 3.10`) on the web UI!
@@ -76,68 +82,72 @@ But there's more! We have our own style:
76
82
77
83
We like to keep the energy high, and that means every module should have a whopping 80-100% code coverage! Our modules are like dance floors, and we don't want any empty spaces. That's because each module is a standalone lesson, and the `main` function is where the magic happens.
78
84
79
-
## π Your Contribution
80
-
81
-
Your contributions are like the encore at a concert - they're a big deal! We appreciate your dedication to making this project even more amazing. Don't hesitate to reach out if you have any questions. Your contributions, no matter how small, are making a big difference in the Python learning world!
82
-
83
-
So, get ready to rock and roll, Python style! π€ππ₯
84
-
85
-
## π₯ Dive into the Python World
86
-
87
-
Python is a versatile language used in web development, data analysis, artificial intelligence, and more. As a contributor, you're joining a vibrant community of learners and mentors.
85
+
## πΈ The Master Track: Adding a New Lesson Step-by-Step ποΈ
88
86
89
-
## π§βπ» Learning Together
87
+
Ready to drop a brand new lesson into the mix? Hereβs your backstage pass to get your new Python lesson from your local editor straight to the main stage without missing a beat! πΆ
90
88
91
-
Our project isn't just a repository; it's a collaborative learning experience. You can learn from the contributions of others and share your Python wisdom with the world. Together, we can unlock the true potential of this fantastic language.
89
+
### 1. π Craft the Python Module
90
+
- Pick the right category folder under `ultimatepython/<category>/<module_name>.py`.
91
+
- Rely **only on Python's built-in standard library** β no external packages required!
92
+
- Keep `main()` parameterless, idempotent, and side-effect free. Use `assert` statements as your choreography to prove everything works as advertised!
93
+
- Wrap it up with the classic `if __name__ == "__main__": main()`.
92
94
93
-
## π Opportunities Galore
95
+
### 2. π Tune the Web UI (`ui/parse_lessons.py`)
96
+
-**Set the Order**: In [ui/parse_lessons.py](ui/parse_lessons.py), add your module's filename (without `.py`) to `LESSON_ORDER` under the right category. This guarantees the sidebar and the "Next / Previous" navigation flow seamlessly!
97
+
-**Add Python Version Badges**: If you're showing off a modern Python superpower (like Python 3.8+ syntax), add an entry in `LESSON_ANNOTATIONS` with its version, PEP number, and highlight summary.
94
98
95
-
When you contribute to this project, you're not just improving it; you're also enhancing your own skills. You might discover new Python tricks, learn more about best practices, and even find inspiration for your own projects.
99
+
### 3. π Sync the Global Tour (All 8 READMEs!)
100
+
We share Python love around the globe! π CI has an automated gatekeeper (`python check_readmes.py`) that checks all translations for consistency:
101
+
- Add your new lesson link to the Table of Contents in `README.md`.
102
+
- Mirror that link in **all 7 translated READMEs** (`README.ko.md`, `README.zh_tw.md`, `README.es.md`, `README.de.md`, `README.fr.md`, `README.hi.md`, `README.pt_br.md`) in the exact same spot and sequence.
96
103
97
-
## π Global Impact
104
+
### 4. ποΈ Run the Pre-Flight Soundcheck! π§ͺ
105
+
Before you push your branch, run these quick checks locally so CI gives you a standing ovation on the first try:
98
106
99
-
Python is a worldwide phenomenon, and your contributions will impact Python enthusiasts globally. Your work can help someone on the other side of the planet learn Python, kickstart their career, or solve a problem they've been struggling with.
107
+
```bash
108
+
# 1. Linting & Formatting harmony β¨
109
+
ruff check
110
+
ruff format --check
111
+
mypy ultimatepython
100
112
101
-
## πββοΈ Join a Supportive Community
113
+
# 2. Test runner & coverage check (aim for 80-100%!) π
114
+
coverage run runner.py
115
+
coverage report
102
116
103
-
Our community is welcoming and supportive. If you have questions or need guidance, don't hesitate to ask. We're all here to help each other and grow together.
117
+
# 3. Verify all 8 READMEs sing in perfect harmony π
118
+
python check_readmes.py
104
119
105
-
## π’ Your Voice Matters
106
-
107
-
Your unique perspective is valuable. If you have ideas to make this guide even more engaging or fun, share them with us! We're open to creative and innovative suggestions.
108
-
109
-
## π€ Evolving with Python
120
+
# 4. Verify the web UI build π
121
+
cd ui && npm run build &&cd ..
122
+
```
110
123
111
-
Python is constantly evolving, and so is our guide. You can help keep it up-to-date, ensuring that learners always have access to the latest Python features and best practices.
124
+
## π Why Contribute to Ultimate Python?
112
125
113
-
## π Your Contribution Matters
126
+
Your contributions are like the encore at a concert β they're a big deal! Python is a worldwide phenomenon, and when you contribute, you're making a lasting difference in the learning journey of developers everywhere. π€ππ₯
114
127
115
-
Your contributions, whether they are big or small, are the building blocks of our project's success. Together, we're creating a resource that makes Python more accessible and exciting.
128
+
### π§βπ» Learn and Grow Together
129
+
Our project isn't just a repository; it's a collaborative learning experience. When you contribute, you're not just improving the guideβyou're sharpening your own Python skills, discovering best practices, and sharing your wisdom with learners worldwide.
116
130
117
-
## π Be a Python Star
131
+
### π Make a Global Impact
132
+
Python is constantly evolving, and so is our guide. Your contributions help keep the content up-to-date and accessible for beginners and professionals across the globe. You might help someone on the other side of the planet grasp a core concept or kickstart their career!
118
133
119
-
By contributing to this project, you're becoming a Python star, and you're helping others shine brightly too. Let's light up the Python world together!
134
+
### πββοΈ Inclusive & Supportive Community
135
+
Our community is welcoming, inclusive, and always here to help. Your unique perspective matters, and no contribution is too small. Together, we're building a resource that makes mastering Python fun and empowering!
120
136
121
-
## How to Contribute
137
+
## π How to Contribute (Git Workflow)
122
138
123
-
Ready to dive in? Here's how you can contribute:
139
+
Ready to dive in? Here's how you can take the stage:
124
140
125
141
1.**Fork the Repository**: Head to [https://github.com/huangsam/ultimate-python/](https://github.com/huangsam/ultimate-python/) and click the "Fork" button in the top right corner.
126
142
127
-
2.**Clone Your Fork**: After forking, you'll have your copy of the repository. Clone it to your local machine.
143
+
2.**Clone Your Fork**: After forking, clone your repository to your local machine.
128
144
129
145
3.**Make Your Contributions**: Create or update Python modules, documentation, or anything that adds value to the project.
130
146
131
-
4.**Push Your Changes**: Once your work is ready, push your changes to your forked repository.
132
-
133
-
5.**Create a Pull Request**: Head back to the original repository (https://github.com/huangsam/ultimate-python/) and create a pull request. Describe your changes and let us know why they're awesome.
134
-
135
-
We're excited to see what you bring to the table! Your contributions are making the Python world a better place.
136
-
137
-
Please don't hesitate to reach out if you have any questions. Your contributions, no matter how small, are making a big difference! πππ₯
147
+
4.**Push Your Changes**: Once your work is ready, push your changes to your forked repository branch.
138
148
139
-
## π README translations
149
+
5.**Create a Pull Request**: Head back to the original repository (https://github.com/huangsam/ultimate-python/) and create a pull request. Describe your changes and let us know why they're awesome!
140
150
141
-
Please update `README.md` (English) first - it's the source of truth. If you can, mirror important changes like link updates in the corresponding `README.<lang>.md` files so translations stay current. If you can't, no worries β just add a short note in your PR listing which translation files need updates. Thanks - your help keeps the docs welcoming for everyone! π
151
+
We're excited to see what you bring to the table! If you have any questions along the way, don't hesitate to reach out. πππ₯
142
152
143
153
## Feel the Pythonic Energy - Contribute Now! π₯
0 commit comments