Commit Graph

990 Commits

Author SHA1 Message Date
Hynek Schlawack 850df71ad2 Shorten enumeration 2021-12-27 08:25:05 +01:00
Hynek Schlawack f41c6603b3 Cut paragraph
I hope we don't need to argue against tuples in 2021 anymore.
2021-12-27 08:07:43 +01:00
Hynek Schlawack 04e7efa037 We don't create ordering by default anymore 2021-12-27 08:06:55 +01:00
Hynek Schlawack e7345584ff
Add attrs namespace (#887) 2021-12-25 15:15:10 +01:00
Hynek Schlawack a23fe5f8c8 Better sentence flow 2021-12-25 14:46:17 +01:00
Hynek Schlawack e4e783b18f Use fully-qualified name 2021-12-25 14:44:14 +01:00
Hynek Schlawack f329fb6105 This ain't Markdown 2021-12-24 14:34:17 +01:00
Hynek Schlawack d9ed03a751 Stress optionality 2021-12-24 14:33:02 +01:00
Hynek Schlawack e8f552c6f0 invert 2021-12-24 12:40:19 +01:00
Hynek Schlawack cb6627d5f8
Update comparisons to dataclasses (#872)
* Start on why

* Mention graduality

* Better commas

* Add pydantic

* Paragraphs

* Re-order why topics

* typos

* Address comments from @Julian

Co-authored-by: Julian Berman <Julian@GrayVines.com>

* link features we talk about

* Split cumbersome sentence

* give example

Co-authored-by: Julian Berman <Julian@GrayVines.com>
2021-12-24 07:38:35 +01:00
Hynek Schlawack d6f5ae957a
HTML-comment-out boilerplate 2021-12-16 09:25:22 +01:00
Hynek Schlawack 7b02220bd3
Serialize keys as tuples in asdict (#888)
* Add tuple_keys to asdict

See #646

* Add typing example

* Add newsfragments

* Add missing test

* Switch it on by default

* Let's not make buggy behavior configurable
2021-12-16 09:01:51 +01:00
Hynek Schlawack 1706793012
Mention coverage 2021-12-16 08:28:19 +01:00
Hynek Schlawack de0f0138ae
Composite adjective 2021-12-16 08:23:50 +01:00
Hynek Schlawack 430b12ef0c Clarify version scheme 2021-12-16 08:18:26 +01:00
Hynek Schlawack 02d61102ab
Looks like pepy.tech isn't backfilling 2021-12-16 08:14:31 +01:00
Hynek Schlawack a955efeb41 Explicitly call out DCs in README 2021-12-16 07:08:12 +01:00
Tin Tvrtković bd0d0cc9fe
Modernize docs some more (#885)
* Modernize docs some more

* Fix doctest

* Tweak docs

* Update docs/examples.rst

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-12-15 13:57:16 +01:00
Hynek Schlawack 3833e4f496
Update CHANGELOG.rst 2021-12-15 08:08:31 +01:00
Hynek Schlawack e79b0a72ef Move 3.6-syntaxed test to test_next_gen.py 2021-12-15 07:11:04 +01:00
Hynek Schlawack 9ef5ff7740 Add test to double check mro-collection by default in NG 2021-12-14 17:29:59 +01:00
Hynek Schlawack 679e4b443d
NG: convert on setattr by default (#886)
* NG: convert on setattr by default

Not doing that from the get-go was an oversight.

Fixes #835

* Add optimization for default on_setattr w/ no work to do

Otherwise we'd end up with an explicit setattr every time.

* Fix optimization for NG default & j/ convert

* NG is actually 3.6+

* Add test for convert optimization for good measure
2021-12-14 15:50:37 +01:00
Hynek Schlawack 8ae0bd904d
Add _CompareWithType (#884)
It got accidentally removed in 6f5c5ce42f
2021-12-12 10:25:50 +01:00
Hynek Schlawack dfa725bdfc Link to pyright's list of incompatibilities 2021-12-08 07:10:11 +01:00
pre-commit-ci[bot] 868c67e225
[pre-commit.ci] pre-commit autoupdate (#882)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-06 20:43:27 +01:00
Hynek Schlawack 7c9f5a8dd2
Update main.yml 2021-12-05 06:15:08 +01:00
Hynek Schlawack 659b59c64f Link David's blog post 2021-12-04 08:31:34 +01:00
wouter bolsterlee 1759260aa0
Add support for re.Pattern to validators.matches_re() (#877)
Fixes #875.

This adds support for pre-compiled regular expressions to
attr.validators.matches_re(). This cannot be combined with flags since
the pre-compiled pattern already has those.

Detailed changes:

- attr.validators.matches_re() now accepts re.Pattern in addition to
  strings; update type annotations accordingly.
- Convert percent-formatting into str.format() for an error message
- Simplify (private) _MatchesReValidator helper class a bit: use the
  actual compiled pattern, and drop the unused .flags attribute.
- Simplify control flow a bit; add pointer about fullmatch emulation.
- Add tests
- Tweak existing test to ensure that .fullmatch() actually works
  correctly by matching a pattern that also matches (but not
  ‘full-matches’) a shorter substring.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-11-30 06:32:24 +01:00
wouter bolsterlee fe19f4b341
Avoid whitelist/blacklist terminology (#878)
The code already uses include() and exclude(), so simply tweak the docstrings.
2021-11-29 20:35:59 +01:00
Hynek Schlawack 34c55613d2
Document the common question of derived attributes (#874) 2021-11-29 09:23:45 +01:00
Hynek Schlawack d56471ea94 Re-add warning 2021-11-29 09:16:10 +01:00
Hynek Schlawack ff39e86f2f Use new RTD build config 2021-11-29 09:13:09 +01:00
Hynek Schlawack 4bc7cf70a9 YAML... 2021-11-29 09:09:25 +01:00
Hynek Schlawack 45c263755f Move docs to 3.10 2021-11-29 09:04:06 +01:00
Hynek Schlawack 38b299d4a4 Use importlib.metadata to find the version in Sphinx docs 2021-11-28 15:04:39 +01:00
Hynek Schlawack ebe158cf8a Add more sensical example 2021-11-26 07:19:16 +01:00
Hynek Schlawack ff65c6e645 Link to more concrete blog post 2021-11-26 07:16:31 +01:00
Hynek Schlawack 0b95a0c76c
Fold backward-compatibility into changelog
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-11-25 17:06:12 +01:00
Hynek Schlawack b403b91f48 Forgotten rst 2021-11-25 10:00:10 +01:00
Gábor Lipták 9bacb3c74a
Extract PYTHON_LATEST in GHA (#873)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-11-25 08:52:49 +00:00
Hynek Schlawack c89d1f9d41 Fix contributing link 2021-11-25 09:46:44 +01:00
Hynek Schlawack e82e340422 Smarten some endashes
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-11-25 09:40:13 +01:00
Hynek Schlawack d6771729c5
Update CONTRIBUTING.md 2021-11-25 09:38:19 +01:00
Hynek Schlawack 16cf4c50a0
GitHub really wants us to use Markdown
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-11-25 09:31:17 +01:00
Hynek Schlawack ae4bd837ec
Add a summary heading to avoid checklist-only PRs 2021-11-25 06:11:50 +01:00
Hynek Schlawack 22970bdeca Fix Python 2 2021-11-24 12:10:13 +01:00
Hynek Schlawack c9d0b1522d
Test metadata_proxy properties independently from hypothesis strategies
Occasionally they fail to cover all bases and break our coverage job on Python 2.7.

Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-11-24 12:06:11 +01:00
Hynek Schlawack 6954086207
Switch to markdown version of CoC so GitHub finds it
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-11-24 09:57:32 +01:00
Hynek Schlawack 29447f81af
Document the various core names and why they exist (#871)
* Document the various core names and why they exist

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Remove stray backtick

* Add example of new API

* Link PEP 526

* future is now

* phrase and typos

* typo/grammar

* typo

* Better phrasing

* Add missing and

* less words = better

* polish

* phrasing

* looks weird but is correct

* comma spliiiiceeeee

* example

* make it sound less dry

* fix

* phrasing
2021-11-24 09:39:41 +01:00
Hynek Schlawack 6e04e869e6 Fix links 2021-11-23 13:56:38 +01:00