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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 0 additions & 30 deletions .github/workflows/pinact.yaml

This file was deleted.

40 changes: 1 addition & 39 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -54,41 +54,3 @@ jobs:

- name: Test with tox
run: tox

- name: Prepare artifacts
run: mkdir .coverage-data && mv .coverage.* .coverage-data/

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-data-${{ matrix.python-version }}
path: .coverage-data/
include-hidden-files: true

coverage:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: .
pattern: coverage-data-*
merge-multiple: true

- name: Set up Python 3.13
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: Prepare Coverage report
run: tox -e coverage-report

- name: Upload to codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
32 changes: 0 additions & 32 deletions .github/workflows/zizmor.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
version: 2

build:
image: latest
os: ubuntu-24.04
tools:
python: "3.13"

python:
version: 3.6

requirements_file: requirements_dev.txt
install:
- requirements: requirements_dev.txt
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Unreleased
----------
- *BREAKING*: requires Python 3.11 or newer; tested on 3.11–3.14.

26.10.12
--------
- *BREAKING*: the SDK now returns `None` instead of raising an exception when
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ generate:
java -jar ../rmf-codegen/rmf-codegen.jar generate ../commercetools-api-reference/api-specs/frontend-api/api.raml -o src/commercetools/frontend/ -t PYTHON_CLIENT
java -jar ../rmf-codegen/rmf-codegen.jar generate ../commercetools-api-reference/api-specs/checkout/api.raml -o src/commercetools/checkout/ -t PYTHON_CLIENT
find src/ -name "gen.properties" -delete
isort src/commercetools/
black src/commercetools/
ruff check --fix --select I src/commercetools/
ruff format src/commercetools/

test:
pytest tests/
Expand All @@ -26,8 +26,12 @@ runserver:
python -mcommercetools.testing.server

format:
isort src tests
black src/ tests/
ruff check --fix src tests
ruff format src tests

lint:
ruff format --check src tests
ruff check src tests

release:
pip install twine wheel
Expand Down
5 changes: 1 addition & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
.. image:: https://github.com/labd/commercetools-python-sdk/workflows/Python%20Tests/badge.svg
:target: https://github.com/labd/commercetools-python-sdk/actions

.. image:: http://codecov.io/github/labd/commercetools-python-sdk/coverage.svg?branch=main
:target: http://codecov.io/github/labd/commercetools-python-sdk?branch=main

.. image:: https://img.shields.io/pypi/v/commercetools.svg
:target: https://pypi.python.org/pypi/commercetools/
.. image:: https://readthedocs.org/projects/commercetools-python-sdk/badge/?version=latest
Expand All @@ -18,7 +15,7 @@ Python SDK for Commercetools
============================

This is an unofficial Python SDK for the Commercetools platform. It only
supports Python 3.6+ and uses type annotation for an improved development
supports Python 3.11+ and uses type annotation for an improved development
experience.

The API is generated using the commercetools api RAML file and uses
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Commercetools Python SDK
========================

This is an unofficial Python SDK for the Commercetools platform. It only
supports Python 3.6+ and uses type annotation for an improved development
supports Python 3.11+ and uses type annotation for an improved development
experience.

The API is mostly generated using the commercetools api RAML file and uses the
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[mypy]
ignore_missing_imports = True
python_version = 3.6
python_version = 3.11
warn_unused_configs = True
mypy_path = src
check_untyped_defs = True
20 changes: 12 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ build-backend = "setuptools.build_meta"
[tool.coverage.paths]
source = ["src", ".tox/*/site-packages", ".tox/*/lib/python*/site-packages"]

[tool.isort]
line_length = 88
multi_line_output = 3
include_trailing_comma = true
balanced_wrapping = true
default_section = "THIRDPARTY"
known_first_party = ["commercetools", "tests"]
use_parentheses = true
[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]

[tool.ruff.lint.isort]
known-first-party = ["commercetools", "tests"]

[tool.ruff.lint.per-file-ignores]
# Generated by rmf-codegen
"src/commercetools/{platform,importapi,frontend,checkout}/**" = ["F401", "F541", "F821"]
8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[flake8]
max-line-length = 99
max-complexity = 10
per-file-ignores =
src/commercetools/schemas/*.py:E501,F401
src/commercetools/types/*.py:E501,F401


[tool:pytest]
minversion = 6.0
testpaths = tests
9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
"pytest-cov==7.1.0",
"pytest==9.0.3",
# Linting
"isort==5.10.1",
"flake8==4.0.1",
"flake8-blind-except==0.2.0",
"flake8-debugger==4.0.0",
"flake8-imports==0.1.1",
"ruff==0.17.2",
"mypy==1.9.0",
]

Expand All @@ -51,7 +47,7 @@
author="Lab Digital B.V.",
author_email="opensource@labdigital.nl",
url="https://github.com/labd/commercetools-python-sdk",
python_requires=">=3.10",
python_requires=">=3.11",
install_requires=install_requires,
tests_require=tests_require,
extras_require={
Expand All @@ -67,7 +63,6 @@
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down
2 changes: 1 addition & 1 deletion src/commercetools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .exceptions import CommercetoolsError
from .version import __version__
from .version import __version__ as __version__

__all__ = ["CommercetoolsError"]
2 changes: 1 addition & 1 deletion src/commercetools/checkout/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
code: str,
type: str,
message: str,
payload: typing.Optional[object] = None
payload: typing.Optional[object] = None,
):
self.code = code
self.type = type
Expand Down
3 changes: 2 additions & 1 deletion src/commercetools/frontend/.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
import re
import typing

import marshmallow
import marshmallow_enum

from commercetools import helpers

from ... import models
import typing

# Fields

Expand Down
1 change: 0 additions & 1 deletion src/commercetools/frontend/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class Client(BaseClient):

def __init__(self, *args, **kwargs):
kwargs.setdefault("url", "https://{project}-{customer}.frontastic.io")
super().__init__(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class FrontasticActionByNamespaceByActionRequestBuilder:

_client: "BaseClient"
_namespace: str
_action: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class FrontasticActionRequestBuilder:

_client: "BaseClient"

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class ApiRequestBuilder:

_client: "BaseClient"

def __init__(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@

# This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
from ..upload.api_build_upload_request_builder import ApiBuildUploadRequestBuilder
import typing
import warnings

from ..upload.api_build_upload_request_builder import ApiBuildUploadRequestBuilder

if typing.TYPE_CHECKING:
from ...base_client import BaseClient


class ApiBuildRequestBuilder:

_client: "BaseClient"



def __init__(
self,
client: "BaseClient",
):
self._client = client

def upload(self) -> ApiBuildUploadRequestBuilder:
return ApiBuildUploadRequestBuilder(
client=self._client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class FrontasticContextRequestBuilder:

_client: "BaseClient"

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class FrontasticDataSourceByIdentifierRequestBuilder:

_client: "BaseClient"
_identifier: str

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class FrontasticDataSourceRequestBuilder:

_client: "BaseClient"

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class FrontasticRequestBuilder:

_client: "BaseClient"

def __init__(
Expand Down
Loading
Loading