diff --git a/.codacy.yml b/.codacy.yml index 56264e4..d60d30f 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -1,3 +1,5 @@ +# https://docs.codacy.com/repositories-configure/codacy-configuration-file/ + exclude_paths: - ".github" - ".vscode" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2e807ab..dd4ee46 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,16 +5,19 @@ updates: - package-ecosystem: "pip" directory: "/" schedule: - interval: "weekly" + interval: "daily" groups: fastapi: patterns: - - "fastapi" - - "starlette" - pydantic: + - "fastapi*" + flake8: patterns: - - "pydantic*" + - "flake8*" + pytest: + patterns: + - "pytest*" + - "gevent" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "daily" diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 991e3d6..f29ed0e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,7 +10,7 @@ on: branches: [ master ] env: - PYTHON_VERSION: 3.9 + PYTHON_VERSION: 3.12 jobs: lint: diff --git a/README.md b/README.md index 9c10145..f0aada7 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ ## Status [![Python CI](https://github.com/nanotaboada/python-samples-fastapi-restful/actions/workflows/python-app.yml/badge.svg)](https://github.com/nanotaboada/python-samples-fastapi-restful/actions/workflows/python-app.yml) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=nanotaboada_python-samples-fastapi-restful&metric=bugs)](https://sonarcloud.io/summary/new_code?id=nanotaboada_python-samples-fastapi-restful) -[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful/badge)](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful) -[![codebeat badge](https://codebeat.co/badges/4c4f7c08-3b35-4b57-a875-bf2043efe515)](https://codebeat.co/projects/github-com-nanotaboada-python-samples-fastapi-restful-master) -[![Maintainability](https://qlty.sh/badges/af009694-c5cc-4568-897d-d20fa7ee017d/maintainability.svg)](https://qlty.sh/gh/nanotaboada/projects/python-samples-fastapi-restful) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanotaboada_python-samples-fastapi-restful&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=nanotaboada_python-samples-fastapi-restful) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/8f9bab37f6f444c895a8b25d5df772fc)](https://app.codacy.com/gh/nanotaboada/python-samples-fastapi-restful/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![codecov](https://codecov.io/gh/nanotaboada/python-samples-fastapi-restful/branch/master/graph/badge.svg?token=A1WNZPRQEJ)](https://codecov.io/gh/nanotaboada/python-samples-fastapi-restful) -[![Known Vulnerabilities](https://snyk.io/test/github/nanotaboada/python-samples-fastapi-restful/badge.svg)](https://snyk.io/test/github/nanotaboada/python-samples-fastapi-restful) +[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful/badge)](https://www.codefactor.io/repository/github/nanotaboada/python-samples-fastapi-restful) +[![codebeat badge](https://codebeat.co/badges/4c4f7c08-3b35-4b57-a875-bf2043efe515)](https://codebeat.co/projects/github-com-nanotaboada-python-samples-fastapi-restful-master) + + ## Manifesto diff --git a/codecov.yml b/codecov.yml index 8bcd0c5..db5f5e4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,11 +1,5 @@ -# Validate your repository YAML -# https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml -# curl -X POST --data-binary @codecov.yml https://codecov.io/validate +# https://docs.codecov.com/docs/codecov-yaml -# Ignoring Paths -# https://docs.codecov.com/docs/ignoring-paths -# The pattern folder/* will not match recursively in the folder. -# Please use this folder/**/*, which will exclude all files within the given folder. ignore: - "data" - "models" @@ -14,11 +8,8 @@ ignore: - "postman_collections" - "main.py" - coverage: status: - # Splitting up projects - # https://docs.codecov.com/docs/commit-status#splitting-up-projects-example project: routes: paths: diff --git a/postman_collections/python-samples-fastapi-restful.postman_collection.json b/postman_collections/python-samples-fastapi-restful.postman_collection.json index 69713da..96266c1 100644 --- a/postman_collections/python-samples-fastapi-restful.postman_collection.json +++ b/postman_collections/python-samples-fastapi-restful.postman_collection.json @@ -1,190 +1,161 @@ { - "info": { - "_postman_id": "a6f69e7a-9b1f-45d9-a7a6-56f3e824d372", - "name": "python-samples-fastapi-restful", - "description": "🧪 Proof of Concept for a RESTful API made with Python 3 and FastAPI\n\n[https://github.com/nanotaboada/python-samples-fastapi-restful](https://github.com/nanotaboada/python-samples-fastapi-restful)", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "32077259" - }, - "item": [ - { - "name": "Create", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"id\": 12,\n \"firstName\": \"Leandro\",\n \"middleName\": \"Daniel\",\n \"lastName\": \"Paredes\",\n \"dateOfBirth\": \"1994-06-29T00:00:00.000Z\",\n \"squadNumber\": 5,\n \"position\": \"Defensive Midfield\",\n \"abbrPosition\": \"DM\",\n \"team\": \"AS Roma\",\n \"league\": \"Serie A\",\n \"starting11\": false\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:9000/players", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players" - ] - }, - "description": "Creates a new Player" - }, - "response": [] - }, - { - "name": "Retrieve", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:9000/players", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players" - ] - }, - "description": "Retrieves all the Players" - }, - "response": [] - }, - { - "name": "Retrieve By Id", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:9000/players/1", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players", - "1" - ] - }, - "description": "Retrieves one Player by Id" - }, - "response": [] - }, - { - "name": "Retrieve By Squad Number", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:9000/players/squadnumber/10", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players", - "squadnumber", - "10" - ] - }, - "description": "Retrieves one Player by Squad Number" - }, - "response": [] - }, - { - "name": "Update", - "request": { - "method": "PUT", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"id\": 12,\n \"firstName\": \"Leandro\",\n \"middleName\": \"Daniel\",\n \"lastName\": \"Paredes\",\n \"dateOfBirth\": \"1994-06-29T00:00:00.000Z\",\n \"squadNumber\": 5,\n \"position\": \"Defensive Midfield\",\n \"abbrPosition\": \"DM\",\n \"team\": \"AS Roma\",\n \"league\": \"Serie A\",\n \"starting11\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:9000/players/12", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players", - "12" - ] - }, - "description": "Updates an existing Player" - }, - "response": [] - }, - { - "name": "Delete", - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "http://localhost:9000/players/12", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "9000", - "path": [ - "players", - "12" - ] - }, - "description": "Deletes an existing Player" - }, - "response": [] - } - ] -} \ No newline at end of file + "info": { + "_postman_id": "a6f69e7a-9b1f-45d9-a7a6-56f3e824d372", + "name": "python-samples-fastapi-restful", + "description": "🧪 Proof of Concept for a RESTful API made with Python 3 and FastAPI\n\n[https://github.com/nanotaboada/python-samples-fastapi-restful](https://github.com/nanotaboada/python-samples-fastapi-restful)", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "32077259" + }, + "item": [ + { + "name": "Create", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"id\": 12,\n \"firstName\": \"Leandro\",\n \"middleName\": \"Daniel\",\n \"lastName\": \"Paredes\",\n \"dateOfBirth\": \"1994-06-29T00:00:00.000Z\",\n \"squadNumber\": 5,\n \"position\": \"Defensive Midfield\",\n \"abbrPosition\": \"DM\",\n \"team\": \"AS Roma\",\n \"league\": \"Serie A\",\n \"starting11\": false\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:9000/players", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players"] + }, + "description": "Creates a new Player" + }, + "response": [] + }, + { + "name": "Retrieve", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:9000/players", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players"] + }, + "description": "Retrieves all the Players" + }, + "response": [] + }, + { + "name": "Retrieve By Id", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:9000/players/1", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players", "1"] + }, + "description": "Retrieves one Player by Id" + }, + "response": [] + }, + { + "name": "Retrieve By Squad Number", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:9000/players/squadnumber/10", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players", "squadnumber", "10"] + }, + "description": "Retrieves one Player by Squad Number" + }, + "response": [] + }, + { + "name": "Update", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"id\": 12,\n \"firstName\": \"Leandro\",\n \"middleName\": \"Daniel\",\n \"lastName\": \"Paredes\",\n \"dateOfBirth\": \"1994-06-29T00:00:00.000Z\",\n \"squadNumber\": 5,\n \"position\": \"Defensive Midfield\",\n \"abbrPosition\": \"DM\",\n \"team\": \"AS Roma\",\n \"league\": \"Serie A\",\n \"starting11\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:9000/players/12", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players", "12"] + }, + "description": "Updates an existing Player" + }, + "response": [] + }, + { + "name": "Delete", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "http://localhost:9000/players/12", + "protocol": "http", + "host": ["localhost"], + "port": "9000", + "path": ["players", "12"] + }, + "description": "Deletes an existing Player" + }, + "response": [] + } + ] +} diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..d2aca3a --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.12