Skip to content

Commit

Permalink
Merge branch 'master' into db
Browse files Browse the repository at this point in the history
  • Loading branch information
lukynmatuska committed Sep 13, 2024
2 parents adae370 + 07a3614 commit 95c43f7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Ruff


on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Analysing the code with ruff
run: |
ruff check
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"files.insertFinalNewline": true
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Rudická mládež, z. s.
Copyright (c) 2023 Rudická mládež, z.s.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CuteTix
# CuteTix Backend

Cute Tickets Information System

Expand Down
4 changes: 4 additions & 0 deletions app/features/git.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
"""Module for working with git"""
import git


class Git:
"""Class for working with git"""
def __init__(self):
self.repo = git.Repo(search_parent_directories=True)
self.cmd = self.repo.git

async def pull(self):
"""Method for `git pull`"""
return self.cmd.pull()

def short_hash(self):
"""Method for get short hash"""
return self.repo.head.object.hexsha[:7]
8 changes: 5 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
"""Main module of Cute Tickets project"""
from datetime import datetime
from app.features.git import Git
import os
import json
import sys
from app.features.git import Git
from app.routers import events, ticket_groups, tickets
from app.schemas.root import RootResponse
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware


app = FastAPI(
swagger_ui_parameters={
Expand Down

0 comments on commit 95c43f7

Please sign in to comment.