diff --git a/pdm.lock b/pdm.lock index 76bae0b..f305f6f 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "amqp", "docs", "lint", "test"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:1225dc5ca19126455e57b97a0316197ad0dcfb5492592424a6cf38f26117df21" +content_hash = "sha256:ff374db8858c76f77a76bfeea9be055aeda34404a49abbf60b64a3543deee5eb" [[metadata.targets]] requires_python = ">=3.8.10,<4.0" @@ -322,6 +322,17 @@ files = [ {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, ] +[[package]] +name = "codespell" +version = "2.3.0" +requires_python = ">=3.8" +summary = "Codespell" +groups = ["lint"] +files = [ + {file = "codespell-2.3.0-py3-none-any.whl", hash = "sha256:a9c7cef2501c9cfede2110fd6d4e5e62296920efe9abfb84648df866e47f58d1"}, + {file = "codespell-2.3.0.tar.gz", hash = "sha256:360c7d10f75e65f67bad720af7007e1060a5d395670ec11a7ed1fed9dd17471f"}, +] + [[package]] name = "colorama" version = "0.4.6" diff --git a/pyproject.toml b/pyproject.toml index 9ada934..cbc34be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,33 +46,6 @@ Issues = "https://github.com/INTERSECT-SDK/python-sdk/issues" amqp = ["pika>=1.3.2,<2.0.0"] docs = ["sphinx>=5.3.0", "furo>=2023.3.27"] -[tool.pdm.dev-dependencies] -lint = [ - "pre-commit>=3.3.1", - "ruff==0.5.7", - "mypy>=1.10.0", - "types-paho-mqtt>=1.6.0.20240106", -] -test = ["pytest>=7.3.2", "pytest-cov>=4.1.0", "httpretty>=1.1.4"] - - -[tool.pdm.scripts] -test-all = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml" -test-all-debug = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml -s" -test-unit = "pytest tests/unit --cov=src/intersect_sdk/" -test-e2e = "pytest tests/e2e --cov=src/intersect_sdk/" -lint = { composite = ["lint-format", "lint-ruff", "lint-mypy"] } -lint-format = "ruff format" -lint-ruff = "ruff check --fix" -lint-mypy = "mypy src/intersect_sdk/" - -[tool.pdm.build] -package-dir = "src" - -[tool.pdm.version] -source = "file" -path = "src/intersect_sdk/version.py" - [tool.ruff] line-length = 100 format = { quote-style = 'single' } @@ -194,13 +167,43 @@ exclude_also = [ 'except.* ImportError', # these are usually used to throw a "friendlier" error and are not really worth testing ] + +[tool.pdm.dev-dependencies] +lint = [ + "pre-commit>=3.3.1", + "ruff==0.5.7", + "mypy>=1.10.0", + "types-paho-mqtt>=1.6.0.20240106", + "codespell>=2.3.0", +] +test = ["pytest>=7.3.2", "pytest-cov>=4.1.0", "httpretty>=1.1.4"] + + +[tool.pdm.scripts] +test-all = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml" +test-all-debug = "pytest tests/ --cov=src/intersect_sdk/ --cov-fail-under=80 --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml -s" +test-unit = "pytest tests/unit --cov=src/intersect_sdk/" +test-e2e = "pytest tests/e2e --cov=src/intersect_sdk/" +lint = { composite = ["lint-format", "lint-ruff", "lint-mypy", "lint-spelling"] } +lint-format = "ruff format" +lint-ruff = "ruff check --fix" +lint-mypy = "mypy src/intersect_sdk/" +lint-spelling = "codespell -w docs examples src tests *.md -S docs/_build" + +[tool.pdm.build] +package-dir = "src" + +[tool.pdm.version] +source = "file" +path = "src/intersect_sdk/version.py" + [build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" [tool.codespell] # Ref: https://github.com/codespell-project/codespell#using-a-config-file -skip = '.git*,*.lock' +skip = '.git*,*.lock,.venv,.*cache/*,./docs/_build/*' check-hidden = true # ignore-regex = '' # ignore-words-list = '' diff --git a/src/intersect_sdk/schema.py b/src/intersect_sdk/schema.py index 042769f..7513854 100644 --- a/src/intersect_sdk/schema.py +++ b/src/intersect_sdk/schema.py @@ -48,11 +48,11 @@ def get_schema_from_capability_implementations( The generated schema is currently not a complete replica of the AsyncAPI spec. See https://www.asyncapi.com/docs/reference/specification/v2.6.0 for the complete specification. Some key differences: - - We utilize three custom fields: "capabilities", "events", and "status". - - "capabilities" contains a dictionary: the keys of this dictionary are capability names. The values are dictionaries with the "description" property being a string which describes the capability, - and a "channels" property which more closely follows the AsyncAPI specification of the top-level value "channels". - - "events" is a key-value dictionary: the keys represent the event name, the values represent the associated schema of the event type. Events are currently shared across all capabilities. - - "status" will have a value of the status schema - if no status has been defined, a null schema is used. + - We utilize three custom fields: "capabilities", "events", and "status". + - "capabilities" contains a dictionary: the keys of this dictionary are capability names. The values are dictionaries with the "description" property being a string which describes the capability, + and a "channels" property which more closely follows the AsyncAPI specification of the top-level value "channels". + - "events" is a key-value dictionary: the keys represent the event name, the values represent the associated schema of the event type. Events are currently shared across all capabilities. + - "status" will have a value of the status schema - if no status has been defined, a null schema is used. Params: - capability_types - list of classes (not objects) of capabilities. We do not require capabilities to be instantiated here, in case the instantiation of a capability has external dependencies.