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

build(python): bump project dependencies #1728

Merged
merged 19 commits into from
Sep 12, 2024

Conversation

laurent-laporte-pro
Copy link
Contributor

@laurent-laporte-pro laurent-laporte-pro commented Sep 6, 2023

Martin:

This PR aims at bumping several project dependencies:

  • pydantic from 1.9.0 to 2.8.2 ⚠️ HUGE breaking change on their side
  • fastapi from 0.73.0 to 0.110.3
  • uvicorn from to 0.15.0 to 0.30.6
  • mypy from 1.4.1 to 1.11.1

It also brings few changes inside dependencies

  • Drop requests in favor of httpx
  • Drop fastapi-jwt-auth as they do not and will not support pydantic v2. We've decided to copy their code and adapt it as it's really light (see new folder /antarest/fastapi_jwt_auth)

These changes also induced other minor dependencies bump: jinja2, typing_extensions, PyJWT, python-multipart

Copy link
Member

@flomnes flomnes left a comment

Choose a reason for hiding this comment

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

Any documentation about migration ? What deps are you upgrading ? Only FastAPI ?

@laurent-laporte-pro laurent-laporte-pro force-pushed the feature/1724-upgrade-python-dependencies branch from 4ff6734 to 8b1753c Compare May 7, 2024 16:55
@AntaresSimulatorTeam AntaresSimulatorTeam deleted a comment from commit-lint bot Aug 22, 2024
@MartinBelthle MartinBelthle force-pushed the feature/1724-upgrade-python-dependencies branch from a1275c8 to 92f9e96 Compare August 29, 2024 14:13
@MartinBelthle MartinBelthle marked this pull request as ready for review August 29, 2024 14:17
@MartinBelthle MartinBelthle changed the title build: upgrade python dependencies build(python): bump project dependencies Aug 29, 2024
@MartinBelthle
Copy link
Contributor

MartinBelthle commented Aug 29, 2024

Sonar raises a Security issue concerning the code Client(verify=False).
But this code is only used by the cli so I believe we should suppress it.
I'll let you decide @sylvlecl.

antarest/fastapi_jwt_auth/auth_jwt.py Fixed Show fixed Hide fixed
self.session = session or Session()
self.session.verify = False
# Setting verify to `False` may be useful during local development or testing.
self.session = session or Client(verify=False)

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections High

Enable server certificate validation on this SSL/TLS connection. See more on SonarCloud
MartinBelthle and others added 10 commits August 30, 2024 09:29
- improve checker to skip licensed subfolders
- remove some wrong copyrights from forked projects

Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
otherwise options such as populate_by_name are not correctly
taken into account

Signed-off-by: Sylvain Leclerc <[email protected]>
@sylvlecl sylvlecl force-pushed the feature/1724-upgrade-python-dependencies branch from 431bb60 to f332df1 Compare September 9, 2024 07:45
Distinguish root_path and api_prefix.
root_path is to be used when a proxy prepends a prefix for the client,
api_prefix is to be used when we want our server itself to prepend
a prefix.

Signed-off-by: Sylvain Leclerc <[email protected]>
@sylvlecl sylvlecl merged commit 822532c into dev Sep 12, 2024
10 of 12 checks passed
@sylvlecl sylvlecl deleted the feature/1724-upgrade-python-dependencies branch September 12, 2024 08:58
@sylvlecl
Copy link
Member

sylvlecl commented Sep 12, 2024

Sonar raises a Security issue concerning the code Client(verify=False). But this code is only used by the cli so I believe we should suppress it. I'll let you decide @sylvlecl.

For this, although it's in the CLI tool, I preferred to really solve the issue by letting the command line user take the responsibility of disabling SSL certification, through a new argument --no-verify.

maugde pushed a commit that referenced this pull request Sep 26, 2024
bumps main projection dependencies:
- `pydantic` from 1.9 to 2.8: huge breaking change but with large
   performance benefits expected on serialization
- `fastapi` from 0.73 to 0.110
- `uvicorn` from to 0.15 to 0.30
- `mypy` from 1.4 to 1.11

It also brings few changes inside dependencies
- Drop `requests` in favor of `httpx`
- Drop `fastapi-jwt-auth` as they do not and will not support pydantic
v2. We've decided to fork their code and adapt it as it's really light
(see new folder `/antarest/fastapi_jwt_auth`)

These changes also induced other minor dependencies bump: `jinja2`,
`typing_extensions`, `PyJWT`, `python-multipart`

Last, this work includes fixes on the API prefix addition when
running in standalone mode (desktop version). We now distinguish
properties root_path (used when behind a proxy) and api_prefix
(which actually makes our server add a prefix).

Co-authored-by: belthlemar <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
maugde pushed a commit that referenced this pull request Sep 26, 2024
bumps main projection dependencies:
- `pydantic` from 1.9 to 2.8: huge breaking change but with large
   performance benefits expected on serialization
- `fastapi` from 0.73 to 0.110
- `uvicorn` from to 0.15 to 0.30
- `mypy` from 1.4 to 1.11

It also brings few changes inside dependencies
- Drop `requests` in favor of `httpx`
- Drop `fastapi-jwt-auth` as they do not and will not support pydantic
v2. We've decided to fork their code and adapt it as it's really light
(see new folder `/antarest/fastapi_jwt_auth`)

These changes also induced other minor dependencies bump: `jinja2`,
`typing_extensions`, `PyJWT`, `python-multipart`

Last, this work includes fixes on the API prefix addition when
running in standalone mode (desktop version). We now distinguish
properties root_path (used when behind a proxy) and api_prefix
(which actually makes our server add a prefix).

Co-authored-by: belthlemar <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
maugde pushed a commit that referenced this pull request Sep 26, 2024
bumps main projection dependencies:
- `pydantic` from 1.9 to 2.8: huge breaking change but with large
   performance benefits expected on serialization
- `fastapi` from 0.73 to 0.110
- `uvicorn` from to 0.15 to 0.30
- `mypy` from 1.4 to 1.11

It also brings few changes inside dependencies
- Drop `requests` in favor of `httpx`
- Drop `fastapi-jwt-auth` as they do not and will not support pydantic
v2. We've decided to fork their code and adapt it as it's really light
(see new folder `/antarest/fastapi_jwt_auth`)

These changes also induced other minor dependencies bump: `jinja2`,
`typing_extensions`, `PyJWT`, `python-multipart`

Last, this work includes fixes on the API prefix addition when
running in standalone mode (desktop version). We now distinguish
properties root_path (used when behind a proxy) and api_prefix
(which actually makes our server add a prefix).

Co-authored-by: belthlemar <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade version of FastAPI and Pydantic
4 participants