Skip to content

Commit 8a42f1e

Browse files
authored
Merge pull request #39 from Sindri-Labs/kp-complete-method-params
Refactor internal methods, update docstrings, align methods to api endpoints
2 parents 5fcc2a4 + 8c3463d commit 8a42f1e

12 files changed

Lines changed: 825 additions & 398 deletions

File tree

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ exclude =
66
.pytest_cache/*
77
__pycache__/*
88
.vscode
9+
venv
10+
env
911

1012
ignore =
1113
# Ignore flake8 errors that conflict with Black

.github/workflows/lint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Lint Codebase
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
# Do not run on draft pull requests
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- ready_for_review
13+
14+
jobs:
15+
run-lint:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} # Do not run on draft pull requests
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python 3.10.6
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: 3.10.6
27+
28+
- name: Install poetry
29+
run: pip install poetry
30+
31+
- name: Install Dependencies
32+
run: poetry install
33+
34+
- name: Check formatting with black
35+
if: success() || failure()
36+
run: |
37+
poetry run black --check .
38+
39+
- name: Check import order with isort
40+
if: success() || failure()
41+
run: |
42+
poetry run isort --check-only .
43+
44+
- name: Lint with flake8
45+
if: success() || failure()
46+
run: |
47+
poetry run flake8 .
48+
49+
- name: Verify typing annotations
50+
if: success() || failure()
51+
run: |
52+
poetry run mypy .

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ skip =
1111
.pytest_cache/*
1212
.vscode
1313
__pycache__/*
14+
venv
15+
env

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Contains SDK code for Sindri APIs. Please see [sindri.app](https://sindri.app) f
1212

1313
## Documentation and Usage
1414
Documentation for this repo is automatically generated from the Python docstrings using [lazydocs](https://pypi.org/project/lazydocs/) and published to [sindri.app/docs/reference/sdk/](https://sindri.app/docs/reference/sdk/python) along with the rest of the documentation for Sindri.
15+
Docstrings for functions and methods follow the [google standard](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods) for formatting.
1516

1617
## License
1718
[![](https://img.shields.io/github/license/sindri-labs/sindri-python?style=for-the-badge)](https://img.shields.io/github/license/sindri-labs/sindri-python?style=for-the-badge)

poetry.lock

Lines changed: 190 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

py_format_code.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# File formatters
4+
echo ""
5+
echo "(python) black..."
6+
black .
7+
8+
9+
echo ""
10+
echo "(python) isort..."
11+
isort --overwrite-in-place .
12+
13+
# Analyze code and report errors
14+
echo ""
15+
echo "(python) flake8..."
16+
flake8 .
17+
18+
echo ""
19+
echo "(python) mypy..."
20+
mypy .
21+

pyproject.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ exclude = '''
1010
| .mypy_cache
1111
| .pytest_cache
1212
| __pycache__
13+
| venv
14+
| env
1315
)/
1416
)
1517
'''
1618

1719
[tool.mypy]
1820
python_version = "3.10"
21+
exclude = ["venv/*", 'env/*']
1922

2023
[tool.poetry]
2124
authors = [
@@ -32,7 +35,7 @@ license = "MIT"
3235
name = "sindri"
3336
readme = "README.md"
3437
repository = "https://github.com/Sindri-Labs/sindri-python"
35-
version = "0.0.6"
38+
version = "0.0.0"
3639

3740
[tool.poetry.dependencies]
3841
python = "^3.10"
@@ -43,4 +46,8 @@ lazydocs = "^0.4.8"
4346
mkdocs = "^1.5.3"
4447
mkdocs-awesome-pages-plugin = "^2.9.2"
4548
pytest = "^8.1.1"
46-
49+
black = "24.2.0"
50+
flake8 = "7.0.0"
51+
isort = "5.10.1"
52+
mypy = "^1.9.0"
53+
types-requests = "^2.31.0.20240311"

src/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)