Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-ast
- id: fix-byte-order-marker
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1

- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: flake8
args: ["--ignore=E501"]
- id: absolufy-imports

- repo: https://github.com/pycqa/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
args: ["--overwrite-in-place"]

- repo: https://github.com/psf/black
rev: 21.9b0
rev: 22.3.0
hooks:
- id: black
args: ["--line-length=110"]

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: ["--max-line-length=110", "--ignore=E203,E501,W503"]
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
---------

1.1.3
~~~~~

* Update pre-commit config and code format.
* Remove broken examples.
* Update base requirements version.

1.1.2
~~~~~

Expand Down
23 changes: 0 additions & 23 deletions examples/async_file_upload.py

This file was deleted.

3 changes: 1 addition & 2 deletions examples/async_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ async def main():
)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
3 changes: 1 addition & 2 deletions examples/async_httpbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ async def main():
print("httpbin_api.basic_auth.retrieve={!r}".format(response.body))


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
3 changes: 1 addition & 2 deletions examples/async_httpbin_disable_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ async def main():
print("httpbin_api.basic_auth.retrieve={!r}".format(response.body))


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
37 changes: 0 additions & 37 deletions examples/async_instagram.py

This file was deleted.

17 changes: 0 additions & 17 deletions examples/file_upload.py

This file was deleted.

26 changes: 0 additions & 26 deletions examples/instagram.py

This file was deleted.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[tool.black]
line-length = 110
target-version = ['py39']
target-version = ['py310']

[tool.isort]
profile = 'black'
line_length = 110
force_alphabetical_sort_within_sections = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
httpx>=0.19.0
python-slugify>=5.0.2
httpx>=0.23.0
python-slugify>=6.1.2
python-status>=1.0.1
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
changelog = f.read()


install_requirements = ["python-status>=1.0.1", "httpx>=0.19.0", "python-slugify>=5.0.2"]
install_requirements = ["python-status>=1.0.1", "httpx>=0.23.0", "python-slugify>=6.1.2"]
tests_requirements = ["pytest", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "coveralls"]


Expand All @@ -46,7 +46,7 @@ def run(self):
setup(
name="simple-rest-client",
version=version,
description="Simple REST client for python 3.6+",
description="Simple REST client for python 3.7+",
long_description=long_description,
url="https://github.com/allisson/python-simple-rest-client",
author="Allisson Azevedo",
Expand Down
2 changes: 1 addition & 1 deletion simple_rest_client/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from slugify import slugify

from .resource import Resource
from simple_rest_client.resource import Resource


class API:
Expand Down
2 changes: 1 addition & 1 deletion simple_rest_client/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import httpx
import status

from .exceptions import (
from simple_rest_client.exceptions import (
AuthError,
ClientConnectionError,
ClientError,
Expand Down
4 changes: 2 additions & 2 deletions simple_rest_client/request.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from .decorators import handle_async_request_error, handle_request_error
from .models import Response
from simple_rest_client.decorators import handle_async_request_error, handle_request_error
from simple_rest_client.models import Response

logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions simple_rest_client/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import httpx

from .exceptions import ActionNotFound, ActionURLMatchError
from .models import Request
from .request import make_async_request, make_request
from simple_rest_client.exceptions import ActionNotFound, ActionURLMatchError
from simple_rest_client.models import Request
from simple_rest_client.request import make_async_request, make_request

logger = logging.getLogger(__name__)

Expand Down
6 changes: 1 addition & 5 deletions tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import status
from asyncmock import AsyncMock

from simple_rest_client.decorators import (
handle_async_request_error,
handle_request_error,
validate_response,
)
from simple_rest_client.decorators import handle_async_request_error, handle_request_error, validate_response
from simple_rest_client.exceptions import (
AuthError,
ClientConnectionError,
Expand Down