Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2022 10:51:35 +1000
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        "Alex V. Petrov" <alexvpetrov@gmail.com>
Cc:        ports@FreeBSD.org, FreeBSD Python Team <freebsd-python@FreeBSD.org>
Subject:   Re: FreeBSD Port: py38-openpyxl-2.6.4
Message-ID:  <6839d47a-3126-06b9-9cea-ff25ba62ad7f@FreeBSD.org>
In-Reply-To: <3881255b-ca3b-3624-ef98-d31d4f7749c3@gmail.com>
References:  <c87aa2ca-d101-c425-4942-1ac4a64feb3a@gmail.com> <e86a8335-2cbf-0d88-470c-e38333619d42@FreeBSD.org> <3881255b-ca3b-3624-ef98-d31d4f7749c3@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/05/2022 9:59 am, Alex V. Petrov wrote:
> 05.05.2022 06:48, Kubilay Kocak пишет:
>> On 5/05/2022 3:09 am, Alex V. Petrov wrote:
>>> Very old version in ports.
>>>
>>> I have error with pandas:
>>> ImportError: Pandas requires version '3.0.0' or newer of 'openpyxl' 
>>> (version '2.6.4' currently installed).
>>>
>>
>> Alex,
>>
>> Upstream  does not declare/register a dependency (required or 
>> optional) on openpyxl in setup.py/setup.cfg/etc but tests for it 
>> (3.0.0) within their 'compat' module [1] via upstream issue #39603 [2] 
>> added in the following commit:
>>
>> https://github.com/pandas-dev/pandas/commit/d5d43e0fa930f9bc96e3dcabf6eeb880c4fc6637
>>
>> Notably openpyxl is listed within Optional Dependencies, describe as:
>>
>> "If the optional dependency is not installed, pandas will raise an 
>> ImportError when the method requiring that dependency is called."
>>
>> This appears to be intentional error/messaging used to communicate to 
>> pandas users that the method being used requires an optional 
>> dependency, that is currently not available/installed, rather than a 
>> port/package bug.
>>
>> A better UX for ports users would be to add OPTIONS that map to the 
>> categories of additional functionality, depending on the relevant 
>> optional dependencies. Example:
>>
>>  - HDF depending on pytables
>>  - XLSX Support depending on openpyxl
>>  - etc ...
>>
>>
>> [1] 
>> https://github.com/pandas-dev/pandas/blob/v1.3.5/pandas/compat/_optional.py#L22
>> [2] https://github.com/pandas-dev/pandas/issues/39603
> 
> Before march, pandas perfectly worked with "xlsx" files.
> 
> 

This is a by-product of upstream bumping the required version to 3.0.0, 
and doesn't change/affect the above analysis.

Of course, the openpyxl port should be updated, but this is orthogonal 
to the error message being intentional, and not a ports bug.

Please feel free to create a Bugzilla issue requesting an update



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6839d47a-3126-06b9-9cea-ff25ba62ad7f>