Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zhPavel committed Jan 21, 2024
2 parents 41fae80 + 9f15132 commit 3422988
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
4 changes: 3 additions & 1 deletion docs/loading-and-dumping/extended-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ Precise type hint is ``Callable[[T], Mapping[str, Any]]``.

.. literalinclude:: /examples/loading-and-dumping/extended_usage/unknown_fields_processing/on_dumping_extractor.py

Output mapping keys have not collide with keys of dumped model. Otherwise the result is not guaranteed.
.. custom-non-guaranteed-behavior::

Output mapping keys have not collide with keys of dumped model. Otherwise the result is not guaranteed.

Mapping to list
-----------------------------------
Expand Down
18 changes: 17 additions & 1 deletion docs/reference/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ How to setup the repository
.. code-block:: bash
just lint
just test-all-p
just test-all
Tools overview
Expand All @@ -73,6 +73,22 @@ Sync all dependencies. Need to run if committed dependencies are changed.
just venv-sync
Compile dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compile raw dependencies (``requirements/raw/*``)
into file with locked versions via `pip-tools <https://github.com/jazzband/pip-tools>`_.

.. code-block:: bash
just deps-compile
By default, ``pip-tools`` try keep previous locked version. To upgrade locked dependencies use:

.. code-block:: bash
just deps-compile-upgrade
Linting
----------------
Expand Down
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ set windows-powershell := true
@cov:
inv cov

inv := "inv -r scripts -c invoke_tasks"

@deps-compile:
inv deps-compile
{{ inv }} deps-compile

@deps-compile-upgrade:
{{ inv }} deps-compile --upgrade

doc_source := "docs"
doc_target := "docs-build"
Expand Down
7 changes: 5 additions & 2 deletions tasks.py → scripts/invoke_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ def cov(c: Context):


@task
def deps_compile(c: Context):
def deps_compile(c: Context, upgrade=False):
extra = ''
if upgrade:
extra += ' --upgrade'
promises = [
c.run(
f'pip-compile {req} -o {Path("requirements") / req.name}'
' -q --allow-unsafe --strip-extras --upgrade',
' -q --allow-unsafe --strip-extras' + extra,
asynchronous=True,
)
for req in Path('.').glob('requirements/raw/*.txt')
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[vars]
# Do not forget to update paths at .pre-commit-config.yaml
lint_pylint = src/ scripts/ tasks.py examples/ benchmarks/benchmarks/pybench/ docs/custom_ext/
lint_bandit = src/ scripts/ tasks.py examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/
lint_mypy = src/ scripts/ tasks.py examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/
lint_all = src/ scripts/ tasks.py examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/ tests/
lint_pylint = src/ scripts/ examples/ benchmarks/benchmarks/pybench/ docs/custom_ext/
lint_bandit = src/ scripts/ examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/
lint_mypy = src/ scripts/ examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/
lint_all = src/ scripts/ examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/ tests/

[tox]
env_list = {py38, py39, py310, py311, py312, pypy38, pypy39, pypy310}-extra_{none, old, new},
Expand Down

0 comments on commit 3422988

Please sign in to comment.