Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Python code closer to PEP 8 standard #1820

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Conversation

Irillit
Copy link
Contributor

@Irillit Irillit commented Feb 4, 2025

I focused here on:

  • Changed camelCase to snake_case in variables, fields, methods and functions;
  • Renamed literals that shadowed built-in functions
  • Added docstrings
  • Renamed types.py to schemas.py, as types.py shadows a built-in name. I called it schemas, as it contains Pydantic models (we can call them schemas), and models might be confused in this context with ML models.
  • Split init.py in veeneer folder
  • Moved some repeated strings to class constants;
  • Some other changes (context managers instead of open/close, list comprehension instead of map, Optional type instead of type | None)

Plans for the future:

  • Split vertex.ai plugin from init.py to normal modules;
  • Make the structure of py folder more Pythonic
  • Separate the constructor of Actions into other methods

@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch 2 times, most recently from aa31ce3 to fb556b7 Compare February 4, 2025 13:45
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch from fb556b7 to e607e99 Compare February 4, 2025 14:19
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch 2 times, most recently from 9171f41 to f881525 Compare February 5, 2025 09:30
@Irillit Irillit marked this pull request as ready for review February 5, 2025 09:34
@github-actions github-actions bot added docs Improvements or additions to documentation js go tooling dotprompt sample labels Feb 5, 2025
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch from 4f48694 to 567267b Compare February 5, 2025 14:01
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch 6 times, most recently from f019f99 to 31c6b4e Compare February 6, 2025 10:59
py/packages/genkit/src/genkit/core/action.py Show resolved Hide resolved
py/packages/genkit/src/genkit/veneer/veneer.py Outdated Show resolved Hide resolved
py/packages/genkit/src/genkit/veneer/veneer.py Outdated Show resolved Hide resolved
py/samples/hello/hello.py Outdated Show resolved Hide resolved
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch from 31c6b4e to 1298aef Compare February 7, 2025 14:46
@Irillit Irillit force-pushed the tatsiana/pep8-compliance branch from 1298aef to 47ffaa6 Compare February 7, 2025 15:22
@Irillit Irillit changed the title Get Python code closer to PEP 8 standart Get Python code closer to PEP 8 standard Feb 7, 2025
@Irillit Irillit requested a review from kirgrim February 7, 2025 15:37
@Irillit Irillit merged commit c728c10 into main Feb 10, 2025
7 checks passed
@Irillit Irillit deleted the tatsiana/pep8-compliance branch February 10, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config docs Improvements or additions to documentation python Python root sample tooling
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants