Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2022 09:48:29 +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:  <e86a8335-2cbf-0d88-470c-e38333619d42@FreeBSD.org>
In-Reply-To: <c87aa2ca-d101-c425-4942-1ac4a64feb3a@gmail.com>
References:  <c87aa2ca-d101-c425-4942-1ac4a64feb3a@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e86a8335-2cbf-0d88-470c-e38333619d42>