Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require types-python-dateutil #1102

Closed
wants to merge 2 commits into from

Conversation

tbekolay
Copy link

@tbekolay tbekolay commented Apr 5, 2022

Pull Request Checklist

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

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 python/mypy#11613 for a description of the issue, as well as some debugging from a few people.

@codecov
Copy link

codecov bot commented Apr 5, 2022

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.

Copy link
Member

@krisfremen krisfremen left a comment

Choose a reason for hiding this comment

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

@anishnya @jadchaar @systemcatch

would setup.py be the best place to put this?
or maybe the requirements files would be a better place?

@tbekolay
Copy link
Author

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.

Not having this installed results in confusing errors when
running `mypy` on the subtraction of two `Arrow` instances.
See python/mypy#11613 for details.
@jadchaar
Copy link
Member

Hi all thanks for the contribution here. Given that this PR now has conflicts, I have made the change in 3a6cd95. Thanks a ton for raising this @tbekolay

@jadchaar jadchaar closed this Sep 30, 2023
@tbekolay
Copy link
Author

Awesome thanks @jadchaar!

BenMMcLean pushed a commit to TechlauncherFireApp/backend that referenced this pull request Oct 8, 2023
Bumps [arrow](https://github.com/arrow-py/arrow) from 1.2.3 to 1.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/arrow-py/arrow/releases">arrow's
releases</a>.</em></p>
<blockquote>
<h2>Version 1.3.0</h2>
<ul>
<li>[ADDED] Added official support for Python 3.11 and 3.12.</li>
<li>[ADDED] Added dependency on <code>types-python-dateutil</code> to
improve Arrow mypy compatibility. PR <a
href="https://redirect.github.com/arrow-py/arrow/pull/1102">arrow-py/arrow#1102</a></li>
<li>[FIX] Updates to Italian, Romansh, Hungarian, Finish and Arabic
locales.</li>
<li>[FIX] Handling parsing of UTC prefix in timezone strings.</li>
<li>[CHANGED] Update documentation to improve readability.</li>
<li>[CHANGED] Dropped support for Python 3.6 and 3.7, which are
end-of-life.</li>
<li>[INTERNAL] Migrate from <code>setup.py</code>/Twine to
<code>pyproject.toml</code>/Flit for packaging and distribution.</li>
<li>[INTERNAL] Adopt <code>.readthedocs.yaml</code> configuration file
for continued ReadTheDocs support.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst">arrow's
changelog</a>.</em></p>
<blockquote>
<h2>1.3.0 (2023-09-30)</h2>
<ul>
<li>[ADDED] Added official support for Python 3.11 and 3.12.</li>
<li>[ADDED] Added dependency on <code>types-python-dateutil</code> to
improve Arrow mypy compatibility. <code>PR
[#1102](arrow-py/arrow#1102)
&lt;https://github.com/arrow-py/arrow/pull/1102&gt;</code>_</li>
<li>[FIX] Updates to Italian, Romansh, Hungarian, Finish and Arabic
locales.</li>
<li>[FIX] Handling parsing of UTC prefix in timezone strings.</li>
<li>[CHANGED] Update documentation to improve readability.</li>
<li>[CHANGED] Dropped support for Python 3.6 and 3.7, which are
end-of-life.</li>
<li>[INTERNAL] Migrate from <code>setup.py</code>/Twine to
<code>pyproject.toml</code>/Flit for packaging and distribution.</li>
<li>[INTERNAL] Adopt <code>.readthedocs.yaml</code> configuration file
for continued ReadTheDocs support.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/arrow-py/arrow/commit/87a1a774aad0505d9da18ad1d16f6e571f262503"><code>87a1a77</code></a>
Bump version and add changelog</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/431e9793be2d353f11b48532f9e96d5486f778f0"><code>431e979</code></a>
Migrate to pyproject.toml (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1164">#1164</a>)</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/522a65b16742a76b21154efaff3c3768e95a9bcc"><code>522a65b</code></a>
add 'week' and 'weeks' to Arabic locale (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1155">#1155</a>)</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/3a6cd95389dfe1c93684aa083a6e3db408269fdb"><code>3a6cd95</code></a>
Add python dateutil types</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/1b957339101e9bd8cd7abe1aa5ddf8ede98d56cf"><code>1b95733</code></a>
Added translation for weeks in Finnish locale (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1157">#1157</a>)</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/de0aea98051f9d99f237e7edd27ae3e5c6bf1489"><code>de0aea9</code></a>
Fix failing builds and drop Py36 and 37 support (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1163">#1163</a>)</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/74a759b88447b6ecd9fd5de610f272c8fb6130a2"><code>74a759b</code></a>
Upgrade pre-commit hook versions (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1140">#1140</a>)</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/c28d39ef527d536d795a334844dc68279e1ab0ac"><code>c28d39e</code></a>
Merge pull request <a
href="https://redirect.github.com/arrow-py/arrow/issues/1137">#1137</a>
from michael-k/python3.11</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/fa2cf193ac2e4580c87028a0b627361fb27cf05a"><code>fa2cf19</code></a>
Merge branch 'master' into python3.11</li>
<li><a
href="https://github.com/arrow-py/arrow/commit/e916a2d55d77b51c1bd7983b1e2bc2c18b4d6b35"><code>e916a2d</code></a>
Changing Documentation Theme to Improve Readability (<a
href="https://redirect.github.com/arrow-py/arrow/issues/1135">#1135</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/arrow-py/arrow/compare/1.2.3...1.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=arrow&package-manager=pip&previous-version=1.2.3&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants