arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.64k stars 667 forks source link

Require types-python-dateutil #1102

Closed tbekolay closed 10 months ago

tbekolay commented 2 years ago

Pull Request Checklist

tox passes, but when I run tox -e lint I get a number of ANN401 Dynamically typed expressions errors.

I'm happy to add a test for the change but it's sort of unclear how to do this since it isn't a runtime change, it's a change that should only be picked up when running mypy. A short snippet that will raise an error without installing types-python-dateutil is:

(arrow.now() - arrow.now()).total_seconds()

Description of Changes

Not having types-python-dateutil installed results in confusing errors when running mypy on the subtraction of two Arrow instances. See https://github.com/python/mypy/issues/11613 for a description of the issue, as well as some debugging from a few people.

codecov[bot] commented 2 years ago

Codecov Report

Merging #1102 (40aa9ea) into master (f8f3068) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #1102   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2325      2325           
  Branches       449       449           
=========================================
  Hits          2325      2325           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

tbekolay commented 2 years ago

or maybe the requirements files would be a better place?

The requirements file does not get used when installing arrow through normal means like pip install arrow, so putting it there would not fix the issue I reference in the PR description.

jadchaar commented 10 months ago

Hi all thanks for the contribution here. Given that this PR now has conflicts, I have made the change in https://github.com/arrow-py/arrow/commit/3a6cd95389dfe1c93684aa083a6e3db408269fdb. Thanks a ton for raising this @tbekolay

tbekolay commented 10 months ago

Awesome thanks @jadchaar!