You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I didn't realize you needed to specifically add modules and submodules. I thought everything was added by default and you had to actively exclude modules and/or submodules?
(Keep in mind that although package_dir applies recursively, you must explicitly list all packages in packages: the Distutils will not recursively scan your source tree looking for any directory with an init.py file.)
The reason will be displayed to describe this comment to others. Learn more.
@davidrpugh Just to clarify - If we had written solow as a module (i.e. in files within QuantEcon.py/models/) then it would get added to the installation. The difference here being that QuantEcon.py/models/solow is a directory of python modules and is thus a package.
The reason will be displayed to describe this comment to others. Learn more.
@mmcky I assume this was the reason that the statement from quantecon import solow failed when I upgraded to the new version of quantecon: solow hadn't been installed at all because it wasn't properly included in the setup script. Thanks for the clarification.
The reason will be displayed to describe this comment to others. Learn more.
@davidrpugh Indeed - that is why. The __init__.py files were all setup correctly - but it was just that distutils wasn't packaging the solow code through pip install --upgrade or python setup.py install etc. Thanks for sharing those developer flags for pip - I hadn't come across those before.
4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmcky
I didn't realize you needed to specifically add modules and submodules. I thought everything was added by default and you had to actively exclude modules and/or submodules?
4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidrpugh As far as I understand packages require to be explicitly added
From https://docs.python.org/2/distutils/setupscript.html
Thus models.solow is really another
package
.4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidrpugh Just to clarify - If we had written
solow
as amodule
(i.e. in files withinQuantEcon.py/models/
) then it would get added to the installation. The difference here being thatQuantEcon.py/models/solow
is a directory of python modules and is thus apackage
.4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmcky I assume this was the reason that the statement
from quantecon import solow
failed when I upgraded to the new version ofquantecon
:solow
hadn't been installed at all because it wasn't properly included in the setup script. Thanks for the clarification.4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmcky Nice work. We were all looking in the wrong place, but great work.
4ec8120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidrpugh Indeed - that is why. The
__init__.py
files were all setup correctly - but it was just that distutils wasn't packaging the solow code throughpip install --upgrade
orpython setup.py install
etc. Thanks for sharing those developer flags for pip - I hadn't come across those before.Thanks @cc7768.