Skip to content

Commit e340fc0

Browse files
committed
Initial commit [rewrite project]
1 parent 0e01137 commit e340fc0

File tree

106 files changed

+3431
-3495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3431
-3495
lines changed

.dockerignore

Whitespace-only changes.

.github/workflows/python-app.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
python -m pip install ruff pytest
27-
python -m pip install -r requirements.txt
26+
make install-dev
2827
- name: Code style
2928
run: |
30-
pre-commit run --all-files
29+
poetry run pre-commit run --all-files
3130
- name: Pytest
3231
run: |
33-
make tests
32+
make test

.pre-commit-config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ repos:
55
rev: v4.5.0
66
hooks:
77
- id: check-added-large-files
8+
args: ["--maxkb=700"]
89
- id: check-yaml
910
- id: check-toml
1011
- id: check-json
1112
- id: check-symlinks
1213

1314
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.1.7
15+
rev: v0.4.2
1516
hooks:
1617
- id: ruff
1718
- id: ruff-format
@@ -27,7 +28,7 @@ repos:
2728
- manual
2829

2930
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.7.1
31+
rev: v1.10.0
3132
hooks:
3233
- id: mypy
3334
pass_filenames: false

Dockerfile

-46
This file was deleted.

Makefile

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
SHELL = /bin/bash
2+
PYTHON = python3.12
23

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

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

10-
messages-extract: # Extract messages to locale/messages.pot
11-
@pybabel extract \
12-
--version=0.0.1 \
13-
14-
--project=FuturamaAPI \
15-
--copyright-holder=FuturamaAPI \
16-
--mapping babel.cfg \
17-
--output-file=locale/messages.pot \
18-
.
15+
install: # Install Environ and dependencies
16+
@echo "Upgrading pip"
17+
@$(PYTHON) -m pip install --upgrade pip
18+
@echo "Installing poetry"
19+
@$(PYTHON) -m pip install poetry
20+
@echo "Installing dependencies"
21+
@$(PYTHON) -m poetry install --without dev --without test
1922

20-
messages: # Update all locales
21-
@$(MAKE) messages-extract
22-
@pybabel update --input-file=locale/messages.pot --output-dir=locale
23+
test: # Run tests
24+
@poetry run $(PYTHON) -m pytest
2325

24-
messages-compile: # Generate .mo files for all locales
25-
@pybabel compile --directory=locale
26-
27-
tests: # Run tests
28-
@python -m pytest
26+
migrate: # Migrate
27+
@poetry run $(PYTHON) -m alembic upgrade head

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ If you create models in a new file please import it in env.py.
5858
Because alembic does not detect child classes.
5959

6060
```commandline
61-
alembic revision --autogenerate -m "Revision Name"
62-
alembic upgrade head
61+
poetry run alembic revision --autogenerate -m "Revision Name"
62+
poetry run alembic upgrade head
6363
```
6464

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

7878
<p align="right">(<a href="#top">back to top</a>)</p>

alembic.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[alembic]
44
# path to migration scripts
5-
script_location = alembic
5+
script_location = futuramaapi/repositories/migrations
66

77
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
88
# Uncomment the line below if you want the files to be prepended with date and time

app/core/__init__.py

-6
This file was deleted.

app/graph_ql/routers.py

-7
This file was deleted.

0 commit comments

Comments
 (0)