Skip to content

Commit

Permalink
Lint docs example
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Sep 17, 2024
1 parent 61c2ded commit ee273ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 29 deletions.
15 changes: 7 additions & 8 deletions docs/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"source": [
"import logging\n",
"\n",
"logging.getLogger(\"requests.packages.urllib3\").setLevel(logging.DEBUG)"
"logging.getLogger('requests.packages.urllib3').setLevel(logging.DEBUG)"
]
},
{
Expand Down Expand Up @@ -68,8 +68,9 @@
"metadata": {},
"outputs": [],
"source": [
"from ci_config import *\n",
"from sonyci import SonyCi, Config\n",
"from ci_config import client_id, client_secret, password, username, workspace_id\n",
"\n",
"from sonyci import SonyCi\n",
"\n",
"ci = SonyCi(\n",
" username=username,\n",
Expand Down Expand Up @@ -115,7 +116,6 @@
"source": [
"from requests_oauth2client.tokens import BearerTokenSerializer\n",
"\n",
"\n",
"with open('../.token') as f:\n",
" token = BearerTokenSerializer().loads(f.read())"
]
Expand All @@ -128,7 +128,6 @@
"source": [
"from sonyci.sonyci import SonyCi\n",
"\n",
"\n",
"ci = SonyCi(t=token)"
]
},
Expand Down Expand Up @@ -157,8 +156,8 @@
"metadata": {},
"outputs": [],
"source": [
"ci = SonyCi.load_from_toml(\"../ci.toml\")\n",
"ci(\"workspaces\")"
"ci = SonyCi.load_from_toml('../ci.toml')\n",
"ci('workspaces')"
]
}
],
Expand All @@ -178,7 +177,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
"version": "3.12.4"
},
"orig_nbformat": 4
},
Expand Down
35 changes: 14 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
name = 'sonyci'
description = 'A Sony Ci api client'
authors = [{ name = 'WGBH-MLA', email = '[email protected]' }]
dependencies = [
"pydantic~=2.9",
"requests-oauth2client~=1.6",
"loguru~=0.7",
]
dependencies = ["pydantic~=2.9", "requests-oauth2client~=1.6", "loguru~=0.7"]
requires-python = '>=3.8'
readme = 'README.md'
license = { text = 'MIT' }
Expand All @@ -25,15 +21,9 @@ test = [
"pytest-xdist~=3.6",
"urllib3~=1.26",
]
cli = [
"typer[all]~=0.12",
]
cli-ci = [
"typer~=0.12",
]
tui = [
"trogon~=0.5",
]
cli = ["typer[all]~=0.12"]
cli-ci = ["typer~=0.12"]
tui = ["trogon~=0.5"]
docs = [
"mkdocs~=1.6",
"mkdocs-material~=9.5",
Expand All @@ -51,11 +41,14 @@ build-backend = 'pdm.backend'
version = { source = 'file', path = 'sonyci/_version.py' }

[tool.pdm.dev-dependencies]
dev = [
"ruff~=0.6",
"black~=24.8",
"pre-commit~=3.5",
]
dev = ["ruff~=0.6", "black~=24.8", "pre-commit~=3.5"]

[tool.pdm.scripts]
ci = { call = 'sonyci.cli:app' }
format = 'black -S .'
lint = 'ruff . --fix'
test = 'pytest -n auto --vcr-record=none --no_ci'
docs = 'mkdocs serve'

[tool.pytest.ini_options]
testpaths = ['tests']
Expand All @@ -64,10 +57,10 @@ markers = ['no_ci: marks tests to skip on CI']
[tool.coverage.run]
omit = ['tests/*']

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'

[tool.ruff]
[tool.ruff.lint]
select = [
'B', # flake8-bugbear
'C4', # flake8-comprehensions
Expand Down

0 comments on commit ee273ed

Please sign in to comment.