Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/conda_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:
push:
branches: ["master"]

permissions:
contents: read

jobs:
tests:
name: "Conda"
permissions:
contents: read
runs-on: ubuntu-22.04
defaults:
run:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docs_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
docs:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
name: "Flake8"
permissions:
contents: read
runs-on: "ubuntu-22.04"

steps:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
permissions:
contents: read
name: "mypy / ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/octocheese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ on:
schedule:
- cron: 0 12 * * *

permissions:
contents: write

jobs:
Run:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: domdfcoding/octocheese@master
with:
pypi_name: "default_values"
pypi_name: "default-values"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: startsWith(github.ref, 'refs/tags/') != true
8 changes: 3 additions & 5 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "windows-2022 / Python ${{ matrix.config.python-version }}"
runs-on: "windows-2022"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ on:
- '*'
pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}"
runs-on: "ubuntu-22.04"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down Expand Up @@ -85,6 +83,9 @@ jobs:

Coverage:
needs: tests
permissions:
actions: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -134,7 +135,10 @@ jobs:

Deploy:
needs: tests

permissions:
actions: write
issues: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -179,6 +183,8 @@ jobs:

Conda:
needs: deploy
permissions:
contents: read
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true)
steps:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}"
runs-on: "macos-${{ matrix.config.os-ver }}"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ repos:
- id: check-added-large-files
- id: check-ast
- id: fix-byte-order-marker
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
Expand All @@ -33,7 +32,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/domdfcoding/pre-commit-hooks
rev: v0.4.0
rev: v0.5.0
hooks:
- id: requirements-txt-sorter
args:
Expand Down Expand Up @@ -81,13 +80,15 @@ repos:
- id: snippet-fmt

- repo: https://github.com/python-formate/formate
rev: v0.8.0
rev: v1.1.2
hooks:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
additional_dependencies:
- formate-trailing-commas>=0.1.1

- repo: https://github.com/python-coincidence/dep_checker
rev: v0.8.0
rev: v0.9.0
hooks:
- id: dep_checker
args:
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ split_before_dict_set_generator=True
#
# foo = ('This is a really long string: {}, {}, {}, {}'
# .format(a, b, c, d))
split_before_dot=False
split_before_dot=True

# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
Expand Down
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ For more information see `the documentation <https://default-values.readthedocs.
:target: https://www.codefactor.io/repository/github/sphinx-toolbox/default_values
:alt: CodeFactor Grade

.. |pypi-version| image:: https://img.shields.io/pypi/v/default_values
:target: https://pypi.org/project/default_values/
.. |pypi-version| image:: https://img.shields.io/pypi/v/default-values
:target: https://pypi.org/project/default-values/
:alt: PyPI - Package Version

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/default_values?logo=python&logoColor=white
:target: https://pypi.org/project/default_values/
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/default-values?logo=python&logoColor=white
:target: https://pypi.org/project/default-values/
:alt: PyPI - Supported Python Versions

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/default_values
:target: https://pypi.org/project/default_values/
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/default-values
:target: https://pypi.org/project/default-values/
:alt: PyPI - Supported Implementations

.. |wheel| image:: https://img.shields.io/pypi/wheel/default_values
:target: https://pypi.org/project/default_values/
.. |wheel| image:: https://img.shields.io/pypi/wheel/default-values
:target: https://pypi.org/project/default-values/
:alt: PyPI - Wheel

.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/default_values?logo=anaconda
Expand All @@ -125,11 +125,11 @@ For more information see `the documentation <https://default-values.readthedocs.
:target: https://github.com/sphinx-toolbox/default_values/commit/master
:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2025
.. |maintained| image:: https://img.shields.io/maintenance/yes/2026
:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/default_values
:target: https://pypi.org/project/default_values/
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/default-values
:target: https://pypistats.org/packages/default-values
:alt: PyPI - Downloads

.. end shields
Expand All @@ -147,7 +147,7 @@ To install with ``pip``:

.. code-block:: bash

$ python -m pip install default_values
$ python -m pip install default-values

To install with ``conda``:

Expand Down
12 changes: 6 additions & 6 deletions doc-source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ default_values
:alt: CodeFactor Grade

.. |pypi-version| pypi-shield::
:project: default_values
:project: default-values
:version:
:alt: PyPI - Package Version

.. |supported-versions| pypi-shield::
:project: default_values
:project: default-values
:py-versions:
:alt: PyPI - Supported Python Versions

.. |supported-implementations| pypi-shield::
:project: default_values
:project: default-values
:implementations:
:alt: PyPI - Supported Implementations

.. |wheel| pypi-shield::
:project: default_values
:project: default-values
:wheel:
:alt: PyPI - Wheel

Expand Down Expand Up @@ -114,11 +114,11 @@ default_values
:last-commit:
:alt: GitHub last commit

.. |maintained| maintained-shield:: 2025
.. |maintained| maintained-shield:: 2026
:alt: Maintenance

.. |pypi-downloads| pypi-shield::
:project: default_values
:project: default-values
:downloads: month
:alt: PyPI - Downloads

Expand Down
2 changes: 1 addition & 1 deletion doc-source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ License
.. license-info:: MIT

.. license::
:py: default_values
:py: default-values
27 changes: 7 additions & 20 deletions formate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70
squish_stubs = 80
newline_after_equals = 90

[hooks.yapf]
priority = 30

[hooks.yapf.kwargs]
yapf_style = ".style.yapf"

[hooks.trailing_commas]
priority = 21

[hooks.trailing_commas.kwargs]
format_ImportFrom = false

[hooks.isort]
priority = 50

Expand All @@ -27,26 +34,6 @@ lines_between_types = 0
use_parentheses = true
remove_redundant_aliases = true
default_section = "THIRDPARTY"
known_third_party = [
"attrs",
"coincidence",
"coverage",
"coverage_pyver_pragma",
"docutils",
"docutils_stubs",
"domdf_python_tools",
"github",
"importlib_metadata",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_rerunfailures",
"pytest_timeout",
"requests",
"sphinx",
"sphinx_jinja2_compat",
"sphinx_toolbox",
]
known_first_party = [ "sphinxcontrib_default_values",]
line_length = 115

Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ incomplete-defs:
tox -e lint -- --select MAN

commas:
tox -e lint -- --select C812,C813,C814,C815,C816
tox -e lint -- --select C810,C812,C813,C814,C815,C816

vdiff:
git diff $(repo-helper show version -q)..HEAD
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "whey",]
build-backend = "whey"

[project]
name = "default_values"
name = "default-values"
version = "0.7.0"
description = "Sphinx extension to show default values in documentation."
readme = "README.rst"
Expand Down
3 changes: 2 additions & 1 deletion sphinxcontrib/default_values/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def process_docstring(

lines.insert(
insert_index + 1 + idx,
f"{a_tab}{default_description_format % formatted_annotation}".rstrip('.') + '.'
f"{a_tab}{default_description_format % formatted_annotation}".rstrip('.')
+ '.',
)
break

Expand Down
2 changes: 1 addition & 1 deletion tests/test_format_default_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(inspect.Signature.empty, None),
(re.compile(".*"), "``re.compile('.*')``"),
(re.compile(".*", flags=re.ASCII), "``re.compile('.*', re.ASCII)``"),
]
],
)
def test_format_default_value(value, expects):
assert format_default_value(value) == expects
2 changes: 1 addition & 1 deletion tests/test_process_default_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, format_):
("The default value is\t", "The default value is\t%s"),
("The default value is ", "The default value is %s"),
("%s is the default value", "%s is the default value"),
]
],
)
def test_process_default_format(value, expects):
app = MockApp(value)
Expand Down
Loading
Loading