Skip to content

Commit 24fe814

Browse files
authored
Merge pull request piccolo-orm#133 from aminalaee/add-scripts-folder
add-scripts-folder
2 parents bd54ed7 + e18344f commit 24fe814

File tree

161 files changed

+463
-331
lines changed

Some content is hidden

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

161 files changed

+463
-331
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
per-file-ignores = __init__.py:F401
3+
max-line-length = 79

.github/workflows/release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
release:
10+
name: "Publish release"
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- uses: "actions/checkout@v2"
15+
- uses: "actions/setup-python@v1"
16+
with:
17+
python-version: 3.7
18+
- name: "Install dependencies"
19+
run: "pip install -r dev-requirements.txt"
20+
- name: "Publish to PyPI"
21+
run: "./scripts/release.sh"
22+
env:
23+
TWINE_USERNAME: __token__
24+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
name: Python package
1+
name: Test Suite
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
48

59
jobs:
610
linters:
@@ -19,11 +23,10 @@ jobs:
1923
run: |
2024
python -m pip install --upgrade pip
2125
pip install -r requirements.txt
26+
pip install -r dev-requirements.txt
2227
pip install -r tests/test-requirements.txt
23-
- name: Mypy
24-
run: mypy piccolo tests
25-
- name: Flake8
26-
run: flake8 piccolo tests
28+
- name: Lint
29+
run: ./scripts/lint.sh
2730

2831
postgres:
2932
runs-on: ubuntu-latest
@@ -70,11 +73,14 @@ jobs:
7073
psql -h localhost -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" -d piccolo -U postgres
7174
7275
- name: Test with pytest, Postgres
73-
run: cd tests && ./test-postgres.sh
76+
run: ./scripts/test-postgres.sh
7477
env:
7578
PG_HOST: localhost
7679
PG_DATABASE: piccolo
7780
PG_PASSWORD: postgres
81+
- name: Upload coverage
82+
uses: codecov/codecov-action@v1
83+
if: matrix.python-version == '3.7'
7884

7985
sqlite:
8086
runs-on: ubuntu-latest
@@ -94,4 +100,7 @@ jobs:
94100
pip install -r requirements.txt
95101
pip install -r tests/test-requirements.txt
96102
- name: Test with pytest, SQLite
97-
run: cd tests && ./test-sqlite.sh
103+
run: ./scripts/test-sqlite.sh
104+
- name: Upload coverage
105+
uses: codecov/codecov-action@v1
106+
if: matrix.python-version == '3.7'

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ipdb==0.12.2
22
ipython==7.8.0
3+
isort==5.9.2
34
twine==3.1.1
45
mypy==0.782
56
pip-upgrader==1.4.15

piccolo/apps/app/commands/new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import annotations
2+
23
import importlib
34
import os
45
import sys
@@ -7,7 +8,6 @@
78
import black # type: ignore
89
import jinja2
910

10-
1111
TEMPLATE_DIRECTORY = os.path.join(
1212
os.path.dirname(os.path.abspath(__file__)), "templates"
1313
)

piccolo/apps/app/piccolo_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from piccolo.conf.apps import AppConfig, Command
2+
23
from .commands.new import new
34
from .commands.show_all import show_all
45

5-
66
APP_CONFIG = AppConfig(
77
app_name="app",
88
migrations_folder_path="",

piccolo/apps/asgi/commands/new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import annotations
2+
23
import os
34
import shutil
45
import typing as t
@@ -7,7 +8,6 @@
78
import colorama # type: ignore
89
from jinja2 import Environment, FileSystemLoader
910

10-
1111
TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates/app/")
1212
SERVERS = ["uvicorn", "Hypercorn"]
1313
ROUTERS = ["starlette", "fastapi", "blacksheep"]

piccolo/apps/asgi/piccolo_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from piccolo.conf.apps import AppConfig, Command
2-
from .commands.new import new
32

3+
from .commands.new import new
44

55
APP_CONFIG = AppConfig(
66
app_name="asgi",

piccolo/apps/meta/piccolo_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from piccolo.conf.apps import AppConfig, Command
2-
from .commands.version import version
32

3+
from .commands.version import version
44

55
APP_CONFIG = AppConfig(
66
app_name="meta",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .diffable_table import DiffableTable # noqa
2-
from .migration_manager import MigrationManager # noqa
3-
from .schema_differ import SchemaDiffer, AlterStatements # noqa
4-
from .schema_snapshot import SchemaSnapshot # noqa
1+
from .diffable_table import DiffableTable
2+
from .migration_manager import MigrationManager
3+
from .schema_differ import AlterStatements, SchemaDiffer
4+
from .schema_snapshot import SchemaSnapshot

0 commit comments

Comments
 (0)