C2N14 / AutomaThemely

Simple, set-and-forget python application for changing between desktop themes according to light and dark hours
GNU General Public License v3.0
205 stars 31 forks source link

Fix Location import for Astral v2.0+ #36

Closed bradenhilton closed 1 year ago

bradenhilton commented 4 years ago

Astral v2.0+

Geocoder functions return a LocationInfo instead of a Location

https://astral.readthedocs.io/en/latest/#version-history

Opening AutomaThemely on my up-to-date Arch system (including Python v3.8) results in a traceback due to this Astral change:

> automathemely
Traceback (most recent call last):
  File "/usr/bin/automathemely", line 11, in <module>
    load_entry_point('AutomaThemely==1.3', 'console_scripts', 'automathemely')()
  File "/usr/lib/python3.8/site-packages/automathemely/bin/run.py", line 29, in main
    from automathemely.autoth_tools import argmanager, extratools, envspecific, updsuntimes
  File "/usr/lib/python3.8/site-packages/automathemely/autoth_tools/updsuntimes.py", line 8, in <module>
    from astral import Location
ImportError: cannot import name 'Location' from 'astral' (/usr/lib/python3.8/site-packages/astral/__init__.py)

Previous PR https://github.com/C2N14/AutomaThemely/pull/35 was made in error. This is my first time opening a PR so I'm hoping everything is correct now.

ransomts commented 4 years ago

I had the same problem and this fixed it, thanks :+1:

akirataguchi115 commented 3 years ago

This fixed mine too @C2N14 bls merge?