IDAES/idaes-pse

pip install places docs folder in wrong location on windows

Closed this issue · 1 comments

A fresh install of idaes-pse on windows places the idaes docs in the wrong directory (i.e. not in the idaes folder):

conda  create -y -n new_idaes_env python=3.11
conda activate new_idaes_env
pip install idaes-pse
ls ~\miniconda3\envs\new_idaes_env\Lib\site-packages\docs

The folder is at least a level up from where it should be, i.e.
ls ~\miniconda3\envs\new_idaes_env\Lib\site-packages\idaes\docs

@OOAmusat thanks for spotting this. I think the docs directory shouldn't be installed at all for a standard (non-dev, non-editable) installation.

However, this currently happens because we're using find_namespace_packages() (that will consider any directory, including those without a __init__.py file, as a package) in setup.py without a top-level intermediate src/ directory, even though we don't really have a reason for this (i.e. we don't actually have any namespace package to install in this repository).

The fix would either or both of:

  1. Switch to find_packages() in setup.py
  2. Switch to a src/-based directory layout for this repository

(2) would be preferable, but also more disruptive. We should probably do (1) although there is a small chance of this causing breaking changes, e.g. data files in directories without a __init__.py won't be available for standard installations. However, we have CI checks to catch this, so I think I'll try to open a PR and see what happens.