Skip to content

Commit

Permalink
Initial commit [rewrite project]
Browse files Browse the repository at this point in the history
  • Loading branch information
koldakov committed May 6, 2024
1 parent 48d3c59 commit ddeb3de
Show file tree
Hide file tree
Showing 89 changed files with 2,518 additions and 3,649 deletions.
Empty file removed .dockerignore
Empty file.
7 changes: 3 additions & 4 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff pytest
python -m pip install -r requirements.txt
make install-dev
- name: Code style
run: |
pre-commit run --all-files
poetry run pre-commit run --all-files
- name: Pytest
run: |
make tests
make test
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ repos:
rev: v4.5.0
hooks:
- id: check-added-large-files
args: ["--maxkb=700"]
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-symlinks

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.4.2
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -27,7 +28,7 @@ repos:
- manual

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.10.0
hooks:
- id: mypy
pass_filenames: false
Expand Down
46 changes: 0 additions & 46 deletions Dockerfile

This file was deleted.

39 changes: 19 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
SHELL = /bin/bash
PYTHON = python3.12

help: # Display this message
@sed -ne '/@sed/!s/# //p' $(MAKEFILE_LIST)

messages-init: # locale=LANG, init LANG language
@test $${locale?Please specify locale. Example \"locale=en_CA\"}
@pybabel init -l $(locale) -i locale/messages.pot -d locale
install-dev: # Install DEV/TEST Environ and dependencies
@echo "Upgrading pip"
@$(PYTHON) -m pip install --upgrade pip
@echo "Installing poetry"
@$(PYTHON) -m pip install poetry
@echo "Installing dependencies"
@$(PYTHON) -m poetry install

messages-extract: # Extract messages to locale/messages.pot
@pybabel extract \
--version=0.0.1 \
[email protected] \
--project=FuturamaAPI \
--copyright-holder=FuturamaAPI \
--mapping babel.cfg \
--output-file=locale/messages.pot \
.
install: # Install Environ and dependencies
@echo "Upgrading pip"
@$(PYTHON) -m pip install --upgrade pip
@echo "Installing poetry"
@$(PYTHON) -m pip install poetry
@echo "Installing dependencies"
@$(PYTHON) -m poetry install --without dev --without test

messages: # Update all locales
@$(MAKE) messages-extract
@pybabel update --input-file=locale/messages.pot --output-dir=locale
test: # Run tests
@poetry run pytest

messages-compile: # Generate .mo files for all locales
@pybabel compile --directory=locale

tests: # Run tests
@python -m pytest
migrate: # Migrate
@poetry run alembic upgrade head
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ If you create models in a new file please import it in env.py.
Because alembic does not detect child classes.

```commandline
alembic revision --autogenerate -m "Revision Name"
alembic upgrade head
poetry run alembic revision --autogenerate -m "Revision Name"
poetry run alembic upgrade head
```

<p align="right">(<a href="#top">back to top</a>)</p>
Expand All @@ -72,7 +72,7 @@ export $(cat .env | xargs)
# Compile tranlations
make messages-compile
# Run hypercorn server
hypercorn --reload app.main:app
hypercorn --reload futuramaapi.main:app
```

<p align="right">(<a href="#top">back to top</a>)</p>
Expand Down
2 changes: 1 addition & 1 deletion alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[alembic]
# path to migration scripts
script_location = alembic
script_location = futuramaapi/repositories/migrations

# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
# Uncomment the line below if you want the files to be prepended with date and time
Expand Down
6 changes: 0 additions & 6 deletions app/core/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions app/graph_ql/routers.py

This file was deleted.

Loading

0 comments on commit ddeb3de

Please sign in to comment.