Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adamchainz/django-upgrade Loading
base: 1.17.0
Choose a base ref
...
head repository: adamchainz/django-upgrade Loading
compare: 1.19.0
Choose a head ref
  • 19 commits
  • 49 files changed
  • 2 contributors

Commits on May 14, 2024

  1. [pre-commit.ci] pre-commit autoupdate (#451)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/tox-dev/pyproject-fmt: 1.8.0 →
    2.0.4](tox-dev/pyproject-fmt@1.8.0...2.0.4)
    <!--pre-commit.ci end-->
    
    ---------
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    Co-authored-by: Adam Johnson <me@adamj.eu>
    pre-commit-ci[bot] and adamchainz committed May 14, 2024
    Configuration menu
    Copy the full SHA
    0d47a58 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. [pre-commit.ci] pre-commit autoupdate (#452)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/tox-dev/pyproject-fmt: 2.0.4 →
    2.1.1](tox-dev/pyproject-fmt@2.0.4...2.1.1)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] committed May 21, 2024
    Configuration menu
    Copy the full SHA
    1519dc0 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2024

  1. Configuration menu
    Copy the full SHA
    d83874b View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. [pre-commit.ci] pre-commit autoupdate (#454)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/tox-dev/pyproject-fmt: 2.1.1 →
    2.1.3](tox-dev/pyproject-fmt@2.1.1...2.1.3)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] committed May 28, 2024
    Configuration menu
    Copy the full SHA
    4f85470 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    585dbe0 View commit details
    Browse the repository at this point in the history
  3. Add CheckConstraint.check fixer (#457)

    Fixes #455.
    adamchainz committed May 28, 2024
    Configuration menu
    Copy the full SHA
    d0fc922 View commit details
    Browse the repository at this point in the history
  4. Version 1.18.0

    adamchainz committed May 28, 2024
    Configuration menu
    Copy the full SHA
    1effd6c View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. [pre-commit.ci] pre-commit autoupdate (#458)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/asottile/pyupgrade: v3.15.2 →
    v3.16.0](asottile/pyupgrade@v3.15.2...v3.16.0)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    9f1189a View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2024

  1. Configuration menu
    Copy the full SHA
    454d858 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. [pre-commit.ci] pre-commit autoupdate (#461)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/PyCQA/flake8: 7.0.0 →
    7.1.0](PyCQA/flake8@7.0.0...7.1.0)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    42dfa59 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    b8f89ea View commit details
    Browse the repository at this point in the history
  2. Improve MyPy configuration

    Some improvments flagged by Repo-Review: https://learn.scientific-python.org/development/guides/repo-review/
    
    1. Remove now-default show_error_codes.
    2. Enable some optional error codes with extra checks.
    adamchainz committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    4d17c1c View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2024

  1. Configuration menu
    Copy the full SHA
    c0e116e View commit details
    Browse the repository at this point in the history
  2. Add missing empty Django versions to README (#463)

    Just being explicit.
    adamchainz committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    e97aab5 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2024

  1. Configuration menu
    Copy the full SHA
    d3bdf2e View commit details
    Browse the repository at this point in the history
  2. PR link in changelog

    adamchainz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    40c275e View commit details
    Browse the repository at this point in the history
  3. Remove pushing of state onto nodes stack (#466)

    Vestigial from pyupgrade skeleton.
    adamchainz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    c50e9f9 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. Add Model.Meta.index_together fixer (#464)

    Fixes #344.
    
    Handles both forms of `index_together`, in list and tuple, and
    with/without existing `indexes` definition. Tried to cover every edge
    case I could think of, per tests.
    
    Tested on Sentry, the only project I could find with historical
    `index_together` definitions. Use this commit:
    getsentry/sentry@a32270c,
    just before
    github.com/getsentry/sentry/commit/00884d133eaaedf3e69bc8ab3d3bca781e0c425f
    and later commits updated `index_together`.
    
    Saw successful rewrites:
    
    ```console
    $ git ls-files -z '*.py' | xargs -0 django-upgrade --target-version 4.2 --only index_together
    Rewriting src/sentry/feedback/models.py
    Rewriting src/sentry/incidents/models.py
    Rewriting src/sentry/models/activity.py
    Rewriting src/sentry/models/artifactbundle.py
    Rewriting src/sentry/models/commit.py
    Rewriting src/sentry/models/debugfile.py
    Rewriting src/sentry/models/eventattachment.py
    Rewriting src/sentry/models/group.py
    Rewriting src/sentry/models/grouphistory.py
    Rewriting src/sentry/models/groupinbox.py
    Rewriting src/sentry/models/grouprelease.py
    Rewriting src/sentry/models/organizationmembermapping.py
    Rewriting src/sentry/models/outbox.py
    Rewriting src/sentry/models/pullrequest.py
    Rewriting src/sentry/models/release.py
    Rewriting src/sentry/models/releasefile.py
    Rewriting src/sentry/models/releaseprojectenvironment.py
    Rewriting src/sentry/models/rule.py
    Rewriting src/sentry/models/statistical_detectors.py
    Rewriting src/sentry/models/userreport.py
    Rewriting src/sentry/replays/models.py
    ```
    
    ...and the diff looks good:
    
    ```diff
    $ git diff '*.py' | head -n 50
    diff --git src/sentry/feedback/models.py src/sentry/feedback/models.py
    index 3527d584bc4..b15d3a8ba45 100644
    --- src/sentry/feedback/models.py
    +++ src/sentry/feedback/models.py
    @@ -27,6 +27,6 @@ class Feedback(Model):
         class Meta:
             app_label = "feedback"
             db_table = "feedback_feedback"
    -        index_together = [("project_id", "date_added")]
    +        indexes = [models.Index(fields=("project_id", "date_added"))]
    
         __repr__ = sane_repr("project_id", "feedback_id")
    diff --git src/sentry/incidents/models.py src/sentry/incidents/models.py
    index 6a4f4f6ae39..06e84dc7136 100644
    --- src/sentry/incidents/models.py
    +++ src/sentry/incidents/models.py
    @@ -205,7 +205,7 @@ class Meta:
             app_label = "sentry"
             db_table = "sentry_incident"
             unique_together = (("organization", "identifier"),)
    -        index_together = (("alert_rule", "type", "status"),)
    +        indexes = [models.Index(fields=("alert_rule", "type", "status"))]
    
         @Property
         def current_end_date(self):
    @@ -561,7 +561,7 @@ class Meta:
             app_label = "sentry"
             db_table = "sentry_incidenttrigger"
             unique_together = (("incident", "alert_rule_trigger"),)
    -        index_together = (("alert_rule_trigger", "incident_id"),)
    +        indexes = [models.Index(fields=("alert_rule_trigger", "incident_id"))]
    
    
     class AlertRuleTriggerManager(BaseManager["AlertRuleTrigger"]):
    diff --git src/sentry/models/activity.py src/sentry/models/activity.py
    index aa9e0545adc..57575e9ac6b 100644
    --- src/sentry/models/activity.py
    +++ src/sentry/models/activity.py
    @@ -109,7 +109,7 @@ class Activity(Model):
         class Meta:
             app_label = "sentry"
             db_table = "sentry_activity"
    -        index_together = (("project", "datetime"),)
    +        indexes = [models.Index(fields=("project", "datetime"))]
    
         __repr__ = sane_repr("project_id", "group_id", "event_id", "user_id", "type", "ident")
    
    diff --git src/sentry/models/artifactbundle.py src/sentry/models/artifactbundle.py
    index 323912d6d98..cbfb61c8805 100644
    --- src/sentry/models/artifactbundle.py
    ```
    
    One model was missed due to no `from django.db import models` in the
    file - I am gonna leave that for extension, if anyone wants.
    adamchainz committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    d940d0e View commit details
    Browse the repository at this point in the history
  2. Version 1.19.0

    adamchainz committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    b6dc726 View commit details
    Browse the repository at this point in the history
Loading