Skip to content

Commit

Permalink
add codespell local workflow, fix documentation indentation
Browse files Browse the repository at this point in the history
Signed-off-by: Lance Drane <[email protected]>
  • Loading branch information
Lance-Drane committed Nov 25, 2024
1 parent 08a414c commit 029266f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 34 deletions.
13 changes: 12 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 31 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down Expand Up @@ -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 = ''
10 changes: 5 additions & 5 deletions src/intersect_sdk/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 029266f

Please sign in to comment.