Commit Graph

378 Commits

Author SHA1 Message Date
Hynek Schlawack 906b732e23
Re-add attr and attrs ..module
But add it where it belongs: API

Fixes #1073
2023-01-02 16:27:37 +01:00
Hynek Schlawack 98aa688501
Clarify make_class argument type (#1075) 2023-01-02 08:50:57 +01:00
Hynek Schlawack 3a1367befa
Fix docset icons 2022-12-21 11:50:14 +01:00
Hynek Schlawack 566248a2d8
Don't linkcheck tree links 2022-12-21 09:59:37 +01:00
Hynek Schlawack 4ad4ea073f
Use MyST-native include 2022-12-20 10:47:48 +01:00
Hynek Schlawack 519423d94a
Use MyST-native doctest blocks in all MD 2022-12-20 10:46:32 +01:00
Hynek Schlawack 403adaba51
Remove stray file 2022-12-20 10:21:21 +01:00
Hynek Schlawack 6957e4a356
Use new typographic branding in the last rst file, too 2022-12-20 10:17:48 +01:00
Hynek Schlawack 1bb2864824
Convert examples.rst to md 2022-12-20 10:14:46 +01:00
Hynek Schlawack c1c24ccafb
Convert glossary.rst to md 2022-12-20 09:45:37 +01:00
Hynek Schlawack 9fd0f82ff0
Convert extending.rst to md 2022-12-20 09:28:31 +01:00
Hynek Schlawack 3473b4d3e2
Convert comparison.rst to md 2022-12-20 09:12:37 +01:00
Hynek Schlawack a760574795
Convert init.rst to md 2022-12-20 08:22:51 +01:00
Hynek Schlawack 2aff38afc4
Convert types.rst to md 2022-12-20 07:49:00 +01:00
Hynek Schlawack a09a6e7010
Convert how-does-it-work.rst to md 2022-12-20 07:34:58 +01:00
Hynek Schlawack 7fa9cd03d5
Convert overview.rst to md 2022-12-20 07:21:08 +01:00
Hynek Schlawack dc1dc3b1e3
Convert names.rst to md 2022-12-20 07:06:32 +01:00
Hynek Schlawack 5c280b35c1
We can style links now! 2022-12-19 16:42:36 +01:00
Hynek Schlawack 08b200efac
Convert why chapter to markdown 2022-12-19 16:38:33 +01:00
Hynek Schlawack afe211143d
Switch changelog to markdown (#1067)
* Switch changelog to markdown

* Add changelog except back to long description

* Fix MANIFEST.in

* Re-add towncrier draft entries

* Write the title outselves

* Add warning box

* Make changelog format more KeepAChangelog-ish

* Link latest changes to main tree

* Move link into warning

* KAC has no empty lines between entries

* There's no more .rst in the root dir
2022-12-07 09:15:46 +01:00
Hynek Schlawack 0f6a9b4753
Add unsafe_hash alias for class-wide hash (#1065)
* Add unsafe_hash alias for class-wide hash

Fixes #1003

* Add news fragment

* Add type hints / type examples

* Complete attr.s's api string in api.rst

* Address feedback

* Clarify

* Shuffle around
2022-12-02 07:45:13 +01:00
Alex Ford ee3ecb112f
Add Attribute.alias (#950)
* Spike `alias` implementation.

* Move default alias init to after field_transformer.

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

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

* Fixup docs.

* Update docs/extending.rst

* Pre-commit fixes

* Partially fix doctest

* Add test docstrings.

* Add typing_example tests

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

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

* Tidy typing_example

* Add note in init.rst on private aliases

* Add alias example to examples.rst

* Assert to comment

* Add changelog entry

* Fixup doc error

* Tidy dataclass_transform docs

* Lil' spice for the changelog.

* Fix doctest

* Update extending.rst

* Make alias introspection more explicit

* Update src/attr/_make.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-11-30 14:39:57 +00:00
Hynek Schlawack 6c46bb19a0
Start building Dash/Zeal docsets for docs (#1056) 2022-11-25 08:30:34 +01:00
Hynek Schlawack 71bfef0abc
Move SVGs to .github & refer by raw URLs 2022-11-16 15:53:26 +01:00
Hynek Schlawack f36b6069fa
Update sponsors 2022-11-16 15:10:31 +01:00
Hynek Schlawack 95841fc93e
Start moving docs to MyST / Markdown (#1053)
* Start moving to MyST

* More MyST

* Start using proper typography
2022-11-16 13:58:25 +01:00
Hynek Schlawack ab5712b6c5
Use more commen term from keep a changelog 2022-09-12 15:23:20 +02:00
Nick Timkovich f870beb84a
Add a not_ validator (#1010) 2022-09-04 13:55:02 +02:00
Kevin M Granger c860e9dd25
Use enum for typing NOTHING (#983)
* Use enum for typing NOTHING.

This will allow those extending attrs
to type NOTHING as Literal[NOTHING].

* Make test_dunders test `NOTHING` directly

* Reflect NOTHING enum typing in __init__.pyi

* Fix docs for NOTHING

* Add changelog entry

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

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

Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-27 17:41:56 +02:00
Sviatoslav Sydorenko 9169c49966
Add a preview for the "next release" change notes (#1016)
* Add a preview for the "next release" change notes

This change integrates `sphinxcontrib-towncrier` into the docs build.
It uses Towncrier and its configs to render a draft changelog as RST
and injects that into the `changelog.rst` document right above the
older changelog entries using `towncrier-draft-entries` directive.

* Drop the change note from PR #1016

This partially reverts commit 0165dc355d2eb475cf59894d1561efb9b1963a39.

* Use `Not yet released` in the changelog draft

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-08-22 14:27:40 +00:00
Hynek Schlawack 80c61b79cf
Remove frogotten path fragment 2022-08-11 10:01:54 +02:00
Hynek Schlawack 714bf67a2f
Extend we-are-not-a-serialization-framework 2022-08-11 10:00:00 +02:00
Hynek Schlawack 6151683244
Eliminate most str.format() and %-formatting (#995)
* Eliminate most str.format() and %-formatting

* Add newsfragment
2022-08-10 12:41:46 +02:00
davfsa a8191556c0
Speedup `_setattr` usage and fix slight performance regressions (#991)
* Speedup `_setattr` usage and fix performance regressions

* Add changelog file

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-08-07 07:52:28 +00:00
Hynek Schlawack 08f8319efe
Drop Python 3.5 (#988)
* Drop Python 3.5

Less than 0.5% of our downloads are 3.5 and it allows us to simplify A LOT of code.

Fixes #965

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

* Run 3.6 under coverage

* Add newsfragment

* Probably don't need 3.7 for coverage

* Everything is ordered!

* pre-commit autoupdate, add yesqa
2022-08-05 09:48:00 +02:00
Hynek Schlawack 9f118b7dd5 Tune first steps 2022-07-28 11:00:37 +02:00
Hynek Schlawack 696fd78690 Hyphenate compound adjectives 2022-07-28 09:23:44 +02:00
Hynek Schlawack 65c06831c1 Use NG APIs in glossary 2022-07-28 08:47:28 +02:00
Hynek Schlawack 4f6b894487 Fix overview 2022-07-28 06:12:27 +02:00
Hynek Schlawack 0010bb55fe Make project information easiert to read/scan 2022-07-27 16:11:24 +02:00
Hynek Schlawack 36ed02046e Reorder docs, remove search link
Search link makes no sense with our theme.

Fixes #984
2022-07-16 18:30:12 +01:00
Marcelo Trylesinski 7091b1f89a
Update init.rst (#979) 2022-07-07 15:04:05 +02:00
Hynek Schlawack a7e82b5c41 Polish docs around #951 2022-06-13 08:33:23 +02:00
Dmitry Shmyrev 985e8ef767
Typo fix in examples (#966)
* fixed typo

* fixes according to comment

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-06-08 11:38:09 +00:00
Hynek Schlawack cbe9c9775e Clarify validator arguments are passed as pos args
Fixes #958
2022-05-10 07:25:58 +02:00
Matthieu Melot f008d86a8e
Typo fix (#957)
Should read top-level, not to-level.
2022-05-06 18:09:28 +00:00
Hynek Schlawack 738ee63903
Add missing cmp_using to stub files (#949)
* Add missing cmp_using to stub files

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

* Add newsfragment
2022-04-07 07:29:24 +02:00
Micael Jarniac 2afbcb2f94
Remove mutable default arg in function example (#944)
* Remove mutable default arg in function example

Removed mutable default arg, replaced with `None`.
https://docs.quantifiedcode.com/python-anti-patterns/correctness/mutable_default_value_as_argument.html

Replaced `dict()` with `{}`.
https://stackoverflow.com/questions/8424942/creating-a-new-dictionary-in-python

* Wrong import

* Undo last commit

My bad.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-04-07 04:38:46 +00:00
piglei ae29da66b7
Update docs/examples.rst: add missing import statement for @frozen (#943)
* Update docs/examples.rst: add missing import statement for @frozen

* Update docs/examples.rst: change attr to attrs for frozen import statement

* Fix an indention error in init.rst
2022-03-29 12:44:09 +02:00
wouter bolsterlee d785c656e5
Clean up some more Python 2-isms (#942)
- Reword and simplify a few docstrings.
- Add back a test for 2-arg super() in property() definitions that
  was (accidentally?) dropped in #936.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-03-21 15:45:05 +01:00