Skip to content

Commit

Permalink
chore: additional CI and PDM cleanup (#2413)
Browse files Browse the repository at this point in the history
* chore: updated dev deps

* chore: updated lock file for modified dep

* fix: disables pre-commit hooks

* ci: remove commented pre-commit code

* chore: updated lock file

* ci: fix

* chore: adds aiosqlite for testing

* ci: install all for doc building

* ci: change pdm install to all
  • Loading branch information
cofin authored Oct 7, 2023
1 parent a35d392 commit da2a0f2
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
./pdm.lock
- name: Install dependencies
run: pdm install -G:docs
run: pdm install -G:all

- name: Build docs
run: pdm run make docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
./pdm.lock
- name: Install dependencies
run: pdm install -G:docs
run: pdm install -G:all

- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
./pdm.lock
- name: Install dependencies
run: pdm install
run: pdm install -G:all

- if: ${{ inputs.pydantic-version == '1' }}
name: Prepare for pydantic v1
Expand Down
23 changes: 9 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,21 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pdm-project/pdm
rev: 2.9.2
hooks:
- id: pdm-lock-check
- repo: https://github.com/provinzkraut/unasyncd
rev: "v0.6.1"
hooks:
- id: unasyncd
additional_dependencies: ["ruff"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.290"
rev: "v0.0.292"
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
exclude: "tests/openapi/typescript_converter/test_converter"
exclude: "tests/openapi/typescript_converter/test_converter|README.md"
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
Expand Down Expand Up @@ -72,7 +68,6 @@ repos:
annotated_types,
anyio,
async_timeout,
asyncmy,
asyncpg,
asyncpg_stubs,
attrs,
Expand All @@ -89,16 +84,15 @@ repos:
jsbeautifier,
mako,
mongomock_motor,
minijinja,
msgspec,
multidict,
opentelemetry-instrumentation-asgi,
opentelemetry-sdk,
oracledb,
piccolo,
picologging,
polyfactory,
prometheus_client,
psycopg,
pydantic-extra-types,
pydantic>=2,
pytest,
Expand All @@ -113,15 +107,17 @@ repos:
rich,
rich-click,
sqlalchemy>=2.0.12,
advanced-alchemy==0.2.2,
starlette,
structlog,
advanced-alchemy==0.2.2,
time-machine,
types-beautifulsoup4,
types-python-jose,
types-pyyaml,
types-redis,
uvicorn,
uvloop,
httptools,
]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.328
Expand All @@ -134,7 +130,6 @@ repos:
annotated_types,
anyio,
async_timeout,
asyncmy,
asyncpg,
asyncpg_stubs,
attrs,
Expand All @@ -156,12 +151,10 @@ repos:
multidict,
opentelemetry-instrumentation-asgi,
opentelemetry-sdk,
oracledb,
piccolo,
picologging,
polyfactory,
prometheus_client,
psycopg,
pydantic-extra-types,
pydantic>=2,
pytest,
Expand All @@ -185,6 +178,8 @@ repos:
types-pyyaml,
types-redis,
uvicorn,
uvloop,
httptools,
]
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: "v0.6.8"
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ install: ## Install the project, dependencies, and pre-commit for loca
if [ "$(VENV_EXISTS)" ]; then $(MAKE) destroy; fi
if [ "$(VENV_EXISTS)" ]; then $(MAKE) clean; fi
@if [ "$(USING_PDM)" ]; then $(PDM) config venv.in_project true && python3 -m venv --copies .venv && . $(ENV_PREFIX)/activate && $(ENV_PREFIX)/pip install --quiet -U wheel setuptools cython pip; fi
@if [ "$(USING_PDM)" ]; then $(PDM) install; fi
@echo "=> Installing pre-commit hooks"
pre-commit install --install-hooks
@if [ "$(USING_PDM)" ]; then $(PDM) install -G:all; fi
@echo "=> Install complete! Note: If you want to re-install re-run 'make install'"

.PHONY: clean
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/stores.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ These come with the additional :meth:`with_namespace <.base.NamespacedStore.with
new :class:`NamespacedStore <.base.NamespacedStore>` instance. Once a namespaced store is created, operations on it
will only affect itself and its child namespaces.

When using the :class:`RedisStore <.redis.RedisStore>`, this allows to re-use the same underlying
When using the :class:`RedisStore <.redis.RedisStore>`, this allows to reuse the same underlying
:class:`Redis <redis.asyncio.Redis>` instance and connection, while ensuring isolation.

.. note::
Expand Down Expand Up @@ -237,7 +237,7 @@ This mechanism also allows to control the stores used by various integrations, s

In this example, the registry is being set up with stores using the ``sessions`` and ``response_cache`` keys. These are
not magic constants, but instead configuration values that can be changed. Those names just happen to be their default
values. Adjusting those default values allows to easily re-use stores, without the need for a more complex setup:
values. Adjusting those default values allows to easily reuse stores, without the need for a more complex setup:

.. literalinclude:: /examples/stores/configure_integrations_set_names.py
:language: python
Expand Down
Loading

0 comments on commit da2a0f2

Please sign in to comment.