Skip to content

Commit

Permalink
Various updates and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
posita committed Dec 19, 2022
1 parent 65e0e97 commit 9ab251e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: test ${{ matrix.python-version }} with Tox
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
python -m pip install 'tox-gh-actions~=2.12.0'
git submodule update --init --recursive
tox --verbose
Expand Down
2 changes: 1 addition & 1 deletion docs/whytho.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ That seems as good a place as any to tackle next.
>>> try:
... from typing import Protocol, runtime_checkable
... except ImportError:
... from typing_extensions import Protocol, runtime_checkable # type: ignore [misc]
... from typing_extensions import Protocol, runtime_checkable # type: ignore [assignment]

>>> from abc import abstractmethod
>>> from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion helpers/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following assumes you are working from the repository root and have a develo

* [ ] ``"$( git rev-parse --show-toplevel )/helpers/propagate-version.sh" "$( python -m versioningit --next-version . )"``

* [ ] ``git add -u && git commit --edit --message "$( printf 'Release v%s\n\n<TODO: Copy [release notes](docs/notes.md) here. Hope you were keeping track!>' "$( python -m versioningit --next-version . )" )"``
* [ ] ``git add --update && git commit --edit --message "$( printf 'Release v%s\n\n<TODO: Copy [release notes](docs/notes.md) here. Hope you were keeping track!>' "$( python -m versioningit --next-version . )" )"``

* [ ] ``git tag [--force] --message "$( git rev-list --format=%B --max-count=1 HEAD )" --sign "v$( python -m versioningit --next-version . )"``

Expand Down
7 changes: 4 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ plugins:
default_handler: python
handlers:
python:
rendering:
options:
show_if_no_docstring: true
show_root_full_path: false
show_signature_annotations: true
watch:
- numerary
- search

theme:
Expand All @@ -81,3 +79,6 @@ theme:
- scheme: default
primary: deep-orange
accent: deep-orange

watch:
- numerary
4 changes: 2 additions & 2 deletions numerary/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ def real(operand: SupportsRealImagMixedU):

return real_part
elif hasattr(operand, "real"):
return operand.real # type: ignore [union-attr]
return operand.real
else:
raise TypeError(f"{operand!r} has no real or as_real_imag")

Expand Down Expand Up @@ -1461,7 +1461,7 @@ def imag(operand: SupportsRealImagMixedU):

return imag_part
elif hasattr(operand, "imag"):
return operand.imag # type: ignore [union-attr]
return operand.imag
else:
raise TypeError(f"{operand!r} has no real or as_real_imag")

Expand Down
17 changes: 11 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dev =
pre-commit
numpy~=1.23.2 # for testing
sympy~=1.10.1 # for testing
tox
tox~=3.28
versioningit~=2.0

[options.package_data] # --------------------------------------------------------------
Expand All @@ -75,6 +75,7 @@ python =
3.11: py311{,-lint}{,-beartype}
pypy-3.8: pypy38{,-beartype}
pypy-3.9: pypy39{,-beartype}
fail_on_no_env = True

[testenv] # ---------------------------------------------------------------------------

Expand All @@ -93,13 +94,15 @@ deps =
# Alternatively, add entries directly to .git/info/exclude. See also mkdocs-exclude
# below.
pytest-gitignore
sympy>=1.9
sympy~=1.9
!debug: pytest-cov
!debug: pytest-xdist
!pypy38-!pypy39: numpy
passenv =
PYTHONBREAKPOINT
setenv =
# See <https://github.com/tox-dev/tox/issues/2756>
COLUMNS =
beartype: NUMERARY_BEARTYPE = yes
!beartype: NUMERARY_BEARTYPE = no
PYTHONWARNINGS = {env:PYTHONWARNINGS:ignore}
Expand All @@ -112,7 +115,7 @@ deps =
--editable .
ipython
sympy
whitelist_externals =
allowlist_externals =
make

[testenv:check] # ---------------------------------------------------------------------
Expand All @@ -132,11 +135,11 @@ deps =
mkdocs-exclude
mkdocs-macros-plugin
mkdocs-material
mkdocstrings[python]>=0.18
mkdocstrings[python]~=0.18
sympy
twine
versioningit~=2.0
whitelist_externals =
allowlist_externals =
rm

[testenv:py{39,310,311}-lint{,-beartype}] # -------------------------------------------
Expand All @@ -147,10 +150,12 @@ commands =
{toxinidir}/helpers/mypy-doctests.py -a=--config-file={toxinidir}/pyproject.toml .
deps =
--editable .
mypy>=0.971
mypy~=0.991
pre-commit
sympy
!pypy38-!pypy39: numpy
allowlist_externals =
{toxinidir}/helpers/mypy-doctests.py

[flake8] # ----------------------------------------------------------------------------

Expand Down

0 comments on commit 9ab251e

Please sign in to comment.