jannikmi / timezonefinder

python package for finding the timezone of any point on earth (coordinates) offline

Home Page:https://timezonefinder.michelfe.it/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The timezonefinder sdist requires luck to use.

jsirois opened this issue · comments

This is due to setup.py indirectly depending on numpy. At the 5.2.0 tag where I observed the issue this is via:

from timezonefinder.global_settings import PACKAGE_DATA_FILES, PACKAGE_NAME

from timezonefinder.timezonefinder import TimezoneFinder, TimezoneFinderL

from numpy import array, dtype, empty, frombuffer, fromfile

So, although there is a runtime dependency on numpy expressed via install_requires:

install_requires=["numpy>=1.16"],

There is no corresponding setup_requires - which is the best you can do with setup.py (but it tends not to work well which I'm guessing you all know already).

There appears to be awareness of this issue in the repo's publish script here:

required packages
numpy

Unfortunately, those instructions don't help automated build tools like Pip; i.e.: You have to manually make sure numpy is installed in a venv before installing timezonefinder.

This should be fixable for both your internal publish script and end users of the sdist by using the new poetry build setup that is on master and poetry publish after migrating the distribution metadata out of setup.py and into pyproject.toml. From my scan of your setup.py it looks like there are no exotic features used and all configuration has a direct corresponding configuration item supported by Poetry.

I'll take a crack at this change with a PR in case you're interested in doing things that way. I may find out though that its not so simple! We shall see.

Aha, setup.py has been fixed on master to not import from the project and thus indirectly require numpy. It looks like the next published sdist should not have this bug! Sorry for the noise.

Thanks for bringing this up. There will be a release soon. Please reopen this issue if required.