Skip to content

update library to use latest fastapi and pydantic + pydantic settings #62

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
},
},
// Needed for git security feature, and flux config
"postStartCommand": "git config --global --add safe.directory /workspaces/flux-python-api && flux R encode --hosts=$(hostname) > /etc/flux/system/R && sed -i 's@HOSTNAME@'$(hostname)'@' /etc/flux/system/conf.d/broker.toml && sudo service munge start"
"postStartCommand": "git config --global --add safe.directory /workspaces/flux-restful-api && flux R encode --hosts=$(hostname) > /etc/flux/system/R && sed -i 's@HOSTNAME@'$(hostname)'@' /etc/flux/system/conf.d/broker.toml && sudo service munge start"
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.com/flux-framework/flux-restful-api/tree/main) (0.0.x)
- Bump of pydantic/fastapi versions, adding pydantic-settings (0.1.14)
- Ensure we update flux environment for user (0.1.13)
- Add better multi-user mode - running jobs on behalf of user (0.1.12)
- Restore original rpc to get job info (has more information) (0.1.11)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.13
0.1.14
2 changes: 1 addition & 1 deletion app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shlex
import string

from pydantic import BaseSettings
from pydantic_settings import BaseSettings

logger = logging.getLogger(__name__)

Expand Down
6 changes: 5 additions & 1 deletion app/library/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def check_auth(
db, user_name=credentials.username, password=credentials.password
)
if not user:
raise HTTPException(status_code=401, detail="Incorrect email or password", headers={"WWW-Authenticate": "Basic"})
raise HTTPException(
status_code=401,
detail="Incorrect email or password",
headers={"WWW-Authenticate": "Basic"},
)
elif not crud_user.is_active(user):
raise HTTPException(status_code=400, detail="Inactive user")
return credentials.username
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sphinx<7.2
markupsafe
sphinx-immaterial>=0.11.6
sphinx-immaterial>=0.11.6
numpy
pydantic
pandas
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
requests==2.27.1
fastapi==0.72.0
fastapi
uvicorn==0.17.0
python-dotenv==0.19.2
aiofiles==0.8.0
Expand All @@ -11,6 +11,7 @@ pyaml
sqlalchemy
# install also provides alembic binary
alembic
pydantic==2.0.1
pydantic
pydantic-settings
python-jose[cryptography]
passlib[bcrypt]