נבנה על ידיBuilt by Ariel Yohimovich

חזרה למפגשBack
PythonPython

פרויקט גמר והצגהFinal project & demo

מפגש 36: תכנון, בנייה, בדיקות, פרסום והצגה.Session 36: Planning, building, testing, publishing and presenting.

מה נעשה היוםToday's plan

  • היקףScope
  • חבילהPackage
  • שירותService
  • CICI
  • גרסהRelease
  • הצגהDemo
נושאTopic 1

היקףScope

מה זה מדף 2.0What Shelf 2.0 is

  • שכבות: models → storage → service → cli/apiLayers: models → storage → service → cli/api
  • כל מה שבניתם לאורך הקורסEverything you built through the course
  • לבחור 1–2 תוספות, לא הכולPick 1–2 extras, not everything

אנלוגיהAnalogy

פרויקט גמר הוא כמו מבחן מעשי בבישול: לא מבשלים כל מנה שלמדתם, אלא ארוחה אחת שלמה ומדויקת שמראה את כל המיומנויות.A final project is like a practical cooking exam: you don't cook every dish you learned, but one complete, precise meal that shows all the skills.
נושאTopic 2

חבילהPackage

חבילה ו-pyproject.tomlA package and pyproject.toml

  • תיקיית shelf/ עם __init__.pyA shelf/ folder with __init__.py
  • pyproject.toml: שם, תלויות, פקודותpyproject.toml: name, dependencies, commands
  • pip install -e . = התקנה לפיתוחpip install -e . = install for development

אנלוגיהAnalogy

pyproject.toml הוא כמו תווית על אריזת מוצר: מה בפנים, מה צריך כדי להשתמש בו, ואיך מפעילים.pyproject.toml is like the label on a product's box: what's inside, what you need to use it, and how to switch it on.

טעות נפוצהCommon mistake

cli.py
from .models import Book
מה Python עונהWhat Python says
ImportError: attempted relative import with no known parent package
ImportError: attempted relative import with no known parent package: ייבוא עם נקודה עובד רק בתוך חבילה. מריצים כ-python -m shelf.cli (או מתקינים עם pip install -e .).ImportError: attempted relative import with no known parent package: a dotted import works only inside a package. Run as python -m shelf.cli (or install with pip install -e .).
נושאTopic 3

שירותService

שכבת השירותThe service layer

  • כל החוקים במקום אחדAll the rules in one place
  • CLI ו-API קוראים לאותן פונקציותThe CLI and API call the same functions
  • קל לבדוק בלי ממשקEasy to test without an interface

אנלוגיהAnalogy

שכבת השירות היא כמו המטבח במסעדה עם משלוחים: מי שהזמין באפליקציה ומי שישב בשולחן מקבלים אותה מנה מאותו מטבח.The service layer is like a restaurant kitchen that also delivers: whoever ordered by app and whoever sat at a table get the same dish from the same kitchen.
נושאTopic 4

CICI

CI: בדיקות בכל pushCI: tests on every push

  • קובץ .github/workflows/tests.ymlA .github/workflows/tests.yml file
  • GitHub מריץ pytest בכל pushGitHub runs pytest on every push
  • סימן ירוק/אדום ליד כל commitA green/red mark next to every commit

אנלוגיהAnalogy

CI הוא כמו גלאי מתכות בכניסה לבניין: כל אחד עובר, כל פעם, בלי יוצא מן הכלל, ולכן אף אחד לא צריך לזכור לבדוק.CI is like a metal detector at a building's entrance: everyone walks through, every time, no exceptions, so nobody has to remember to check.
נושאTopic 5

גרסהRelease

גרסה, יומן שינויים ופרסוםVersion, changelog and release

אנלוגיהAnalogy

גרסה סמנטית היא כמו מספר מהדורה של ספר: מהדורה חדשה לגמרי, פרק חדש, או תיקון שגיאות דפוס. הקורא יודע מה לצפות.Semantic versioning is like a book's edition number: an all-new edition, a new chapter, or typo fixes. Readers know what to expect.
נושאTopic 6

הצגהDemo

יום ההצגה ומה הלאהDemo day and what's next

  • הדגמה חיה של 3 דקות (מפגש 35)A 3-minute live demo (session 35)
  • תוכנית ב': צילומי מסך אם משהו נופלPlan B: screenshots if something fails
  • המשך: Pygame, תרומה לקוד פתוח, פרויקט שניNext: Pygame, open source, a second project

אנלוגיהAnalogy

יום ההצגה הוא כמו הופעת סיום בחוג מוזיקה: אף אחד לא מצפה לשלמות, אלא לראות כמה התקדמתם ושאתם נהנים לנגן.Demo day is like a music class's end-of-year concert: nobody expects perfection, just to see how far you've come and that you enjoy playing.

שכבות: models → storage → service → cli/apiLayers: models → storage → service → cli/api

כל מה שבניתם לאורך הקורסEverything you built through the course

לבחור 1–2 תוספות, לא הכולPick 1–2 extras, not everything

תיקיית shelf/ עם __init__.pyA shelf/ folder with __init__.py

pyproject.toml: שם, תלויות, פקודותpyproject.toml: name, dependencies, commands

pip install -e . = התקנה לפיתוחpip install -e . = install for development

כל החוקים במקום אחדAll the rules in one place

CLI ו-API קוראים לאותן פונקציותThe CLI and API call the same functions

קל לבדוק בלי ממשקEasy to test without an interface

קובץ .github/workflows/tests.ymlA .github/workflows/tests.yml file

GitHub מריץ pytest בכל pushGitHub runs pytest on every push

סימן ירוק/אדום ליד כל commitA green/red mark next to every commit

MAJOR.MINOR.PATCHMAJOR.MINOR.PATCH

CHANGELOG.md בשפה של משתמשיםCHANGELOG.md in users' language

git tag v2.0.0 ו-Release ב-GitHubgit tag v2.0.0 and a GitHub Release

הדגמה חיה של 3 דקות (מפגש 35)A 3-minute live demo (session 35)

תוכנית ב': צילומי מסך אם משהו נופלPlan B: screenshots if something fails

מה למדנוWhat we learned

  • שכבות: models → storage → service → cli/apiLayers: models → storage → service → cli/api
  • תיקיית shelf/ עם __init__.pyA shelf/ folder with __init__.py
  • כל החוקים במקום אחדAll the rules in one place
  • קובץ .github/workflows/tests.ymlA .github/workflows/tests.yml file
  • MAJOR.MINOR.PATCHMAJOR.MINOR.PATCH
  • הדגמה חיה של 3 דקות (מפגש 35)A 3-minute live demo (session 35)

עכשיו לתרגולNow, practice

5 תרגילים ו-2 אתגרים, עם בדיקה אוטומטית5 exercises and 2 challenges, auto-checked
הערות מרצהSpeaker notes

נבנה על ידיBuilt by Ariel Yohimovich