diff --git a/.pylintrc b/.pylintrc index 0063882..98f0c95 100644 --- a/.pylintrc +++ b/.pylintrc @@ -43,28 +43,29 @@ confidence=HIGH # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=too-many-arguments, - too-many-public-methods, - too-few-public-methods, - too-many-instance-attributes, - too-many-locals, - too-many-branches, - too-many-lines, - line-too-long, - similarities, +disable=bad-inline-option, + deprecated-pragma, + disallowed-name, + file-ignored, + global-statement, import-error, - raw-checker-failed, - bad-inline-option, + invalid-name, + line-too-long, locally-disabled, - file-ignored, + raw-checker-failed, + similarities, suppressed-message, - useless-suppression, - deprecated-pragma, - use-symbolic-message-instead, - invalid-name, - global-statement, + too-few-public-methods, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-positional-arguments, + too-many-public-methods, use-implicit-booleaness-not-comparison, - disallowed-name + use-symbolic-message-instead, + useless-suppression # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/.travis.yml b/.travis.yml index 8f2d2fe..d93815f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,10 +20,11 @@ script: jobs: include: - stage: Build-Test - python: '3.8' + - python: '3.9' - python: '3.10' - python: '3.11' - python: '3.12' + - python: '3.13' # Uncomment this stage to use semantic-release to automatically create new releases. # - stage: Semantic-Release @@ -37,7 +38,7 @@ jobs: # Uncomment this stage to automatically publish your package to pypi.org. # - stage: Publish-Release -# python: "3.8" +# python: "3.9" # name: Publish-To-PyPi # script: # - make ci diff --git a/Makefile b/Makefile index 12ca80c..a255975 100644 --- a/Makefile +++ b/Makefile @@ -2,40 +2,55 @@ # to be ready for development work in the local sandbox. # example: "make setup" -LINT_DIRS=eventstreams_sdk test/unit examples +PYTHON=python3 +LINT=black +LINT_DIRS=eventstreams_sdk test/unit test/integration examples -setup: deps dev_deps install_project +setup: deps dev-deps install-project -all: upgrade_pip setup test-unit lint +all: upgrade-pip setup test-unit lint ci: all -upgrade_pip: - python -m pip install --upgrade pip +publish-release: build-dist publish-dist + +upgrade-pip: + ${PYTHON} -m pip install --upgrade pip deps: - pip install -r requirements.txt + ${PYTHON} -m pip install . + +dev-deps: + ${PYTHON} -m pip install .[dev] -dev_deps: - pip install -r requirements-dev.txt +publish-deps: + ${PYTHON} -m pip install .[publish] -install_project: - pip install -e . +install-project: + ${PYTHON} -m pip install . -test: test-unit +test: test-unit # test-int test-unit: - python -m pytest test/unit + ${PYTHON} -m pytest test/unit + +# test-int: +# ${PYTHON} -m pytest test/integration test-examples: - pytest examples + ${PYTHON} -m pytest examples -lint: lint-fix - pylint ${LINT_DIRS} --exit-zero - black --check ${LINT_DIRS} +lint: + ${PYTHON} -m pylint ${LINT_DIRS} --exit-zero + ${LINT} --check ${LINT_DIRS} lint-fix: - black ${LINT_DIRS} + ${LINT} ${LINT_DIRS} + +build-dist: + rm -fr dist + ${PYTHON} -m build -example: - python examples/example.py +# This target requires the TWINE_PASSWORD env variable to be set to the user's pypi.org API token. +publish-dist: + TWINE_USERNAME=__token__ ${PYTHON} -m twine upload --non-interactive --verbose dist/* \ No newline at end of file diff --git a/eventstreams_sdk/adminrest_v1.py b/eventstreams_sdk/adminrest_v1.py index 7d433b9..a4dce49 100644 --- a/eventstreams_sdk/adminrest_v1.py +++ b/eventstreams_sdk/adminrest_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/eventstreams_sdk/schemaregistry_v1.py b/eventstreams_sdk/schemaregistry_v1.py index 56edbe8..f3278d4 100644 --- a/eventstreams_sdk/schemaregistry_v1.py +++ b/eventstreams_sdk/schemaregistry_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..56e3030 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = [ + "setuptools>=67.7.2", + "wheel" +] +build-backend = "setuptools.build_meta" + +[project] +name = "eventstreams_sdk" +dynamic = ["version"] +description = "Event Streams Python SDK" +license = {file = "LICENSE"} +authors = [ + {name = "IBM", email = "eventstreams@uk.ibm.com"}, +] +readme = "README.md" +requires-python = ">= 3.8" +dependencies = [ + "ibm_cloud_sdk_core>=3.20.6,<4.0.0" +] +keywords = ["eventstreams_sdk","ibm", "cloud", "ibm cloud services"] +classifiers=[ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Libraries :: Application Frameworks", +] + +[project.urls] +Homepage = "https://github.com/IBM/eventstreams-python-sdk" +Documentation = "https://github.com/IBM/eventstreams-python-sdk/blob/main/README.md" +Issues = "https://github.com/IBM/eventstreams-python-sdk/issues" +Contributing = "https://github.com/IBM/eventstreams-python-sdk/blob/main/CONTRIBUTING.md" +License = "https://github.com/IBM/eventstreams-python-sdk/blob/main/LICENSE" + +[project.optional-dependencies] +dev = [ + "coverage>=7.3.2,<8.0.0", + "pylint>=3.0.0,<4.0.0", + "pytest>=7.4.2,<8.0.0", + "pytest-cov>=4.1.0,<5.0.0", + "responses>=0.23.3,<1.0.0", + "black>=24.0.0,<25.0.0", +] +publish = [ + "build", + "twine" +] + +[tool.setuptools] +packages = ["eventstreams_sdk"] + +[tool.black] +line-length = 120 +skip-string-normalization = true \ No newline at end of file diff --git a/test/unit/test_adminrest_v1.py b/test/unit/test_adminrest_v1.py index 7d66330..fa30203 100644 --- a/test/unit/test_adminrest_v1.py +++ b/test/unit/test_adminrest_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/unit/test_schemaregistry_v1.py b/test/unit/test_schemaregistry_v1.py index 6a97b49..f33886d 100644 --- a/test/unit/test_schemaregistry_v1.py +++ b/test/unit/test_schemaregistry_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.