Skip to content

Remove unnecessary dependency pytz #269

Open
@ErikBjare

Description

@ErikBjare

Is your feature request related to a problem? Please describe.

pytz is a somewhat complex dependency in some ways (it dumps hundreds of tzinfo files on the filesystem), yet it looks like it's not really needed since it's only used to set the UTC timezone for some timezone-aware datetimes.

See this search for usages: https://github.com/python-restx/flask-restx/search?q=pytz

Describe the solution you'd like

Removal of pytz as a dependency, and replace all references to pytz.UTC with datetime.timezone.utc.

Additional context

Since datetime.timezone is not available in Python 2.7, we might need to construct a tzinfo object by hand (should be trivial though, since it's just UTC). However, since there's #113 I assume keeping Python 2.7 support might not be of interest anymore.

I volunteer to contribute a PR making this change, if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions