Skip to content

Commit

Permalink
chore: ran black in the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jun 9, 2024
1 parent 1300de0 commit ec1c42d
Show file tree
Hide file tree
Showing 73 changed files with 531 additions and 603 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
- uses: actions/checkout@v1
- run: python --version
- run: pip install -r requirements.txt
- run: |
pip install black
black . --check
if: matrix.python-version == '3.12'
- run: python setup.py test
- run: pip install twine wheel
- run: python setup.py sdist bdist_wheel
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@ jobs:
name: Build
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, rc]
python-version: [
2.7,
3.5,
3.6,
3.7,
3.8,
3.9,
"3.10",
"3.11",
"3.12",
latest,
rc
]
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}
steps:
- uses: actions/checkout@v1
- run: python --version
- run: pip install -r requirements.txt
- run: |
pip install black
black . --check
if: matrix.python-version == '3.12'
- run: python setup.py test
build-pypy:
name: Build PyPy
Expand All @@ -24,4 +40,8 @@ jobs:
- uses: actions/checkout@v1
- run: pypy --version
- run: pip install -r requirements.txt
- run: |
pip install black
black . --check
if: matrix.python-version == '3.12'
- run: pypy setup.py test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ session.shelve*

.DS_Store

/.vscode/settings.json

/.env
/.venv

/dist
/build
/src/eadapters.egg-info
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

*
* Ran black in the codebase

### Fixed

Expand Down
38 changes: 15 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@
import setuptools

setuptools.setup(
name = "eadapters",
version = "0.4.3",
author = "Hive Solutions Lda.",
author_email = "[email protected]",
description = "E-Commerce Adapters",
license = "Apache License, Version 2.0",
keywords = "e-commerce adapters logic",
url = "http://eadapters.hive.pt",
zip_safe = False,
packages = [
"eadapters",
"eadapters.models",
"eadapters.models.budy"
],
package_dir = {
"" : os.path.normpath("src")
},
install_requires = [
"budy-api"
],
classifiers = [
name="eadapters",
version="0.4.3",
author="Hive Solutions Lda.",
author_email="[email protected]",
description="E-Commerce Adapters",
license="Apache License, Version 2.0",
keywords="e-commerce adapters logic",
url="http://eadapters.hive.pt",
zip_safe=False,
packages=["eadapters", "eadapters.models", "eadapters.models.budy"],
package_dir={"": os.path.normpath("src")},
install_requires=["budy-api"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License",
Expand All @@ -40,6 +32,6 @@
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
]
"Programming Language :: Python :: 3.7",
],
)
61 changes: 34 additions & 27 deletions src/eadapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import appier


class BaseAdapter(object):

def __init__(self, *args, **kwargs):
Expand All @@ -13,7 +14,7 @@ def __init__(self, *args, **kwargs):
self.uuid = kwargs.get("uuid", str(uuid.uuid4()))

def get_context(self):
return dict(uuid = self.uuid)
return dict(uuid=self.uuid)

def set_context(self, context):
for name, value in appier.legacy.iteritems(context):
Expand Down Expand Up @@ -86,7 +87,7 @@ def slug_sections(self, id, *args, **kwargs):
raise appier.NotImplementedError()

def sort_sections(self, colors):
colors.sort(key = lambda item: item.name)
colors.sort(key=lambda item: item.name)

def list_brands(self, *args, **kwargs):
raise appier.NotImplementedError()
Expand Down Expand Up @@ -134,7 +135,7 @@ def slug_color(self, id, *args, **kwargs):
raise appier.NotImplementedError()

def sort_colors(self, colors):
colors.sort(key = lambda item: item.name)
colors.sort(key=lambda item: item.name)

def create_subscription(self, subscription, *args, **kwargs):
raise appier.NotImplementedError()
Expand Down Expand Up @@ -169,28 +170,28 @@ def create_address(self, address, *args, **kwargs):
def mandatory_attributes_address(self, country_code, *args, **kwargs):
raise appier.NotImplementedError()

def addresses_account(self, account_id = None, *args, **kwargs):
def addresses_account(self, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def address_account(self, address_id, account_id = None, *args, **kwargs):
def address_account(self, address_id, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def create_address_account(self, address, account_id = None, *args, **kwargs):
def create_address_account(self, address, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def update_address_account(self, address, account_id = None, *args, **kwargs):
def update_address_account(self, address, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def delete_address_account(self, address_id, account_id = None, *args, **kwargs):
def delete_address_account(self, address_id, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def orders_account(self, account_id = None, *args, **kwargs):
def orders_account(self, account_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def empty_bag(self, bag_id = None, *args, **kwargs):
def empty_bag(self, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def create_order_bag(self, bag_id = None, *args, **kwargs):
def create_order_bag(self, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def get_order_checkout(self, id, *args, **kwargs):
Expand All @@ -217,10 +218,14 @@ def cancel_order(self, id, cancel_data, *args, **kwargs):
def set_store_order(self, store_id, order_id, *args, **kwargs):
raise appier.NotImplementedError()

def set_shipping_address_order(self, address_id, order_id, account_id = None, *args, **kwargs):
def set_shipping_address_order(
self, address_id, order_id, account_id=None, *args, **kwargs
):
raise appier.NotImplementedError()

def set_billing_address_order(self, address_id, order_id, account_id = None, *args, **kwargs):
def set_billing_address_order(
self, address_id, order_id, account_id=None, *args, **kwargs
):
raise appier.NotImplementedError()

def set_store_shipping_order(self, order_id, *args, **kwargs):
Expand Down Expand Up @@ -259,44 +264,46 @@ def list_card_payment_methods(self, *args, **kwargs):
def confirm_payment(self, transation_id, parameters, *args, **kwargs):
raise appier.NotImplementedError()

def get_bag(self, bag_id = None, *args, **kwargs):
def get_bag(self, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def add_bag_line(self, product_id, quantity = 1, bag_id = None, *args, **kwargs):
def add_bag_line(self, product_id, quantity=1, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def update_bag_line(self, bag_line, bag_id = None, *args, **kwargs):
def update_bag_line(self, bag_line, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def remove_bag_line(self, line_id, bag_id = None, *args, **kwargs):
def remove_bag_line(self, line_id, bag_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def get_wishlist(self, wishlist_id = None, *args, **kwargs):
def get_wishlist(self, wishlist_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def add_wishlist_line(
self,
product_id,
quantity = 1,
size = None,
scale = None,
wishlist_id = None,
quantity=1,
size=None,
scale=None,
wishlist_id=None,
*args,
**kwargs
):
raise appier.NotImplementedError()

def update_wishlist_line(self, line, wishlist_id = None, *args, **kwargs):
def update_wishlist_line(self, line, wishlist_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def remove_wishlist_line(self, line_id, wishlist_id = None, *args, **kwargs):
def remove_wishlist_line(self, line_id, wishlist_id=None, *args, **kwargs):
raise appier.NotImplementedError()

def _get_api(self, *args, **kwargs):
raise appier.NotImplementedError()

def _convert(self, kwargs, old, new, delete = True):
if not old in kwargs: return
def _convert(self, kwargs, old, new, delete=True):
if not old in kwargs:
return
value = kwargs[old]
kwargs[new] = value
if delete: del kwargs[old]
if delete:
del kwargs[old]
Loading

0 comments on commit ec1c42d

Please sign in to comment.