Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linters and adjust code #132

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f30d939
remove old linters and scripts
sergioteula Oct 5, 2024
5089686
added pre-commit
sergioteula Oct 5, 2024
19c9122
ruff and mypy working for precommit
sergioteula Oct 6, 2024
cb65227
added ruff mypy and tests to github workflow
sergioteula Oct 6, 2024
70725b9
adjust pyproject and remove workflow for pull request
sergioteula Oct 6, 2024
d76c0ef
try fix for tests with other python versions
sergioteula Oct 6, 2024
7559ebb
use target version for ruff
sergioteula Oct 6, 2024
dfcd6c8
fix unittest execution
sergioteula Oct 6, 2024
e04ed75
test python 3.5 for tests
sergioteula Oct 6, 2024
d72d924
removed python 3.5 for tests
sergioteula Oct 6, 2024
51c3294
added makefile
sergioteula Oct 6, 2024
6d5cdda
automatic fixes from pre-commit
sergioteula Oct 7, 2024
bb07147
applied ruff automatic fixes
sergioteula Oct 7, 2024
8b5dcea
added command to run all tests with different python versions
sergioteula Oct 7, 2024
0f27d27
added pre-commit for mypy from repo
sergioteula Oct 8, 2024
63f6002
use pytest for running tests
sergioteula Oct 8, 2024
ecd790f
add coverage to py312 test job
sergioteula Oct 8, 2024
a97c17e
add pytest config
sergioteula Oct 8, 2024
f1468d4
added environment file for credentials in tests
sergioteula Oct 8, 2024
33649e3
add short summary for pytest
sergioteula Oct 9, 2024
244c189
use amazon credentials on workflow
sergioteula Oct 9, 2024
37ad1fa
created integration test for varios api methods
sergioteula Oct 9, 2024
ae44f9d
run tests in series
sergioteula Oct 9, 2024
afc2a5b
remove get variations from test
sergioteula Oct 9, 2024
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
Prev Previous commit
Next Next commit
automatic fixes from pre-commit
sergioteula committed Oct 7, 2024
commit 6d5cdda42ed658972f97b663dcef4530f980e46d
19 changes: 10 additions & 9 deletions amazon_paapi/api.py
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ class AmazonApi:

Raises:
``InvalidArgumentException``

"""

def __init__(
@@ -36,7 +37,7 @@ def __init__(
tag: str,
country: models.Country,
throttling: float = 1,
**kwargs
**kwargs,
):
self._key = key
self._secret = secret
@@ -62,7 +63,7 @@ def get_items(
currency_of_preference: str = None,
languages_of_preference: List[str] = None,
include_unavailable: bool = False,
**kwargs
**kwargs,
) -> List[models.Item]:
"""Get items information from Amazon.

@@ -91,8 +92,8 @@ def get_items(
``MalformedRequestException``
``ApiRequestException``
``ItemsNotFoundException``
"""

"""
kwargs.update(
{
"condition": condition,
@@ -136,7 +137,7 @@ def search_items(
min_reviews_rating: int = None,
search_index: str = None,
sort_by: models.SortBy = None,
**kwargs
**kwargs,
) -> models.SearchResult:
"""Searches for items on Amazon based on a search query. At least one of the
following parameters should be specified: ``keywords``, ``actor``, ``artist``,
@@ -195,8 +196,8 @@ def search_items(
``MalformedRequestException``
``ApiRequestException``
``ItemsNotFoundException``
"""

"""
kwargs.update(
{
"item_count": item_count,
@@ -237,7 +238,7 @@ def get_variations(
currency_of_preference: str = None,
languages_of_preference: List[str] = None,
merchant: models.Merchant = None,
**kwargs
**kwargs,
) -> models.VariationsResult:
"""Returns a set of items that are the same product, but differ according to a
consistent theme, for example size and color. A variation is a child ASIN.
@@ -268,8 +269,8 @@ def get_variations(
``MalformedRequestException``
``ApiRequestException``
``ItemsNotFoundException``
"""

"""
asin = arguments.get_items_ids(asin)[0]

kwargs.update(
@@ -293,7 +294,7 @@ def get_browse_nodes(
self,
browse_node_ids: List[str],
languages_of_preference: List[str] = None,
**kwargs
**kwargs,
) -> List[models.BrowseNode]:
"""Returns the specified browse node's information like name, children and
ancestors.
@@ -314,8 +315,8 @@ def get_browse_nodes(
``MalformedRequestException``
``ApiRequestException``
``ItemsNotFoundException``
"""

"""
kwargs.update(
{
"browse_node_ids": browse_node_ids,
1 change: 0 additions & 1 deletion amazon_paapi/helpers/arguments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Module with helper functions for managing arguments."""


from typing import List, Union

from ..errors import InvalidArgument
1 change: 0 additions & 1 deletion amazon_paapi/helpers/generators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Module with helper functions for making generators."""


from typing import Generator, List


1 change: 0 additions & 1 deletion amazon_paapi/helpers/requests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Module with helper functions for creating requests."""


import inspect
from typing import List

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import setuptools

with open("README.md", "r", encoding="utf8") as fh:
with open("README.md", encoding="utf8") as fh:
long_description = fh.read()

setuptools.setup(