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

pytz lint #7

Open
kbehlers opened this issue Sep 22, 2022 · 2 comments
Open

pytz lint #7

kbehlers opened this issue Sep 22, 2022 · 2 comments

Comments

@kbehlers
Copy link

I'm interested in pytz linting, specifically preventing pytz timezone classes (BaseTzInfo) from being used directly as the tzinfo argument with datetime.datetime(tzinfo=) and with .replace(tzinfo=), since that is almost always an error.

Would you be open to a PR adding pytz added as a dependency and checks around those cases?

@djmattyg007
Copy link

You should probably avoid using pytz:
https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html

@kbehlers
Copy link
Author

@djmattyg007 Yes, I would agree 🙂 We have some legacy code in pytz that we aren't prepared to rewrite, but we also don't want any new usage of pytz sneaking into the codebase. It would be easier to enforce this with a linting rule since we can't yet remove pytz as a direct dependency and it is a downstream dependency of a lot of other packages we use at this point.

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

No branches or pull requests

2 participants