* Add disclaimer to attr NS
* Transplant API docs from attr.s to attrs.define
* Transplant API docs from attr.ib to attrs.field
* Remove stale references to attr.ib
* Fix refs
* Link to glossary
* Explain why
* Links from API docs, too
* Link type annotations for good measure
I get regularly spurious failures in tox in the Mypy tests because of
being able to access certain files. I hope running the file
non-concurently helps here.
* converters: allow wrapping & takes_self
* Add takes field
* Add news fragment
* Refactor name and call creation
* Make argument names more idiomatic
* Add missing hints
* Make 3-arg converters zero-overhead at runtime
* Remove unnecessary changes
* More idiomatic name
* Explain method
* Make pickle test more meaningful
* Add unit tests for fmt_converter_call
* Check our eq works too
* Convert Converter docstring to Napoleon
* Fix rebase fubar
* Add ~types~
* Comment out failing mypy tests for now
* Fix mypy tests
* Add warning
* Add narrative docs
* Fix converter overloads, add tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Only run CodSpeed whenever code changes
It's very slow and very computationally expensive.
No point running it on docs typo changes.
* Limit on PRs too
* Speed up __eq__
* Changelog, disallow nans in tests
* Fix `eq_key` comparisons
* Rework changlelog
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Make docs more precise
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Switch to build-and-inspect-python-package
Use the occasion to factor out PyPy jobs which simplifies everthing.
* Only install pytest-codspeed when benchmarking
* No need to build twice on PRs
* No coverage on PyPy
* Still require PyPy to pass
* Actually remove codspeed from tests
* Separate glacial CodSpeed into own workflow
Might switch to on-demand/cron if we don't find a way for it to run
under 5 minutes.
* Get rid of version override
* Add missing needs
* Test should pass without src
* oops
* Make PyPy wheel-only, too
* Clarify
* Explain how the matrix works since everybody steals my stuff
* Implement attrs.validators.or_ validator
* Add tests/test_validators.py::TestOr test cases
* Add test for _OrValidator.__repr__ method
* Add description of attrs.validators.or_ to docs/api.rst
* Add changelog entry
* Swap double quotes for single because doctests don't like it
* Rename changelog fragment pointing to incorrect number
* Silence ruff linter warnings
Although good warning in general, in this particular code, they
do not fit here.
* BLE001 Do not catch blind exception: `Exception`
`validators` usually raise `ValueError` upon their violation.
However, it's not the only `Exception` they can raise - cf.
`attrs.validators.not_` - therefore, it is desirable to catch
them all!
* PERF203 `try`-`except` within a loop incurs performance overhead
Fair point, but the loop is written in a way to short-circuit,
ie. it will finish when a first validator is satisfied.
* S112 `try`-`except`-`continue` detected, consider logging the exception
Not applicable here, we care only if **all** validators raise
an exception, which is already accomodated for after the `for`
loop.
* Apply suggestions from code review
Co-authored-by: Hynek Schlawack <hs@ox.cx>
* Rework example of or_ validator in api/docs.rst
* Update docs/api.rst
---------
Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: Libor <libas.martinek@protonmail.com>