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

Upgrades/packages #83

Merged
merged 4 commits into from
Oct 23, 2023
Merged

Upgrades/packages #83

merged 4 commits into from
Oct 23, 2023

Conversation

otytlandsvik
Copy link
Contributor

@otytlandsvik otytlandsvik commented Oct 15, 2023

⬆️ Upgrade all packages

Upgraded all packages to their newest version:

  • fastapi 0.87.0 -> 0.103.2
  • werkzeug 2.2.3 -> 3.0.0
  • pyjwt 2.6.0 -> 2.8.0
  • pymongo 4.3.3 -> 4.5.0
  • uvicorn 0.20.0 -> 0.23.2
  • email-validator 1.3.0 -> 2.0.0
  • python-multipart 0.0.5 -> 0.0.6
  • aiofiles 22.1.0 -> 23.2.1
  • pytest 7.2.0 -> 7.4.2
  • google-api-python-client 2.66.0 -> 2.103.0
  • google-auth-httplib2 0.1.0 -> 0.1.1
  • google-auth-oauthlib 0.7.1 -> 1.1.0
  • fpdf2 2.6.1 -> 2.7.6
  • docker 6.0.1 -> 6.1.2
  • pandas 1.5.2 -> 2.1.1
  • numpy 1.23.5 -> 1.26.0
  • xlsxwriter 3.0.3 -> 3.1.7

FastAPI upgrade also required pydantic v2.x. Pydantic model syntax was upgraded according to the migration guide.

Removed one unused package:

  • openpyxl

Upgraded python version 3.9 -> 3.11

New enum syntax requires explicit value reference in format strings. __str__ method added to enum classes to avoid this.

Resolves

This PR is based on the changes from #82 and will therefore resolve it. Additionally, it will resolve both pending dependabot PRs #79 and #80.

Copy link
Member

@FredrikMorstad FredrikMorstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, however there are some things I think you should look at. Especially the validator without the pre flag as this handles data not being in the correct form

app/api/admin.py Outdated Show resolved Hide resolved
app/api/admin.py Outdated Show resolved Hide resolved
app/models.py Show resolved Hide resolved
app/models.py Show resolved Hide resolved
Copy link
Member

@FredrikMorstad FredrikMorstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good job 🚀

@@ -9,11 +9,16 @@ class Status(str, Enum):
active = "active"
inactive = "inactive"

def __str__(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

# pre=true makes this validation erun before pydantic's model validator
@validator('role', pre=True)
# mode='before' makes this validation run before pydantic's model validator
@field_validator('role', mode='before')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good 👍

@otytlandsvik otytlandsvik merged commit 2447ada into master Oct 23, 2023
1 check passed
@otytlandsvik otytlandsvik deleted the upgrades/packages branch October 23, 2023 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants