Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly authored Oct 19, 2023
2 parents 5aff751 + 6fbe948 commit 9b28b6c
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 79 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# .github/dependabot.yml
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
10 changes: 5 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
needs: [release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
architecture: x64
- uses: abatilo/actions-poetry@v2.1.4
- uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: '1.1.13'
poetry-version: "1.1.13"
- run: poetry build
- run: poetry publish
env:
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,41 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.9', '3.8', '3.7']
extras: ['', all, soap_api, orjson, cli]
python-version: ["3.10", "3.9", "3.8", "3.7"]
extras: ["", all, soap_api, orjson, cli]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python-version }}'
architecture: x64
- uses: abatilo/actions-poetry@v2.1.4
with:
poetry-version: '1.1.13'
- run: poetry install --extras ${{ matrix.extras }}
if: matrix.extras != ''
- run: poetry install
if: matrix.extras == ''
- run: poetry run pytest -v
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
architecture: x64
- uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: "1.1.13"
- run: poetry install --extras ${{ matrix.extras }}
if: matrix.extras != ''
- run: poetry install
if: matrix.extras == ''
- run: poetry run pytest -v

style:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ["3.10"]
extras: [all]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python-version }}'
architecture: x64
- uses: abatilo/actions-poetry@v2.1.4
with:
poetry-version: '1.1.13'
- run: poetry install --extras ${{ matrix.extras }}
- run: poetry run flake8
- run: poetry run mypy --ignore-missing-imports .
- run: poetry run isort --check --diff .
- run: poetry run black --check --diff .
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
architecture: x64
- uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: "1.1.13"
- run: poetry install --extras ${{ matrix.extras }}
- run: poetry run flake8
- run: poetry run mypy --ignore-missing-imports .
- run: poetry run isort --check --diff .
- run: poetry run black --check --diff .
26 changes: 13 additions & 13 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.10'
architecture: x64
- uses: abatilo/actions-poetry@v2.1.4
with:
poetry-version: '1.1.13'
- run: poetry install --extras all
- run: poetry run pytest --cov=netsuite --cov-report=xml --cov-report=term
- uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: "1.1.13"
- run: poetry install --extras all
- run: poetry run pytest --cov=netsuite --cov-report=xml --cov-report=term
- uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: "3.9"
architecture: x64
- uses: abatilo/actions-poetry@v2.1.4
- uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: '1.1.13'
poetry-version: "1.1.13"
- run: poetry install --extras all
- run: poetry run mkdocs build
- uses: peaceiris/actions-gh-pages@v3.7.3
- uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
publish_dir: ./site
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Python Versions](https://img.shields.io/pypi/pyversions/netsuite.svg)](https://pypi.org/project/netsuite/)
[![PyPI status (alpha/beta/stable)](https://img.shields.io/pypi/status/netsuite.svg)](https://pypi.python.org/pypi/netsuite/)

Make async requests to NetSuite SuiteTalk SOAP/REST Web Services and Restlets
Make async requests to NetSuite SuiteTalk SOAP, REST Web Services, and Restlets. [Detailed documentation available here.](https://jacobsvante.github.io/netsuite/)

## Beta quality disclaimer

Expand Down
8 changes: 4 additions & 4 deletions netsuite/cli/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,21 +268,21 @@ async def rest_api_openapi_serve(config, args):
html = """<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui.css">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css">
<title>NetSuite REST Record API</title>
</head>
<body>
<div id="swagger-ui">
</div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<!-- `SwaggerUIBundle` is now available on the page -->
<script>
const ui = SwaggerUIBundle({
url: '/openapi.json',
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: "BaseLayout",
deepLinking: true
Expand Down
2 changes: 1 addition & 1 deletion netsuite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def from_ini(
else:
d[key] = val

return cls(**d)
return cls(**d) # type: ignore
14 changes: 9 additions & 5 deletions netsuite/soap_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def __init__(
self,
config: Config,
*,
version: str = None,
wsdl_url: str = None,
cache: zeep.cache.Base = None,
version: Optional[str] = None,
wsdl_url: Optional[str] = None,
cache: Optional[zeep.cache.Base] = None,
) -> None:
self._ensure_required_dependencies()
if version is not None:
Expand Down Expand Up @@ -390,7 +390,11 @@ async def getList(
extract=lambda resp: resp["record"],
)
async def get(
self, recordType: str, *, internalId: int = None, externalId: str = None
self,
recordType: str,
*,
internalId: Optional[int] = None,
externalId: Optional[str] = None,
) -> zeep.xsd.CompoundValue:
"""Get a single record"""
if len([v for v in (internalId, externalId) if v is not None]) != 1:
Expand Down Expand Up @@ -476,7 +480,7 @@ async def getItemAvailability(
*,
internalIds: Optional[Sequence[int]] = None,
externalIds: Optional[Sequence[str]] = None,
lastQtyAvailableChange: datetime = None,
lastQtyAvailableChange: Optional[datetime] = None,
) -> List[Dict]:
if internalIds is None:
internalIds = []
Expand Down
6 changes: 3 additions & 3 deletions netsuite/soap_api/decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import wraps
from typing import Any, Callable
from typing import Any, Callable, Optional

from .. import constants
from . import zeep
Expand All @@ -9,8 +9,8 @@


def WebServiceCall(
path: str = None,
extract: Callable = None,
path: Optional[str] = None,
extract: Optional[Callable] = None,
*,
default: Any = constants.NOT_SET,
) -> Callable:
Expand Down
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.7"
python = ">=3.8"
authlib = "~1"
# As per httpx recommendation we will lock to a fixed minor version until 1.0 is released
httpx = "~0.23"
httpx = "~0.25"
pydantic = "~1"
orjson = {version = "~3", optional = true}
ipython = {version = "~8", optional = true, python = "^3.8"}
zeep = {version = "^4.2.1", optional = true, extras = ["async"]}
orjson = { version = "~3", optional = true }
ipython = { version = "~8", optional = true, python = "^3.8" }
zeep = { version = "~4", optional = true, extras = ["async"] }
oauthlib = "~3"

[tool.poetry.extras]
Expand All @@ -40,13 +40,13 @@ all = ["zeep", "ipython", "orjson"]

[tool.poetry.dev-dependencies]
black = "~22"
flake8 = "~4"
flake8 = "~5"
isort = "~5"
mkdocs-material = "~8"
mypy = "~0"
mypy = "~1"
pytest = "~7"
pytest-cov = "~3"
types-setuptools = "^57.4.17"
pytest-cov = "~4"
types-setuptools = "^68.2.0"
types-requests = "^2.27.30"

[tool.poetry.scripts]
Expand All @@ -65,6 +65,4 @@ profile = "black"
multi_line_output = 3

[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]

0 comments on commit 9b28b6c

Please sign in to comment.