diff --git a/.gitignore b/.gitignore index 437035f..734267e 100644 --- a/.gitignore +++ b/.gitignore @@ -157,7 +157,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ .vscode .ruff_cache .python-version diff --git a/README.md b/README.md index 508b989..009219e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ Documentation, contribution rules, process and the code itself (this includes th ## Installation -Install [Hatch](https://hatch.pypa.io/latest/install/#pipx). +``` +pip install saleor-sdk-python +``` ## Tooling @@ -26,30 +28,51 @@ saleor-sdk tools decode-id VXNlcjoyMg== saleor-sdk tools encode-id User 22 ``` -## Documentation +## Development + +To contribute to this repository you will need Hatch to setup a local development environment. + +Install [Hatch](https://hatch.pypa.io/latest/install/#pipx). + +### Documentation + +1. Run the below command to start a dev server with the documentation site: ``` hatch run docs:serve ``` +Dev server provides a live reload on changes and lets you preview the site after it's published + + + and navigate to http://127.0.0.1:8000 -## Tests +### Tests + +To run tests suite use the following command: ``` hatch run test ``` -## Build and deploy +### Code style and linters + +Use the following commands to format the code and lint it for issues: ``` -hatch build -c -hatch publish +hatch run lint:fmt +hatch run lint:all ``` -## Code style + +### Build and deploy + +To publish a new version to PyPI, update it's version number in the `pyproject/toml` file and create new github release. + +In case whe you need to make a new release without GitHub workflow, use following `hatch` commands: ``` -hatch run lint:fmt -hatch run lint:all +hatch build -c +hatch publish ``` diff --git a/docs/assets/marina_logo.svg b/docs/assets/marina_logo.svg new file mode 100644 index 0000000..272cb03 --- /dev/null +++ b/docs/assets/marina_logo.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/assets/marina_logo_black.svg b/docs/assets/marina_logo_black.svg new file mode 100644 index 0000000..209177f --- /dev/null +++ b/docs/assets/marina_logo_black.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/docs/assets/marina_logo_white.svg b/docs/assets/marina_logo_white.svg new file mode 100644 index 0000000..c0f2498 --- /dev/null +++ b/docs/assets/marina_logo_white.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/docs/assets/mirumee.png b/docs/assets/mirumee.png new file mode 100644 index 0000000..d3375f8 Binary files /dev/null and b/docs/assets/mirumee.png differ diff --git a/docs/css/extra.css b/docs/css/extra.css index 7fda3c7..0b4449a 100644 --- a/docs/css/extra.css +++ b/docs/css/extra.css @@ -1,3 +1,24 @@ header { border-bottom: 4px solid var(--md-accent-fg-color); } + +.md-copyright { + width: 100%; +} + + +.md-copyright .made-with-love{ + float: right; + line-height: 24px; +} + +.md-copyright .made-with-love .footer_mirumee_logo{ + height: 24px; + vertical-align: top; + opacity: 0.7; +} + + +.md-copyright .made-with-love:hover .footer_mirumee_logo{ + opacity: 1; +} diff --git a/docs/index.md b/docs/index.md index b8d3a1f..fc854be 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,34 @@ # Introduction -TDB... +Saleor SDK Python is a Python library that implements tools and solutions useful in Saleor application development, including: + +- the `saleor_sdk.crypto` package for working with Saleor's auth. + +Before starting, you should familiarize yourself with Saleor's [Extending Saleor](https://docs.saleor.io/docs/3.x/developer/extending/overview) documentation +and learn basic concepts like apps, webhooks and events. + + +This SDK is framework agnostic. It can be used with any Python web framework, or without framework as part of a script. + +## What about the Python App Framework? + +The [saleor-app-framework-python](https://github.com/mirumee/saleor-app-framework-python) has been deprecated and is no longer maintained. + +## Installation + +``` +pip install saleor-sdk-python +``` + +## Key features + +- CLI tools automating common development tasks: testing, linting and publication. +- CLI utility for deserializing Saleor's GraphQL IDs values to reveal type names and their database IDs - helpful in debugging and local development. +- +- Crypto module helping with Saleor authentication, both JWT verification and webhook signature verification - provides a way to manage Saleor issued signatures +- Marina module - more on that in a later time... + +## Best served with + +- https://ariadnegraphql.org/ +- https://github.com/mirumee/ariadne-codegen diff --git a/docs/overrides/partials/copyright.html b/docs/overrides/partials/copyright.html new file mode 100644 index 0000000..cf10af3 --- /dev/null +++ b/docs/overrides/partials/copyright.html @@ -0,0 +1,19 @@ +{#- + This file was automatically generated - do not edit +-#} + diff --git a/mkdocs.yml b/mkdocs.yml index 72f05a9..315dd57 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,9 +1,13 @@ site_name: Saleor SDK Python repo_url: https://github.com/mirumee/saleor-sdk-python edit_uri: edit/main/docs/ +copyright: Copyright © 2024 - Mirumee Software theme: + logo: /assets/marina_logo_white.svg + favicon: /assets/marina_logo.svg name: material + custom_dir: docs/overrides palette: # Palette toggle for light mode - media: "(prefers-color-scheme: light)"