Coder Social home page Coder Social logo

te25son / swole-v2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1002 KB

API for tracking workouts built with FastAPI, edgedb, and poetry

License: Apache License 2.0

Dockerfile 0.70% Python 94.83% Just 2.28% JavaScript 0.57% Procfile 0.09% EdgeQL 1.53%
api edgedb justfile poetry precommit python

swole-v2's Introduction

Swole-V2

API for tracking workouts

Coverage License

Setup

You will need to install four dependencies in order to run the project locally.

  1. poetry
  2. pre-commit
  3. just
  4. edgedb

Once installed, clone this repo with git clone [email protected]:te25son/Swole-V2.git and navigate your way into the project's root folder cd Swole-V2.

Setup the environment by running just setup, and then activate the virtual environment with poetry shell.

You should now be able to run all the commands available within the project. Try it out by opening the development database's UI with just open-dev-ui, running the local development server with just run, or running the tests with just test.

If you need help with the commands available via just, run just help.

swole-v2's People

Contributors

te25son avatar

Watchers

 avatar

swole-v2's Issues

Rework Validators.py

With Pydantic V2 introduced in #152, validators have been changed. The current logic in validators.py doesn't make sense and should be reworked.

We want to keep the custom error messages, and we want to allow some of the values to be None.

  • Revert changes made in #172 once this is resolved

Logging

There is no logging throughout the application. It should be added.

Could even try something interesting with loguru

Improve documentation of API

There isn't really any documentation other than the default provided by fastapi.

Add some documenation, including checks from ruff. Maybe use mkdocs...

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

poetry
pyproject.toml
  • python ^3.10
  • fastapi ^0.110.0
  • python-multipart ^0.0.9
  • uvicorn ^0.27.0
  • pydantic ^2.0.0
  • python-jose ^3.3.0
  • passlib ^1.7.4
  • python-dotenv ^1.0.0
  • edgedb ^1.2.0
  • gunicorn ^21.0.0
  • pydantic-settings ^2.0.1
  • pytest-cov ^4.0.0
  • click ^8.1.3
  • hypothesis ^6.61.0
  • pytest-asyncio ^0.23.0
  • uvloop ^0.19.0
  • pytest-xdist ^3.1.0
  • pytest-env ^1.0.0
  • pytest-random-order ^1.1.0
  • toml ^0.10.2
  • mypy ^1.1.1
  • ruff ^0.2.0
  • smokeshow ^0.4.0
  • polyfactory ^2.0.0
  • types-click ^7.1.8

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

poetry
pyproject.toml
  • python ^3.10
  • fastapi ^0.110.0
  • python-multipart ^0.0.9
  • uvicorn ^0.29.0
  • pydantic ^2.0.0
  • python-jose ^3.3.0
  • passlib ^1.7.4
  • python-dotenv ^1.0.0
  • edgedb ^1.2.0
  • gunicorn ^21.0.0
  • pydantic-settings ^2.0.1
  • pytest-cov ^4.0.0
  • click ^8.1.3
  • hypothesis ^6.61.0
  • pytest-asyncio ^0.23.0
  • uvloop ^0.19.0
  • pytest-xdist ^3.1.0
  • pytest-env ^1.0.0
  • pytest-random-order ^1.1.0
  • toml ^0.10.2
  • mypy ^1.1.1
  • ruff ^0.4.0
  • smokeshow ^0.4.0
  • polyfactory ^2.0.0
  • types-click ^7.1.8

Pytest Warnings

There are currently 27 warnings when running pytest.

These need to be investigated and, ideally, removed.

../../Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854
../../Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854
../../Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854
../../Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854
../../Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854
  /Users/timothy/Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
    from crypt import crypt as _crypt

tests/unit_tests/test_validators.py::test_check_valid_uuid
tests/api_tests/test_workouts.py::TestWorkouts::test_workout_update_fails_with_params[Test update with incorrectly formatted date fails]
tests/api_tests/test_workouts.py::TestWorkouts::test_add_exercise_fails_when_adding_exercise_from_other_user
tests/api_tests/test_users.py::TestUsers::test_user_create_multiple_succeeds
  /Users/timothy/Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/pytest_asyncio/plugin.py:654: DeprecationWarning: There is no current event loop
    old_loop = asyncio.get_event_loop()

tests/api_tests/test_workouts.py::TestWorkouts::test_workout_update_fails_with_params[Test update with incorrectly formatted date fails]
tests/api_tests/test_workouts.py::TestWorkouts::test_add_exercise_fails_when_adding_exercise_from_other_user
tests/api_tests/test_users.py::TestUsers::test_login_with_invalid_creds_fails
tests/api_tests/test_users.py::TestUsers::test_user_create_multiple_succeeds
  /Users/timothy/Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/uvloop/__init__.py:31: DeprecationWarning: uvloop.install() is deprecated in favor of uvloop.run() starting with Python 3.12.
    _warnings.warn(

tests/api_tests/test_workouts.py::TestWorkouts::test_workout_update_fails_with_params[Test update with incorrectly formatted date fails]
tests/api_tests/test_workouts.py::TestWorkouts::test_add_exercise_fails_when_adding_exercise_from_other_user
tests/api_tests/test_users.py::TestUsers::test_login_with_invalid_creds_fails
tests/api_tests/test_users.py::TestUsers::test_user_create_multiple_succeeds
  /Users/timothy/Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/pytest_asyncio/plugin.py:749: DeprecationWarning: The event_loop fixture provided by pytest-asyncio has been redefined in
  /Users/timothy/Personal/Swole-V2/tests/conftest.py:50
  Replacing the event_loop fixture with a custom implementation is deprecated
  and will lead to errors in the future.
  If you want to request an asyncio event loop with a scope other than function
  scope, use the "scope" argument to the asyncio mark when marking the tests.
  If you want to return different types of event loops, use the event_loop_policy
  fixture.

    warnings.warn(

tests/api_tests/test_users.py::TestUsers::test_login_succeeds
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_succeeds
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_fails_with_incorrect_secret
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_fails_with_non_existing_user
tests/unit_tests/test_auth.py::TestAuth::test_inactive_user_fails
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_fails_with_invalid_token
  /Users/timothy/Personal/Swole-V2/src/swole_v2/database/repositories/users.py:100: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    to_encode.update({"exp": datetime.utcnow() + timedelta(minutes=self.settings.TOKEN_EXPIRE)})

tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_succeeds
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_fails_with_non_existing_user
tests/unit_tests/test_auth.py::TestAuth::test_inactive_user_fails
tests/unit_tests/test_auth.py::TestAuth::test_get_current_user_fails_with_invalid_token
  /Users/timothy/Library/Caches/pypoetry/virtualenvs/swole-v2-XOUsbHQA-py3.12/lib/python3.12/site-packages/jose/jwt.py:311: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = timegm(datetime.utcnow().utctimetuple())

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.