Skip to content

Commit 0b472c1

Browse files
committed
Merge branch 'main' into evolve-inherited-fields
2 parents 86d7e7e + 48b8611 commit 0b472c1

68 files changed

Lines changed: 4255 additions & 1700 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/AI_POLICY.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Generative AI / LLM Policy
2+
3+
We appreciate that we can't realistically police how you author your pull requests, which includes whether you employ large-language model (LLM)-based development tools.
4+
So, we don't.
5+
6+
However, due to both legal and human reasons, we have to establish boundaries.
7+
8+
> [!CAUTION]
9+
> **TL;DR:**
10+
> - We take the responsibility for this project very seriously and we expect you to take your responsibility for your contributions seriously, too.
11+
> This used to be a given, but it changed now that a pull request is just one prompt away.
12+
>
13+
> - Every contribution has to be backed by a human who unequivocally owns the copyright for all changes.
14+
> No LLM bots in `Co-authored-by:`s.
15+
>
16+
> - DoS-by-slop leads to a permanent ban.
17+
>
18+
> - Absolutely **no** unsupervised agentic tools like OpenClaw.
19+
>
20+
> ---
21+
>
22+
> By submitting a pull request, you certify that:
23+
>
24+
> - You are the author of the contribution or have the legal right to submit it.
25+
> - You either hold the copyright to the changes or have explicit legal authorization to contribute them under this project's license.
26+
> - You understand the code.
27+
> - You accept full responsibility for it.
28+
29+
30+
## Legal
31+
32+
There is ongoing legal uncertainty regarding the copyright status of LLM-generated works and their provenance.
33+
Since we do not have a formal [Contributor License Agreement](https://en.wikipedia.org/wiki/Contributor_license_agreement) (CLA), you retain your copyright to your changes to this project.
34+
35+
Therefore, allowing contributions by LLMs has unpredictable consequences for the copyright status of this project – even when leaving aside possible copyright violations due to plagiarism.
36+
37+
38+
## Human
39+
40+
As the makers of software that is used by millions of people worldwide and with a reputation for high-quality maintenance, we take our responsibility to our users very seriously.
41+
No matter what LLM vendors or boosters on LinkedIn tell you, we have to manually review every change before merging, because it's **our responsibility** to keep the project stable.
42+
43+
Please understand that by opening low-quality pull requests you're not helping anyone.
44+
Worse, you're [poisoning the open source ecosystem](https://lwn.net/Articles/1058266/) that was precarious even before the arrival of LLM tools.
45+
Having to wade through plausible-looking-but-low-quality pull requests and trying to determine which ones are legit is extremely demoralizing and has already burned out many good maintainers.
46+
47+
Put bluntly, we have no time or interest to become part of your vibe coding loop where you drop LLM slop at our door, we spend time and energy to review it, and you just feed it back into the LLM for another iteration.
48+
49+
This dynamic is especially pernicious because it poisons the well for mentoring new contributors which we are committed to.
50+
51+
52+
## Summary
53+
54+
In practice, this means:
55+
56+
- Pull requests that have an LLM product listed as co-author can't be merged and will be closed without further discussion.
57+
We cannot risk the copyright status of this project.
58+
59+
If you used LLM tools during development, you may still submit – but you must remove any LLM co-author tags and take full ownership of every line.
60+
61+
- By submitting a pull request, **you** take full **technical and legal** responsibility for the contents of the pull request and promise that **you** hold the copyright for the changes submitted.
62+
63+
"An LLM wrote it" is **not** an acceptable response to questions or critique.
64+
**If you cannot explain and defend the changes you submit, do not submit them** and open a high-quality bug report/feature request instead.
65+
66+
- Accounts that exercise bot-like behavior – like automated mass pull requests – will be permanently banned, whether they belong to a human or not.
67+
68+
- Do **not** post LLM-generated review comments -- we can prompt LLMs ourselves should we desire their wisdom.
69+
Do **not** post summaries unless you've fact-checked them and take responsibility for 100% of their content.
70+
Remember that *all* LLM output *looks* **plausible**.
71+
When using these tools, it's **your** responsibility to ensure that it's also **correct** and has a reasonable signal-to-noise ratio.

.github/CODE_OF_CONDUCT.md

Lines changed: 7 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,16 @@
1+
# Code of Conduct
12

2-
# Contributor Covenant Code of Conduct
3+
While not being a [Python Software Foundation](https://www.python.org/psf-landing/) project, everyone interacting in this project is expected to follow the [PSF Code of Conduct](https://policies.python.org/python.org/code-of-conduct/).
34

4-
## Our Pledge
5+
In general, this means that everyone is expected to be **open**, **considerate**, and **respectful** of others no matter what their position is within the project.
56

6-
We as members, contributors, and leaders pledge to make participation in our
7-
community a harassment-free experience for everyone, regardless of age, body
8-
size, visible or invisible disability, ethnicity, sex characteristics, gender
9-
identity and expression, level of experience, education, socioeconomic status,
10-
nationality, personal appearance, race, caste, color, religion, or sexual
11-
identity and orientation.
12-
13-
We pledge to act and interact in ways that contribute to an open, welcoming,
14-
diverse, inclusive, and healthy community.
15-
16-
## Our Standards
17-
18-
Examples of behavior that contributes to a positive environment for our
19-
community include:
20-
21-
* Demonstrating empathy and kindness toward other people
22-
* Being respectful of differing opinions, viewpoints, and experiences
23-
* Giving and gracefully accepting constructive feedback
24-
* Accepting responsibility and apologizing to those affected by our mistakes,
25-
and learning from the experience
26-
* Focusing on what is best not just for us as individuals, but for the overall
27-
community
28-
29-
Examples of unacceptable behavior include:
30-
31-
* The use of sexualized language or imagery, and sexual attention or advances of
32-
any kind
33-
* Trolling, insulting or derogatory comments, and personal or political attacks
34-
* Public or private harassment
35-
* Publishing others' private information, such as a physical or email address,
36-
without their explicit permission
37-
* Other conduct which could reasonably be considered inappropriate in a
38-
professional setting
39-
40-
## Enforcement Responsibilities
41-
42-
Community leaders are responsible for clarifying and enforcing our standards of
43-
acceptable behavior and will take appropriate and fair corrective action in
44-
response to any behavior that they deem inappropriate, threatening, offensive,
45-
or harmful.
46-
47-
Community leaders have the right and responsibility to remove, edit, or reject
48-
comments, commits, code, wiki edits, issues, and other contributions that are
49-
not aligned to this Code of Conduct, and will communicate reasons for moderation
50-
decisions when appropriate.
51-
52-
## Scope
53-
54-
This Code of Conduct applies within all community spaces, and also applies when
55-
an individual is officially representing the community in public spaces.
56-
Examples of representing our community include using an official e-mail address,
57-
posting via an official social media account, or acting as an appointed
58-
representative at an online or offline event.
597

608
## Enforcement
619

62-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63-
reported to the community leaders responsible for enforcement at
64-
<mailto:hs@ox.cx>.
65-
All complaints will be reviewed and investigated promptly and fairly.
66-
67-
All community leaders are obligated to respect the privacy and security of the
68-
reporter of any incident.
69-
70-
## Enforcement Guidelines
71-
72-
Community leaders will follow these Community Impact Guidelines in determining
73-
the consequences for any action they deem in violation of this Code of Conduct:
74-
75-
### 1. Correction
76-
77-
**Community Impact**: Use of inappropriate language or other behavior deemed
78-
unprofessional or unwelcome in the community.
79-
80-
**Consequence**: A private, written warning from community leaders, providing
81-
clarity around the nature of the violation and an explanation of why the
82-
behavior was inappropriate. A public apology may be requested.
83-
84-
### 2. Warning
85-
86-
**Community Impact**: A violation through a single incident or series of
87-
actions.
88-
89-
**Consequence**: A warning with consequences for continued behavior. No
90-
interaction with the people involved, including unsolicited interaction with
91-
those enforcing the Code of Conduct, for a specified period of time. This
92-
includes avoiding interactions in community spaces as well as external channels
93-
like social media. Violating these terms may lead to a temporary or permanent
94-
ban.
95-
96-
### 3. Temporary Ban
97-
98-
**Community Impact**: A serious violation of community standards, including
99-
sustained inappropriate behavior.
100-
101-
**Consequence**: A temporary ban from any sort of interaction or public
102-
communication with the community for a specified period of time. No public or
103-
private interaction with the people involved, including unsolicited interaction
104-
with those enforcing the Code of Conduct, is allowed during this period.
105-
Violating these terms may lead to a permanent ban.
106-
107-
### 4. Permanent Ban
108-
109-
**Community Impact**: Demonstrating a pattern of violation of community
110-
standards, including sustained inappropriate behavior, harassment of an
111-
individual, or aggression toward or disparagement of classes of individuals.
112-
113-
**Consequence**: A permanent ban from any sort of public interaction within the
114-
community.
115-
116-
## Attribution
117-
118-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119-
version 2.1, available at
120-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
10+
We take Code of Conduct violations seriously, and will act to ensure our spaces are welcoming, inclusive, and professional environments to communicate in.
12111

122-
Community Impact Guidelines were inspired by
123-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
12+
If you need to raise a Code of Conduct report, you may do so privately by email to [Hynek Schlawack](mailto:hs@ox.cx).
12413

125-
For answers to common questions about this code of conduct, see the FAQ at
126-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127-
[https://www.contributor-covenant.org/translations][translations].
14+
Reports will be treated confidentially.
12815

129-
[homepage]: https://www.contributor-covenant.org
130-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131-
[Mozilla CoC]: https://github.com/mozilla/diversity
132-
[FAQ]: https://www.contributor-covenant.org/faq
133-
[translations]: https://www.contributor-covenant.org/translations
16+
Alternately you can make a [report to the Python Software Foundation](https://policies.python.org/python.org/code-of-conduct/Procedures-for-Reporting-Incidents/).

.github/CONTRIBUTING.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# How To Contribute
22

33
> [!IMPORTANT]
4-
> This document is mainly to help you to get started by codifying tribal knowledge and expectations and make it more accessible to everyone.
5-
> But don't be afraid to open half-finished PRs and ask questions if something is unclear!
4+
> - This document is mainly to help you to get started by codifying tribal knowledge and expectations and make it more accessible to everyone.
5+
> But don't be afraid to open half-finished PRs and ask questions if something is unclear!
6+
>
7+
> - If you use LLM / "AI" tools for your contributions, please read and follow our [_Generative AI / LLM Policy_][llm].
68
79

810
## Support
@@ -18,8 +20,19 @@ The official tag is `python-attrs` and helping out in support frees us up to imp
1820
First off, thank you for considering to contribute!
1921
It's people like *you* who make this project such a great tool for everyone.
2022

23+
- **Only contribute code that you fully understand.**
24+
See also our [AI policy][llm].
25+
26+
- Very relatedly, our pull request check list is our mandatory [Van Halen test](https://en.wikipedia.org/wiki/Van_Halen_test).
27+
Sadly, the current state of the world has forced us into being stricter about policies -- sorry fellow humans!
28+
2129
- No contribution is too small!
2230
Please submit as many fixes for typos and grammar bloopers as you can!
31+
They're your license to delete the checklist!
32+
33+
- Before starting big contributions, **talk to us first**.
34+
Don't waste energy / tokens on something that we do not want.
35+
Rejecting a huge PR is unpleasant for everybody.
2336

2437
- Try to limit each pull request to *one* change only.
2538

@@ -47,30 +60,48 @@ It's people like *you* who make this project such a great tool for everyone.
4760

4861
## Local Development Environment
4962

50-
First, **fork** the repository on GitHub and **clone** it using one of the alternatives that you can copy-paste by pressing the big green button labeled `<> Code`.
63+
First, **fork** the repository on GitHub.
64+
Make sure to **uncheck** the `Copy the main branch only` radio button on the `Create a new fork` page.
65+
If you don't, our test suite will fail because we use Git tags for packaging.
66+
67+
Finally, **clone** your fork using one of the alternatives that you can copy-paste by pressing the big green button labeled `<> Code`.
68+
69+
You can (and should) run our test suite using [*tox*](https://tox.wiki/) with the [*tox-uv*](https://github.com/tox-dev/tox-uv) plugin.
70+
The easiest way is to [install *uv*] which is needed in any case and then run `uv tool install --with tox-uv tox` to have it globally available or `uvx --with tox-uv tox` to use a temporary environment.
71+
72+
---
5173

52-
You can (and should) run our test suite using [*tox*](https://tox.wiki/).
5374
However, you'll probably want a more traditional environment as well.
5475

5576
We recommend using the Python version from the `.python-version-default` file in the project's root directory.
5677

57-
We use a fully-locked development environment using [*uv*](https://docs.astral.sh/uv/) so the easiest way to get started is to [install *uv*](https://docs.astral.sh/uv/getting-started/installation/) and you can run `uv run pytest` to run the tests immediately.
78+
We use a fully-locked development environment using [*uv*](https://docs.astral.sh/uv/) so the easiest way to get started is to [install *uv*] and you can run `uv run pytest` to run the tests immediately.
5879

59-
I you'd like a traditional virtual environment, you can run `uv sync` and it will create a virtual environment named `.venv` with the correct Python version and install all the dependencies in the root directory.
80+
I you'd like a traditional virtual environment, you can run `uv sync --python=$(cat .python-version-default)` and it will create a virtual environment named `.venv` with the correct Python version and install all the dependencies in the root directory.
6081

6182
If you're using [*direnv*](https://direnv.net), you can automate the creation and activation of the project's virtual environment with the correct Python version by adding the following `.envrc` to the project root:
6283

6384
```bash
64-
uv sync
85+
uv sync --python=$(cat .python-version-default)
6586
. .venv/bin/activate
6687
```
6788

6889
---
6990

7091
If you don't want to use *uv*, you can use Pip 25.1 (that added support for dependency groups) or newer and install the dependencies manually:
7192

72-
```bash
73-
pip install -e . --group dev
93+
```console
94+
$ pip install -e . --group dev
95+
```
96+
97+
---
98+
99+
If the test suite fails with errors in `test_packaging.py`, you're lacking Git tags.
100+
You can retroactively fetch them using:
101+
102+
```console
103+
$ git remote add upstream git@github.com:python-attrs/attrs.git
104+
$ git fetch upstream --tags
74105
```
75106

76107
---
@@ -128,7 +159,7 @@ $ tox run -e docs-doctests
128159
assert "foo" == x._a_private_attribute
129160
```
130161

131-
- You can run the test suite runs with all dependencies against all supported Python versions -- just as it will in our CI -- by running `tox`.
162+
- You can run the test suite with all dependencies against all supported Python versions -- just as it will in our CI -- by running `tox`.
132163

133164
- Write [good test docstrings](https://jml.io/test-docstrings/).
134165

@@ -264,3 +295,5 @@ By participating in this project you agree to abide by its terms.
264295
Please report any harm to Hynek Schlawack in any way you find appropriate.
265296

266297
[semantic newlines]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
298+
[install *uv*]: https://docs.astral.sh/uv/getting-started/installation/
299+
[llm]: AI_POLICY.md

.github/FUNDING.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
22
github: hynek
3-
tidelift: "pypi/attrs"
3+
tidelift: pypi/attrs
4+
thanks_dev: u/gh/python-attrs
5+
custom: https://hynek.me/say-thanks/

0 commit comments

Comments
 (0)