<!-- Thank you for your contribution! -->
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->

## Change Summary

<!-- Please give a short summary of the changes. -->

Emit a warning when writing:

```python
class Model(Generic[T], BaseModel):
```

instead of:

```python
class Model(BaseModel, Generic[T]):
```

More generally, `BaseModel` must appear in the `__mro__` before `Generic`, so indirect subclasses are also checked. This means that `__class_getitem__` will use `BaseModel` instead of `Generic` and `Model[T]` will return a model class rather than a `_GenericAlias`.

## Related issue number

Closes https://github.com/pydantic/pydantic/issues/7845

Waiting for a reply to https://github.com/pydantic/pydantic/issues/6994#issuecomment-1773295810 before continuing here, but thought I should push what I have so far. The failing tests might be of interest.

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [x] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**


Selected Reviewer: @dmontagu
Warn if a class inherits from Generic before BaseModel. <!-- Thank you for your contribution! -->
<!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR -->

## Change Summary

<!-- Please give a short summary of the changes. -->

Emit a warning when writing:

```python
class Model(Generic[T], BaseModel):
```

instead of:

```python
class Model(BaseModel, Generic[T]):
```

More generally, `BaseModel` must appear in the `__mro__` before `Generic`, so indirect subclasses are also checked. This means that `__class_getitem__` will use `BaseModel` instead of `Generic` and `Model[T]` will return a model class rather than a `_GenericAlias`.

## Related issue number

Closes https://github.com/pydantic/pydantic/issues/7845

Waiting for a reply to https://github.com/pydantic/pydantic/issues/6994#issuecomment-1773295810 before continuing here, but thought I should push what I have so far. The failing tests might be of interest.

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [x] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**


Selected Reviewer: @dmontagu
"""Short helper script to check that a PR has exactly one relnotes label."""

import json
import os
import sys

if __name__ == '__main__':
    event_path = os.environ.get('GITHUB_EVENT_PATH')
    if event_path is None:
        raise RuntimeError('Can only check changelog on github actions')

    with open(event_path) as event_file:
        event = json.load(event_file)

    labels = [
        label['name']
        for label in event['pull_request']['labels']
        if label['name'].startswith('relnotes-') or label['name'] == 'documentation'
    ]

    if not labels:
        print(
            'No suitable label found, please add either one of the `relnotes-` or `documentation` labels.',
            file=sys.stderr,
        )
        exit(1)

    if len(labels) > 1:
        print(f'Multiple relnotes labels found: `{"`, `".join(labels)}`', file=sys.stderr)
        exit(1)

    print('Found suitable label:', labels[0])
    exit(0)

"""Short helper script to check that a PR has exactly one relnotes label."""

import json
import os
import sys

if __name__ == '__main__':
    event_path = os.environ.get('GITHUB_EVENT_PATH')
    if event_path is None:
        raise RuntimeError('Can only check changelog on github actions')

    with open(event_path) as event_file:
        event = json.load(event_file)

    labels = [
        label['name']
        for label in event['pull_request']['labels']
        if label['name'].startswith('relnotes-') or label['name'] == 'documentation'
    ]

    if not labels:
        print(
            'No suitable label found, please add either one of the `relnotes-` or `documentation` labels.',
            file=sys.stderr,
        )
        exit(1)

    if len(labels) > 1:
        print(f'Multiple relnotes labels found: `{"`, `".join(labels)}`', file=sys.stderr)
        exit(1)

    print('Found suitable label:', labels[0])
    exit(0)
