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

Migrate away from pytz #1516

Open
mfeit-internet2 opened this issue Feb 4, 2025 · 0 comments
Open

Migrate away from pytz #1516

mfeit-internet2 opened this issue Feb 4, 2025 · 0 comments
Labels

Comments

@mfeit-internet2
Copy link
Member

mfeit-internet2 commented Feb 4, 2025

Seen on D12:

/usr/lib/python3/dist-packages/pscheduler/iso8601.py:33: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  parsed = get_localzone().localize(parsed)

Per the link above, we need to migrate away from pytz. It is used in these places:

./pscheduler-core/pscheduler-core/plot-schedule:import pytz
./pscheduler-core/pscheduler-core/plot-schedule:            absolute = pytz.utc.localize(absolute)

./pscheduler-core/pscheduler-core/schedule:import pytz
./pscheduler-core/pscheduler-core/schedule:            absolute = pytz.utc.localize(absolute)

./pscheduler-server/pscheduler-server/api-server/pschedulerapiserver/admin.py:import pytz

./pscheduler-tool-powstream/powstream/run:import pytz
./pscheduler-tool-powstream/powstream/run:start_time = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
./pscheduler-tool-powstream/powstream/powstream_utils.py:import pytz
./pscheduler-tool-powstream/powstream/powstream_utils.py:    now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)

./python-pscheduler/pscheduler/pscheduler/pstime.py:import pytz
./python-pscheduler/pscheduler/pscheduler/pstime.py:    return datetime.datetime.fromtimestamp(0, pytz.utc)

./python-pscheduler/pscheduler/pscheduler/clockstate.py:import pytz
./python-pscheduler/pscheduler/pscheduler/clockstate.py:    time_here = pytz.utc.localize(utc).astimezone(local_tz)

./python-pscheduler/pscheduler/setup.py:        'pytz >= 2016.6',
@github-project-automation github-project-automation bot moved this to Ready in perfSONAR Feb 4, 2025
@mfeit-internet2 mfeit-internet2 changed the title Check on use of localize() in time parser Migrate away from pytz Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready
Development

No branches or pull requests

1 participant