Skip to content

Commit

Permalink
Merge pull request #1 from awtkns/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
calebnorman authored Nov 15, 2023
2 parents be0a69e + 9b82986 commit 94e6017
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 1,960 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
python-version: '3.10'
- name: Bump Version
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
services:
postgres:
image: postgres
Expand All @@ -33,13 +33,10 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
run: |
python -m pip install --upgrade pip
pip install -r tests/dev.requirements.txt
- name: Test with pytest
env:
POSTGRES_DB: test
Expand All @@ -48,5 +45,4 @@ jobs:
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
run: |
source .venv/bin/activate
pytest
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
<sub>A dynamic FastAPI router that automatically creates CRUD routes for your models</sub>
</p>
<p align="center">
<img alt="Tests" src="https://github.com/awtkns/fastapi-crudrouter/workflows/Python%20application/badge.svg" />
<img alt="Docs" src="https://github.com/awtkns/fastapi-crudrouter/workflows/docs/badge.svg" />
<img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/awtkns/fastapi-crudrouter/.github/workflows/pytest.yml?color=%2334D058" />
<img alt="Downloads" src="https://img.shields.io/pypi/dm/fastapi-crudrouter?color=%2334D058" />
<a href="https://pypi.org/project/fastapi-crudrouter" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi-crudrouter?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<img alt="License" src="https://img.shields.io/github/license/awtkns/fastapi-crudrouter?color=%2334D058" />
</p>
<p align="center">
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fastapi-crudrouter">
</p>

---

Expand Down
5 changes: 5 additions & 0 deletions docs/en/docs/backends/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Below is a minimal example assuming that you have already imported and created
all the required models and database connections.

```python
from fastapi_crudrouter import DatabasesCRUDRouter
from fastapi import FastAPI

app = FastAPI()

router = DatabasesCRUDRouter(
schema=MyPydanticModel,
table=my_table,
Expand Down
5 changes: 5 additions & 0 deletions docs/en/docs/backends/ormar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Below is an example assuming that you have already imported and created all the
models.

```python
from fastapi_crudrouter import OrmarCRUDRouter
from fastapi import FastAPI

app = FastAPI()

router = OrmarCRUDRouter(
schema=MyOrmarModel,
create_schema=Optional[MyPydanticCreateModel],
Expand Down
5 changes: 5 additions & 0 deletions docs/en/docs/backends/sqlalchemy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ database dependency.
Below is an example assuming that you have already imported and created all the required models.

```python
from fastapi_crudrouter import SQLAlchemyCRUDRouter
from fastapi import FastAPI

app = FastAPI()

router = SQLAlchemyCRUDRouter(
schema=MyPydanticModel,
create_schema=MyPydanticCreateModel,
Expand Down
3 changes: 3 additions & 0 deletions docs/en/docs/backends/tortoise.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ your database using your [Tortoise](https://tortoise-orm.readthedocs.io/en/lates
Below is an example assuming that you have already imported and created all the required models.

```python
from fastapi_crudrouter.core.tortoise import TortoiseCRUDRouter
from fastapi import FastAPI

app = FastAPI()
register_tortoise(app, config=TORTOISE_ORM)

Expand Down
30 changes: 8 additions & 22 deletions docs/en/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ on the feature and potential help on where to start implementation wise.

## Development

### Using [poetry](https://python-poetry.org/)

FastAPI-Crudrouter uses [poetry](https://python-poetry.org/) as depenency management system. To install all of the required dependecies simply run:

poetry install

Both dev-requirements and project-requirements will be installed with this command.

To enter the virtual-environment created with poetry use:

poetry shell

If you are not familiar with poetry, please read their [usage guide](https://python-poetry.org/docs/basic-usage/).

### Installing the Dev Requirements
FastAPI-Crudrouter requires as set of development requirements that can installed with `pip` be found in `tests/dev.requirements.txt`

Expand All @@ -46,16 +32,16 @@ works and is bug free.

#### Test requirements
Tests require a postgres database for tests to run. The easiest way to accomplish this is with docker. This project offers
a docker-compose file at tests/conf/dev.docker-compose.yaml. You can use this file with
a docker-compose file at tests/conf/dev.docker-compose.yml. You can use this file with

```console
$ docker compose -f tests/conf/dev.docker-compose.yaml up -d
```bash
docker compose -f tests/conf/dev.docker-compose.yml up -d
```

After testing you can tear down the running containers with

```console
$ docker compose -f tests/conf/dev.docker-compose.yaml down
```bash
docker compose -f tests/conf/dev.docker-compose.yml down
```

#### Running tests
Expand All @@ -77,19 +63,19 @@ With `dev.requirements.txt` installed above you also install tools to lint, form

To format the project run:

```
```bash
black fastapi_crudrouter tests
```

To check styles, imports, annotations, pep8 etc. run:

```
```bash
flake8 fastapi_crudrouter
```

To check static types annotations run:

```
```bash
mypy fastapi_crudrouter tests
```

Expand Down
12 changes: 9 additions & 3 deletions docs/en/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<sub>A dynamic FastAPI router that automatically creates routes CRUD for your models</sub>
</p>
<p align="center">
<img alt="Tests" src="https://github.com/awtkns/fastapi-crudrouter/workflows/Python%20application/badge.svg" />
<img alt="Docs" src="https://github.com/awtkns/fastapi-crudrouter/workflows/docs/badge.svg" />
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fastapi" />
<img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/awtkns/fastapi-crudrouter/.github/workflows/pytest.yml?color=%2334D058" />
<img alt="Downloads" src="https://img.shields.io/pypi/dm/fastapi-crudrouter?color=%2334D058" />
<a href="https://pypi.org/project/fastapi-crudrouter" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi-crudrouter?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<img alt="License" src="https://img.shields.io/github/license/awtkns/fastapi-crudrouter?color=%2334D058" />
</p>
<p align="center">
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fastapi-crudrouter">
</p>

---
Expand Down
7 changes: 3 additions & 4 deletions docs/en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ theme:
name: material
features:
- navigation.expand
- content.code.copy
palette:
- scheme: default
primary: indigo
Expand Down Expand Up @@ -58,11 +59,9 @@ extra:
- icon: fontawesome/brands/github-alt
link: https://github.com/awtkns/fastapi-crudrouter
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/adam-watkins-yvr/
link: https://www.linkedin.com/in/awtkns/
- icon: fontawesome/solid/globe
link: https://awtkns.com
- icon: fontawesome/brands/instagram
link: https://www.instagram.com/adamcwatkins/
link: https://github.com/awtkns

extra_css:
- css/main.css
Expand Down
Loading

0 comments on commit 94e6017

Please sign in to comment.