Closed willu47 closed 11 months ago
On further investigation, I found a hacky solution - you must use an editable install, so the following solves the issue:
$ pip install -e git+https://github.com/openENTRANCE/openentrance.git@main#egg=openentrance
To solve this so that the data structure is installed
using pip, the data component of the openentrance package needs to be contained in the source code directory.
The pyscaffold docs has a good description of this, which enables use of importlib.resources
from importlib.resources import read_text, read_binary
data = read_text('my_package.sub_package', 'data.txt')
FWIW, the “editable“ install is specified in the installation instructions, see https://github.com/openENTRANCE/openentrance/tree/main/openentrance#installation-instructions.
But I understand that this can be easily overlooked and that a “standard pip install” would be preferable…
Yes, but note the above:
Because it is not possible to denote a dependency as required to be installed as editable under a Python package (e.g. in the
install_requires
section ofsetup.cfg
), this means I cannot distribute my package without requiring a manual editable install of the openentrance package.
Ok, now I got it why it's a problem...
How much of a headache is this for you? Or is there some timeline or release date by which you would be really happy if we came up with a better solution?
It's a bit of a pain, but given that it only really causes our small team of 3 people a headache, probably not a priority for now. We can manage with the manual editable install until a fix comes along (or I submit a PR).
Against stumbled over this issue. I think that the newly added countries-module in the nomenclature package serves the needs better than the openentrance utility.
See https://nomenclature-iamc.readthedocs.io/en/stable/api/countries.html for more info.
The dictionary containing region mappings is empty in
openentrance v0.3.dev74+gbe22752
when I use a non-editable install.Because it is not possible to denote a dependency as required to be installed as editable under a Python package (e.g. in the
install_requires
section), this means I cannot distribute my package without requiring a manual editable install of the openentrance package.