Skip to content

Commit

Permalink
Bootstrap project
Browse files Browse the repository at this point in the history
  • Loading branch information
paolorechia committed Jul 10, 2021
0 parents commit 0a90bcd
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mypy_cache
.pytest_cache
**/**.egg-info
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Rest API Client (WIP)

Come back later.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.
27 changes: 27 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[metadata]
name = rest-api-client
version = 0.0.1
author = Paolo Rechia
author_email = paolorechia at gmail dot com
description = A
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com:paolorechia/rest-api-client
project_urls =
Bug Tracker = https://github.com:paolorechia/rest-api-client/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.8
install_requires =
httpx==0.18.2
pydantic

[options.packages.find]
where = src
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup

setup()
Empty file added src/rest_api_client/__init__.py
Empty file.
22 changes: 22 additions & 0 deletions src/rest_api_client/lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import Iterable
from pydantic import BaseModel
from enum import Enum


class HTTPMethod(Enum):
GET = "get"
DELETE = "delete"
POST = "post"
PUT = "put"
PATCH = "patch"


class Endpoint(BaseModel):
path: str
method: HTTPMethod
model: BaseModel


class RestAPI:
def register_endpoints(self, endpoints: Iterable[Endpoint]):
pass
Empty file added test/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions test/test_lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rest_api_client.lib import RestAPI


def test_rest_api():
api = RestAPI()
assert api
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py38

[testenv]
deps =
-rrequirements.txt
mypy
black
flake8
pytest
pytest-cov
# run the tests
# ... or run any other command line tool you need to run here
commands =
python3 -m mypy src
python3 -m black src
python3 -m flake8 src
python3 -m pytest -vvv

0 comments on commit 0a90bcd

Please sign in to comment.