Skip to content

Conversation

@Gankra
Copy link
Contributor

@Gankra Gankra commented Jul 15, 2025

  • basic handling

    • parse and discover @warnings.deprecated attributes
    • associate them with function definitions
    • associate them with class definitions
    • add a new "deprecated" diagnostic
    • ensure diagnostic is styled appropriately for LSPs (DiagnosticTag::Deprecated)
  • functions

    • fire on calls
    • fire on arbitrary references
  • classes

    • fire on initializers
    • fire on arbitrary references
  • methods

    • fire on calls
    • fire on arbitrary references
  • overloads

    • fire on calls
    • fire on arbitrary references(??? maybe not ???)
    • only fire if the actual selected overload is deprecated
  • dunder desugarring (warn on deprecated __add__ if + is invoked)

  • alias supression? (don't warn on uses of variables that deprecated items were assigned to)

  • import logic

    • fire on imports of deprecated items
    • suppress subsequent diagnostics if the import diagnostic fired (is this handled by alias supression?)
    • fire on all qualified references (module.mydeprecated)
    • fire on all references that depend on a * import

Fixes astral-sh/ty#153

@Gankra Gankra changed the title Add support for @warnings.deprecated [ty] Add support for @warnings.deprecated Jul 15, 2025
@Gankra Gankra added ty Multi-file analysis & type inference diagnostics Related to reporting of diagnostics. labels Jul 15, 2025
@Gankra
Copy link
Contributor Author

Gankra commented Jul 15, 2025

The big thing left to do here is to generalize to "fire on all references". I haven't started on it but I assume it's non-trivial?

Comment on lines 227 to 236
@overload
@deprecated("strings are no longer supported")
def f(x: str): ...
@overload
def f(x: int): ...
def f(x):
print(x)

# TODO: this shouldn't diagnostic
f(1) # error: [deprecated] "strings are no longer supported"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't obviously see how to get this precision but I didn't look hard, something to ask @dhruvmanila about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might require invoking the call logic i.e., calling the try_call method on the type of f with the argument types. This should give you the Bindings object which would be populated with all the information about the call including the chosen overload which is CallableBinding::matching_overload_index. The problem with this is that the matching_overload_index for now is only populated for step 1 and step 4 of the algorithm.

For step 2, it can easily be done here:

MatchingOverloadIndex::Single(_) => {
// If only one overload evaluates without error, it is the winning match.
return;
}

Step 3 will have more than one matching overloads so it might require updating the type of matching_overload_index or you could use the existing MatchingOverloadIndex.

Step 5 could also result in multiple matching overloads which can also be represented using MatchingOverloadIndex.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, if this PR doesn't result into too many false positives, we could do this in a follow-up PR as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the false positives will be really annoying here, and deprecated-overloads is pretty narrow, so I think it's best to just disable all support for deprecated overloads until said followup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable. Can you open an issue to keep track of it?

// TODO(Gankra): from Jelle: in the PEP I recommended that if you see from somewhere
// import deprecated_function and then a bunch of calls to deprecated_function() in
// the module, you should only issue a diagnostic for the import, not for every call
if let Some(message) = function_literal.deprecated(self.db()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is where to get the more precision you mentioned in #19376 (comment). Instead of checking whether function_literal is deprecated (which checks if any overload of the function is deprecated), you only want to check if overload is (that is, the particular overload that was matched for this call).

(My hope is that overload.binding.binding_type is the FunctionLiteral that points right at the particular overload that was matched. If not, you'll have to get the overload index from the matching_overloads_mut iterator (which is already enumerated for you), and use that index to walk through the overloads looking for the right one. I'm about to sign off for the day but I can help you look at this tomorrow)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe no matter what you need to iterate a list of overloads, as e.g. int | str might match an int overload and a str overload (but not say, a third bool one).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think I spoke poorly. The for loop over matching_overloads_mut handles what you're describing — the loop body will be invoked for each overload that the call actually matches. But for each of those matching overloads, you need to find the OverloadLiteral that describes its signature, so that you can see if it has a deprecated decorator attached. What I was describing was how to go from the Binding (which is what the overload variable is) to that OverloadLiteral. That might require walking through what is effectively a linked list.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@Gankra
Copy link
Contributor Author

Gankra commented Jul 16, 2025

I've pushed up an updated implementation that focuses on places like infer_load_expr and infer_import_from. I think the currently implemented functionality is shippable (mdtest TODOs cover the limitations I'm Knowningly shipping).

I still need to do some cleanups to the code though.

I also haven't looked at all at the specific clauses about inheritance and overrides.

@Gankra
Copy link
Contributor Author

Gankra commented Jul 17, 2025

Rebased and addressed all reviews.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2025

mypy_primer results

Changes were detected when running on open source projects
parso (https://github.com/davidhalter/parso)
+ warning[deprecated] parso/tree.py:1:33: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
+ warning[deprecated] parso/tree.py:136:6: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
+ warning[deprecated] parso/tree.py:144:6: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
- Found 72 diagnostics
+ Found 75 diagnostics

DateType (https://github.com/glyph/DateType)
+ warning[deprecated] src/datetype/__init__.py:529:32: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] src/datetype/__init__.py:533:32: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 6 diagnostics
+ Found 8 diagnostics

python-sop (https://gitlab.com/dkg/python-sop)
+ warning[deprecated] sop/__init__.py:424:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 2 diagnostics
+ Found 3 diagnostics

anyio (https://github.com/agronholm/anyio)
+ warning[deprecated] src/anyio/__init__.py:46:29: The function `wait_socket_readable` is deprecated: This function is deprecated; use `wait_readable` instead
+ warning[deprecated] src/anyio/__init__.py:47:29: The function `wait_socket_writable` is deprecated: This function is deprecated; use `wait_writable` instead
- Found 93 diagnostics
+ Found 95 diagnostics

speedrun.com_global_scoreboard_webapp (https://github.com/Avasam/speedrun.com_global_scoreboard_webapp)
+ warning[deprecated] backend/api/api_wrappers.py:56:33: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] backend/api/core_api.py:36:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] backend/api/core_api.py:37:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] backend/api/global_scoreboard_api.py:76:20: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] backend/services/user_updater.py:78:30: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 60 diagnostics
+ Found 65 diagnostics

comtypes (https://github.com/enthought/comtypes)
+ warning[deprecated] comtypes/test/__init__.py:137:21: The function `makeSuite` is deprecated: Deprecated in Python 3.11; removal scheduled for Python 3.13
+ warning[deprecated] comtypes/test/__init__.py:207:24: The function `makeSuite` is deprecated: Deprecated in Python 3.11; removal scheduled for Python 3.13
- Found 420 diagnostics
+ Found 422 diagnostics

alerta (https://github.com/alerta/alerta)
+ warning[deprecated] alerta/auth/oidc.py:99:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/auth/utils.py:52:20: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/commands.py:66:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:190:56: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:214:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1116:79: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1194:51: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1259:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1301:67: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1517:41: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1603:44: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1608:41: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1618:100: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1668:95: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/base.py:1718:95: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:250:79: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:250:120: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:252:68: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:254:67: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:345:70: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/database/backends/mongodb/utils.py:347:69: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/dev.py:4:23: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/management/views.py:144:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:66:72: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:75:74: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:282:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:335:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:379:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:430:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:574:34: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:594:34: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:609:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/alert.py:637:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/blackout.py:37:65: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/blackout.py:60:91: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/blackout.py:84:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/heartbeat.py:56:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/heartbeat.py:59:74: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/heartbeat.py:61:31: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/history.py:16:72: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/key.py:31:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/key.py:42:49: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/key.py:164:57: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/note.py:25:91: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/user.py:41:72: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/models/user.py:44:72: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/utils/audit.py:94:36: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/utils/client.py:44:45: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] alerta/views/alerts.py:309:27: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] tests/test_blackouts.py:688:42: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 447 diagnostics
+ Found 497 diagnostics

dulwich (https://github.com/dulwich/dulwich)
+ warning[deprecated] dulwich/porcelain.py:5638:25: The function `warn` is deprecated: Deprecated; use warning() instead.
- Found 169 diagnostics
+ Found 170 diagnostics

discord.py (https://github.com/Rapptz/discord.py)
+ warning[deprecated] discord/member.py:929:91: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] discord/member.py:985:61: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 519 diagnostics
+ Found 521 diagnostics

httpx-caching (https://github.com/johtso/httpx-caching)
+ warning[deprecated] httpx_caching/_heuristics.py:14:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 27 diagnostics
+ Found 28 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
+ warning[deprecated] github/MainClass.py:134:42: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
+ warning[deprecated] github/MainClass.py:179:19: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
+ warning[deprecated] github/Requester.py:118:36: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
+ warning[deprecated] github/Requester.py:289:17: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
+ warning[deprecated] github/__init__.py:55:32: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
+ warning[deprecated] tests/Authentication.py:95:31: The class `AppAuthentication` is deprecated: Use github.Auth.AppInstallationAuth instead
- Found 301 diagnostics
+ Found 307 diagnostics

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ warning[deprecated] bson/codec_options.py:63:10: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
+ warning[deprecated] bson/codec_options.py:82:10: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
- Found 423 diagnostics
+ Found 425 diagnostics

pydantic (https://github.com/pydantic/pydantic)
+ warning[deprecated] pydantic/__init__.py:62:46: The function `root_validator` is deprecated: Pydantic V1 style `@root_validator` validators are deprecated. You should migrate to Pydantic V2 style `@model_validator` validators, see the migration guide for more details
+ warning[deprecated] pydantic/__init__.py:62:62: The function `validator` is deprecated: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details
+ warning[deprecated] pydantic/__init__.py:63:36: The class `BaseConfig` is deprecated: BaseConfig is deprecated. Use the `pydantic.ConfigDict` instead.
+ warning[deprecated] pydantic/__init__.py:63:48: The class `Extra` is deprecated: Extra is deprecated. Use literal values instead (e.g. `extra='allow'`)
+ warning[deprecated] pydantic/color.py:89:32: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/color.py:242:56: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/color.py:252:34: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/deprecated/decorator.py:85:72: The function `validate_arguments` is deprecated: The `validate_arguments` method is deprecated; use `validate_call` instead.
+ warning[deprecated] pydantic/deprecated/json.py:16:21: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/deprecated/json.py:56:5: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/deprecated/json.py:132:16: The function `pydantic_encoder` is deprecated: `pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.
+ warning[deprecated] pydantic/deprecated/parse.py:78:12: The function `load_str_bytes` is deprecated: `load_str_bytes` is deprecated.
+ warning[deprecated] pydantic/deprecated/tools.py:101:9: The function `schema_of` is deprecated: `schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.
+ warning[deprecated] pydantic/main.py:267:30: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:278:39: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:288:30: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:436:10: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:546:10: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:937:34: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:1094:31: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:1105:35: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:1248:29: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
+ warning[deprecated] pydantic/main.py:1362:25: The function `load_str_bytes` is deprecated: `load_str_bytes` is deprecated.
+ warning[deprecated] pydantic/main.py:1415:21: The function `load_file` is deprecated: `load_file` is deprecated.
+ warning[deprecated] pydantic/main.py:1557:38: The function `pydantic_encoder` is deprecated: `pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.
+ warning[deprecated] pydantic/main.py:1561:21: The function `pydantic_encoder` is deprecated: `pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.
+ warning[deprecated] pydantic/types.py:1949:78: The class `PaymentCardNumber` is deprecated: The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.
+ warning[deprecated] pydantic/v1/_hypothesis_plugin.py:105:20: The class `Color` is deprecated: The `Color` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.
+ warning[deprecated] pydantic/v1/_hypothesis_plugin.py:126:22: The class `PaymentCardNumber` is deprecated: The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.
+ warning[deprecated] pydantic/v1/_hypothesis_plugin.py:139:14: The class `PaymentCardNumber` is deprecated: The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.
- Found 748 diagnostics
+ Found 778 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
+ warning[deprecated] strawberry/utils/typing.py:221:65: The class `Index` is deprecated: Deprecated since Python 3.9. Use the index value directly instead.
+ warning[deprecated] strawberry/utils/typing.py:258:65: The class `Index` is deprecated: Deprecated since Python 3.9. Use the index value directly instead.
+ warning[deprecated] strawberry/utils/typing.py:276:65: The class `Index` is deprecated: Deprecated since Python 3.9. Use the index value directly instead.
- Found 365 diagnostics
+ Found 368 diagnostics

mkosi (https://github.com/systemd/mkosi)
+ warning[deprecated] mkosi/documentation.py:32:29: The function `warn` is deprecated: Deprecated; use warning() instead.
- Found 90 diagnostics
+ Found 91 diagnostics

stone (https://github.com/dropbox/stone)
+ warning[deprecated] test/test_python_gen.py:145:33: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] test/test_python_gen.py:221:33: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] test/test_python_gen.py:413:33: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 113 diagnostics
+ Found 116 diagnostics

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ warning[deprecated] antimentionspam/antimentionspam.py:239:26: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] embedmaker/serialize.py:81:34: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] embedmaker/time_utils.py:42:54: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] modnotes/modnotes.py:148:32: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] rolemanagement/events.py:41:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] scheduler/message.py:82:57: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] scheduler/time_utils.py:42:54: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 142 diagnostics
+ Found 149 diagnostics

dragonchain (https://github.com/dragonchain/dragonchain)
+ warning[deprecated] dragonchain/lib/authorization.py:51:30: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] dragonchain/lib/dto/smart_contract_model.py:100:95: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] dragonchain/lib/dto/smart_contract_model.py:300:121: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] dragonchain/scheduler/scheduler.py:65:51: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 302 diagnostics
+ Found 306 diagnostics

tornado (https://github.com/tornadoweb/tornado)
+ warning[deprecated] tornado/autoreload.py:339:26: The function `get_loader` is deprecated: Use importlib.util.find_spec() instead. Will be removed in Python 3.14.
+ warning[deprecated] tornado/test/httpclient_test.py:932:43: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] tornado/test/httputil_test.py:506:42: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
- Found 243 diagnostics
+ Found 246 diagnostics

bandersnatch (https://github.com/pypa/bandersnatch)
+ warning[deprecated] src/bandersnatch/utils.py:54:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 128 diagnostics
+ Found 129 diagnostics

freqtrade (https://github.com/freqtrade/freqtrade)
+ warning[deprecated] freqtrade/rpc/api_server/api_ws.py:42:41: The function `dict` is deprecated: The `dict` method is deprecated; use `model_dump` instead.
- Found 368 diagnostics
+ Found 369 diagnostics

paasta (https://github.com/yelp/paasta)
+ warning[deprecated] paasta_tools/cli/cmds/logs.py:1018:46: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/cli/cmds/logs.py:1315:42: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/cli/cmds/logs.py:1327:40: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/cli/cmds/start_stop_restart.py:276:77: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/utils.py:1514:30: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/utils.py:3710:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] paasta_tools/utils.py:3718:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 878 diagnostics
+ Found 885 diagnostics

pywin32 (https://github.com/mhammond/pywin32)
+ warning[deprecated] AutoDuck/fixHelpCompression.py:16:10: The function `WriteProfileVal` is deprecated: This function is obsolete, applications should use the registry instead.
+ warning[deprecated] Pythonwin/pywin/framework/editor/vss.py:45:29: The function `GetProfileVal` is deprecated: This function is obsolete, applications should use the registry instead.
+ warning[deprecated] Pythonwin/pywin/framework/editor/vss.py:46:28: The function `GetProfileVal` is deprecated: This function is obsolete, applications should use the registry instead.
+ warning[deprecated] Pythonwin/pywin/framework/sgrepmdi.py:606:29: The function `GetProfileSection` is deprecated: This function is obsolete, applications should use the registry instead.
+ warning[deprecated] Pythonwin/pywin/framework/sgrepmdi.py:620:30: The function `WriteProfileVal` is deprecated: This function is obsolete, applications should use the registry instead.
+ warning[deprecated] com/win32com/test/testMSOffice.py:147:38: The function `MakeTime` is deprecated: Use pywintypes.Time() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:25:18: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:91:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:92:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:93:18: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:94:18: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:99:16: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:100:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:101:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:102:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] com/win32comext/shell/demos/servers/folder_view.py:103:17: The function `MakeIID` is deprecated: Use pywintypes.IID() instead.
+ warning[deprecated] win32/Lib/win32serviceutil.py:139:28: The function `GetProfileVal` is deprecated: This function is obsolete, applications should use the registry instead.
- Found 2014 diagnostics
+ Found 2031 diagnostics

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ warning[deprecated] docs/conf.py:22:23: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
- Found 144 diagnostics
+ Found 145 diagnostics

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ warning[deprecated] examples/contrib/webscanner_helper/urlindex.py:93:42: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] examples/contrib/webscanner_helper/watchdog.py:74:51: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] examples/contrib/webscanner_helper/watchdog.py:78:51: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] mitmproxy/contentviews/__init__.py:20:22: The function `get` is deprecated: Use `mitmproxy.contentviews.registry` instead.
+ warning[deprecated] mitmproxy/contentviews/__init__.py:22:22: The function `remove` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/__init__.py:42:19: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/__init__.py:166:32: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/_compat.py:20:45: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/_compat.py:60:37: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/_compat.py:73:18: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/base.py:80:34: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] mitmproxy/contentviews/base.py:120:12: The function `format_pairs` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test__compat.py:6:41: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test__compat.py:10:20: The class `View` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test__compat.py:53:28: The function `get` is deprecated: Use `mitmproxy.contentviews.registry` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test__compat.py:59:28: The function `get` is deprecated: Use `mitmproxy.contentviews.registry` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test__compat.py:67:17: The function `remove` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:9:20: The function `format_dict` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:14:20: The function `format_dict` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:19:20: The function `format_dict` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:27:20: The function `format_pairs` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:32:20: The function `format_pairs` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/contentviews/test_base.py:37:20: The function `format_pairs` is deprecated: Use `mitmproxy.contentviews.Contentview` instead.
+ warning[deprecated] test/mitmproxy/test_certs.py:236:53: The function `to_pyopenssl` is deprecated: Use `to_cryptography` instead.
- Found 1797 diagnostics
+ Found 1821 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
+ warning[deprecated] openlibrary/accounts/model.py:241:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/accounts/model.py:605:40: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/admin.py:147:31: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/edits.py:237:43: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/edits.py:257:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/edits.py:286:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/edits.py:302:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/edits.py:328:44: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/imports.py:284:46: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/lending.py:838:35: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/lending.py:928:67: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/statsdb.py:32:48: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/statsdb.py:58:48: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/waitinglist.py:69:35: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/waitinglist.py:75:74: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/waitinglist.py:84:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/waitinglist.py:265:70: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/core/waitinglist.py:273:31: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/coverstore/db.py:41:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/coverstore/db.py:115:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/coverstore/db.py:130:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/data/db.py:157:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/data/sitemap.py:88:35: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/admin/code.py:616:30: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/ol_infobase.py:301:33: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/borrow_home.py:52:33: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/borrow_home.py:68:33: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/borrow_home.py:69:31: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/code.py:1125:27: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/connection.py:213:50: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/openlibrary/infobase_hook.py:21:35: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/upstream/addbook.py:46:36: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/upstream/borrow.py:418:21: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/upstream/borrow.py:524:77: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/upstream/code.py:213:52: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/plugins/worksearch/subjects.py:344:46: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/utils/bulkimport.py:80:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] openlibrary/utils/bulkimport.py:191:39: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
- Found 681 diagnostics
+ Found 719 diagnostics

meson (https://github.com/mesonbuild/meson)
+ warning[deprecated] mesonbuild/build.py:532:10: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
+ warning[deprecated] mesonbuild/linkers/linkers.py:127:10: The class `abstractproperty` is deprecated: Use 'property' with 'abstractmethod' instead
- Found 909 diagnostics
+ Found 911 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
+ warning[deprecated] src/prefect/input/actions.py:46:49: The function `json` is deprecated: The `json` method is deprecated; use `model_dump_json` instead.
- Found 3739 diagnostics
+ Found 3740 diagnostics

materialize (https://github.com/MaterializeInc/materialize)
+ warning[deprecated] ci/cleanup/aws.py:105:20: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] ci/cleanup/launchdarkly.py:32:24: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] ci/load/periodic.py:31:29: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] ci/load/periodic.py:36:40: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] misc/python/materialize/buildkite_insights/util/data_io.py:75:21: The function `utcfromtimestamp` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)
+ warning[deprecated] misc/python/materialize/cli/cloudbench.py:290:44: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] misc/python/materialize/cli/scratch/create.py:148:40: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] misc/python/materialize/parallel_workload/action.py:80:46: The function `getName` is deprecated: Use the name attribute instead
+ warning[deprecated] misc/python/materialize/parallel_workload/action.py:1737:40: The function `getName` is deprecated: Use the name attribute instead
+ warning[deprecated] misc/python/materialize/parallel_workload/executor.py:109:50: The function `getName` is deprecated: Use the name attribute instead
+ warning[deprecated] misc/python/materialize/parallel_workload/worker.py:131:62: The function `getName` is deprecated: Use the name attribute instead
+ warning[deprecated] misc/python/materialize/scratch.py:418:34: The function `utcnow` is deprecated: Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)
+ warning[deprecated] test/rtr-combined/mzcompose.py:67:54: The function `getName` is deprecated: Use the name attribute instead
- Found 3237 diagnostics
+ Found 3250 diagnostics

sympy (https://github.com/sympy/sympy)
+ warning[deprecated] sympy/testing/runtests.py:1176:28: The class `Str` is deprecated: Replaced by ast.Constant; removed in Python 3.14
+ warning[deprecated] sympy/testing/runtests.py:1195:33: The class `Str` is deprecated: Replaced by ast.Constant; removed in Python 3.14
- Found 13539 diagnostics
+ Found 13541 diagnostics
No memory usage changes detected ✅

@sharkdp
Copy link
Contributor

sharkdp commented Jul 18, 2025

Rebased your branch, as I reviewed the changes in #19400 that caused the conflicts here. Hope that's fine

@github-actions
Copy link
Contributor

ecosystem-analyzer results

Lint rule Added Removed Changed
deprecated 240 0 0
call-non-callable 1 0 0
invalid-argument-type 1 0 0
Total 242 0 0

Full report with detailed diff

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall looks good to me but I'm curious what the performance numbers will show. You'll have to fix the panic in the benchmark (review what new diagnostics there are) to get those numbers and push the updated benchmark.

The other thing we have to look into is if using StringLiteralType is too strict and how we want to handle very long messages

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks good!

Apart from the invalid-argument-type false positive, we should also look into this new diagnostic (also on altair):

altair (https://github.com/vega/altair)
+ error[call-non-callable] altair/vegalite/v6/theme.py:73:5: Object of type `warnings.deprecated` is not callable

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modulo a couple small inline comments, this looks land-ready to me!

@Gankra
Copy link
Contributor Author

Gankra commented Jul 18, 2025

Done.

@Gankra Gankra enabled auto-merge (squash) July 18, 2025 23:48
@Gankra Gankra merged commit 06f9f52 into main Jul 18, 2025
36 checks passed
@Gankra Gankra deleted the gankra/warn-dep branch July 18, 2025 23:50
UnboundVariable pushed a commit to UnboundVariable/ruff that referenced this pull request Jul 19, 2025
* main:
  [ty] Avoid secondary tree traversal to get call expression for keyword arguments (astral-sh#19429)
  [ty] Add goto definition to playground (astral-sh#19425)
  [ty] Add support for `@warnings.deprecated` (astral-sh#19376)
  [ty] make `del x` force local resolution of `x` in the current scope (astral-sh#19389)

# Conflicts:
#	crates/ty_ide/src/goto.rs
dcreager added a commit that referenced this pull request Jul 21, 2025
* main: (25 commits)
  [ty] Sync vendored typeshed stubs (#19461)
  [ty] Extend tuple `__len__` and `__bool__` special casing to also cover tuple subclasses (#19289)
  [ty] bump docstring-adder pin (#19458)
  [ty] Disallow assignment to `Final` class attributes (#19457)
  Update dependency ruff to v0.12.4 (#19442)
  Update pre-commit hook astral-sh/ruff-pre-commit to v0.12.4 (#19443)
  Update rui314/setup-mold digest to 702b190 (#19441)
  Update taiki-e/install-action action to v2.56.19 (#19448)
  Update Rust crate strum_macros to v0.27.2 (#19447)
  Update Rust crate strum to v0.27.2 (#19446)
  Update Rust crate rand to v0.9.2 (#19444)
  Update Rust crate serde_json to v1.0.141 (#19445)
  Fix `unreachable` panic in parser (#19183)
  [`ruff`] Support byte strings (`RUF055`) (#18926)
  [ty] Avoid second lookup for `infer_maybe_standalone_expression` (#19439)
  [ty] Implemented "go to definition" support for import statements (#19428)
  [ty] Avoid secondary tree traversal to get call expression for keyword arguments (#19429)
  [ty] Add goto definition to playground (#19425)
  [ty] Add support for `@warnings.deprecated` (#19376)
  [ty] make `del x` force local resolution of `x` in the current scope (#19389)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Related to reporting of diagnostics. ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supporting @warnings.deprecated and its backport in typing_extensions

8 participants