GithubHelp home page GithubHelp logo

kevin-wijnen / decky-plugin-store Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steamdeckhomebrew/decky-plugin-store

0.0 0.0 0.0 482 KB

License: GNU Affero General Public License v3.0

Python 93.01% Makefile 1.04% HTML 4.16% Mako 0.63% Dockerfile 1.16%

decky-plugin-store's Introduction

Plugin-Store

This project powers Decky plugin store @ https://plugins.deckbrew.xyz/. It is using fastapi and sqlalchemy.

Contributing

Running in docker

As standard docker-compose.yml file is used for deployment, there is a separate docker-compose.local.yml file you can use. Just use docker-compose -f docker-compose.local.yml up to bring up the project. You can use any docker-compose commands normally as long as you add -f docker-compose.local.yml argument.

Using Makefile

There is a handy Makefile placed in the root directory of the project. It is not being used in a conventional way (to build the code or install built software), it's just creates nice aliases for commands. Here is a list of them:

  • autoformat - runs autoformatting on the whole Python codebase.
    • autoformat/black - runs only black command for autoformatting, which unifies codestyle.
    • autoformat/isort - runs only isort command for autoformatting, which reorders imports.
  • lint - runs lint check on the whole project.
    • lint/black - runs only black in check mode. After running black autoformatting, this check should pass.
    • lint/isort - runs only isort in check mode. After running isort autoformatting, this check should pass.
    • lint/flake8 - runs only flake8 linter. This does not have its own autoformat command, but it should be more or less covered by black autoformatting. It's here to make sure black does not leave any gaps in pep8 compliance.
    • lint/mypy runs only mypy linter. This does not have its own autoformat command either and errors needs to be fixed manually.
  • deps/lock - recreates lockfile without changing any package versions when possible. Needs to be executed after changing project dependencies.
  • deps/upgrade - recreates lockfile while trying to upgrade all packages to the newest compatible version.
  • test - runs project tests.

All commands above can be prefixed with dc/ to run them directly in a docker container. There are also additional, docker only commands:

  • dc/build - rebuilds docker images. Needs to be run after Dockerfile or project dependencies change.

Updating dependencies

This project is using Poetry to manage python packages required for the project. Poetry also keeps the lock file to make sure every environment where the same version of project is used, is as consistent as possible.

If you want to add any dependency, preferably add it manually in the pyproject.toml file. Please keep dependencies alphabetically sorted to avoid merge conflicts.

If adding or updating a single dependency inside the pyproject.toml, you need to update the lockfile. Please run make deps/lock to do as little changes to the lockfile as possible, unless your intention is to refresh every single dependency, then make deps/upgrade should be a better option. But you probably shouldn't use it unless you really need to.

Running tests

Simply run make test to run tests on your local machine. If using development docker-compose file, you shall use make dc/test instead.

Writing tests

This project uses pytest for running tests. Get familiar with it and fixtures system first. On top of pytest, async tests are supported via pytest.mark.asyncio decorator provided by pytest-asyncio. As project is using fastapi with async views as well as async DB, most of the tests need to be async.

All tests and configuration for them lives in tests directory. You can find some useful fixtures in the conftest.py file. If creating any more fixtures, please place them in this file unless you have a good reason not to do so.

There are two automatically applied fixtures, one patches over any external API calls, so they aren't really executed when running tests, second one overrides constants specifying any external resources. If adding any new external service dependencies to the project, please update those fixtures to patch them over as well.

decky-plugin-store's People

Contributors

aagaming00 avatar botatooo avatar dependabot[bot] avatar gbdlin avatar marios8543 avatar milroneth avatar partywumpus avatar skyleite avatar traindoctor avatar

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.