Skip to content

Commit ec019a5

Browse files
authored
Develop (#34)
* refactor: Separate development and production dependencies in setup.py - Moved development dependencies (e.g., uvicorn) to the 'dev' extras_require - Users can now install development dependencies with `pip install fastapi_quickcrud[dev]` - Updated the setup.py file accordingly * add github action * remove chectout * update action * add different python version * add coverage * add coverage * Delete .github/workflows/coverage.yml * update readme * remove circleci * rename name
1 parent 6cad9f6 commit ec019a5

6 files changed

Lines changed: 154 additions & 31 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.circleci/postgres-uuid

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/ci.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Unit testing in 🐍3.7/8/9/10
4+
5+
# Controls when the workflow will run
6+
on:
7+
push:
8+
branches: [ "main", "develop", "feature/*" ]
9+
pull_request:
10+
branches: [ "main", "develop" ]
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
ciPython37:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: [ 3.7 ]
21+
services:
22+
postgres:
23+
image: postgres:11
24+
env:
25+
POSTGRES_USER: postgres
26+
POSTGRES_PASSWORD: postgres
27+
POSTGRES_DB: ci_db_test
28+
ports:
29+
- 5432:5432
30+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v1
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
- name: Enable Postgres Trigram Extension
42+
run: |
43+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
44+
- name: Test with unittest
45+
env:
46+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
47+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
48+
run: |
49+
python -m unittest discover -s ./tests/test_implementations
50+
ciPython38:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
python-version: [ 3.8 ]
55+
services:
56+
postgres:
57+
image: postgres:11
58+
env:
59+
POSTGRES_USER: postgres
60+
POSTGRES_PASSWORD: postgres
61+
POSTGRES_DB: ci_db_test
62+
ports:
63+
- 5432:5432
64+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
65+
steps:
66+
- uses: actions/checkout@v3
67+
- name: Set up Python ${{ matrix.python-version }}
68+
uses: actions/setup-python@v1
69+
with:
70+
python-version: ${{ matrix.python-version }}
71+
- name: Install dependencies
72+
run: |
73+
python -m pip install --upgrade pip
74+
pip install -r requirements.txt
75+
- name: Enable Postgres Trigram Extension
76+
run: |
77+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
78+
- name: Test with unittest
79+
env:
80+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
81+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
82+
run: |
83+
python -m unittest discover -s ./tests/test_implementations
84+
ciPython39:
85+
runs-on: ubuntu-latest
86+
strategy:
87+
matrix:
88+
python-version: [ 3.9 ]
89+
services:
90+
postgres:
91+
image: postgres:11
92+
env:
93+
POSTGRES_USER: postgres
94+
POSTGRES_PASSWORD: postgres
95+
POSTGRES_DB: ci_db_test
96+
ports:
97+
- 5432:5432
98+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
99+
steps:
100+
- uses: actions/checkout@v3
101+
- name: Set up Python ${{ matrix.python-version }}
102+
uses: actions/setup-python@v1
103+
with:
104+
python-version: ${{ matrix.python-version }}
105+
- name: Install dependencies
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install -r requirements.txt
109+
- name: Enable Postgres Trigram Extension
110+
run: |
111+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
112+
- name: Test with unittest
113+
env:
114+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
115+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
116+
run: |
117+
python -m unittest discover -s ./tests/test_implementations
118+
ciPython310:
119+
runs-on: ubuntu-latest
120+
strategy:
121+
matrix:
122+
python-version: [ '3.10' ]
123+
services:
124+
postgres:
125+
image: postgres:11
126+
env:
127+
POSTGRES_USER: postgres
128+
POSTGRES_PASSWORD: postgres
129+
POSTGRES_DB: ci_db_test
130+
ports:
131+
- 5432:5432
132+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
133+
steps:
134+
- uses: actions/checkout@v3
135+
- name: Set up Python ${{ matrix.python-version }}
136+
uses: actions/setup-python@v1
137+
with:
138+
python-version: ${{ matrix.python-version }}
139+
- name: Install dependencies
140+
run: |
141+
python -m pip install --upgrade pip
142+
pip install -r requirements.txt
143+
- name: Enable Postgres Trigram Extension
144+
run: |
145+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
146+
- name: Test with unittest
147+
env:
148+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
149+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
150+
run: |
151+
python -m unittest discover -s ./tests/test_implementations

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c2a6306f7f0a41948369d80368eb7abb?style=flat-square)](https://www.codacy.com/gh/LuisLuii/FastAPIQuickCRUD/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LuisLuii/FastAPIQuickCRUD&utm_campaign=Badge_Grade)
66
[![Coverage Status](https://coveralls.io/repos/github/LuisLuii/FastAPIQuickCRUD/badge.svg?branch=main)](https://coveralls.io/github/LuisLuii/FastAPIQuickCRUD?branch=main)
7-
[![CircleCI](https://circleci.com/gh/LuisLuii/FastAPIQuickCRUD/tree/main.svg?style=svg)](https://circleci.com/gh/LuisLuii/FastAPIQuickCRUD/tree/main)
7+
[![unit test](https://github.com/LuisLuii/FastAPIQuickCRUD/actions/workflows/ci.yml/badge.svg)](https://github.com/LuisLuii/FastAPIQuickCRUD/actions/workflows/ci.yml)
88
[![SupportedVersion](https://img.shields.io/pypi/pyversions/fastapi-quickcrud?style=flat-square)](https://pypi.org/project/fastapi-quickcrud)
99
[![develop dtatus](https://img.shields.io/pypi/status/fastapi-quickcrud?style=flat-square)](https://pypi.org/project/fastapi-quickcrud)
1010
[![PyPI version](https://badge.fury.io/py/fastapi-quickcrud.svg)](https://badge.fury.io/py/fastapi-quickcrud)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
VERSION = "0.2.4"
3+
VERSION = '0.2.5'
44

55
print(
66
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ class User(Base):
3434
app = FastAPI()
3535
app.include_router(crud_route_1)
3636
app.include_router(crud_route_2)
37-
uvicorn.run(app, host="0.0.0.0", port=8002, debug=False)
37+
uvicorn.run(app, host="0.0.0.0", port=8002)

0 commit comments

Comments
 (0)