Skip to content

Commit

Permalink
More (#8)
Browse files Browse the repository at this point in the history
* more docs + generic provider type inference

* handle provides type better

* better message

* add better link

* move to core dir

* move private to core

* lotsa stuff

* better docstring

* fix some issues

* wip

* add solutions

* some more fixes

* more fixes

* fix tests

* add fallback values

* minor optimization

* more fixes

* get it working again

* fix formatting

* more fixes

* fix lint

* fix tests

* ensure fast stack replicates exception stack

* update docstr

* fix misc

* remove fallback values

* overwrite context

* fix tests

* fix cov

* add more tests

* more test cov

* full cov

* docs

* test cov

* fix lint

* fix check cov

* add source_pkgs

* change order
  • Loading branch information
rmorshea authored Nov 14, 2024
1 parent 7acba82 commit d496684
Show file tree
Hide file tree
Showing 33 changed files with 2,862 additions and 1,376 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
restore-keys: ${{ runner.os }}-pip-
- name: Install Hatch
run: pipx install hatch
- name: Run lint
run: hatch run lint:all
- name: Run tests
run: hatch run cov-test
- name: Run lint
run: hatch run lint:all
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: ${{ github.workspace }}/.coverage.*
path: ${{ github.workspace }}/.coverage
include-hidden-files: true
- name: Build dist
run: hatch build
Expand Down Expand Up @@ -64,5 +64,5 @@ jobs:
python-version: "3.10"
- name: Install Hatch
run: pipx install hatch
- name: Run coverage
- name: Check coverage
run: hatch run cov-report
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ pip install -U pybooster

Getting started with PyBooster involves a few steps:

1. Define a [provider](https://ryanmorshead.com/pybooster/concepts.md#providers)
function for a
[dependency](https://ryanmorshead.com/pybooster/concepts.md#dependencies).
2. Add an [injector](https://ryanmorshead.com/pybooster/concepts.md#injectors) to a
1. Define a [provider](https://ryanmorshead.com/pybooster/features#providers) function
for a [dependency](https://ryanmorshead.com/pybooster/features#dependencies).
2. Add an [injector](https://ryanmorshead.com/pybooster/features#injectors) to a
function that will use that dependency.
3. Enter the
[provider's scope](https://ryanmorshead.com/pybooster/concepts.md#scoping-providers)
and call the dependent function in it.
[provider's scope](https://ryanmorshead.com/pybooster/features#scoping-providers) and
call the dependent function in it.

The example below injects a `sqlite3.Connection` into a function that executes a query:

Expand Down
31 changes: 29 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ repo_url: https://github.com/rmorshea/pybooster

nav:
- Home: index.md
- Tutorials: tutorials.md
- Tutorial: tutorial.md
- Concepts: concepts.md
- Recipes: recipes.md
- Integrations: integrations.md
- Examples: examples.md
- Reference: reference.md

Expand All @@ -19,14 +21,35 @@ theme:
logo: material/needle
features:
- content.code.copy
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference

plugins:
- search
- open-in-new-tab
- mkdocstrings:
handlers:
python:
import:
- https://docs.sqlalchemy.org/en/latest/objects.inv
options:
load_external_modules: true
docstring_style: google
members_order: alphabetical
merge_init_into_class: true
Expand All @@ -48,7 +71,11 @@ markdown_extensions:
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- admonition
- pymdownx.details
- pymdownx.superfences
Expand Down
Loading

0 comments on commit d496684

Please sign in to comment.