astrofrog/pieceofcake

Problem importing pieceofcake.version when using development version

Closed this issue · 2 comments

I ran into a problem when doing a local pip install of pieceofcake of a clone of the GitHub repository, which I mentioned in #1. I tried:

cd /location/of/pieceofcake_repo
pip install .

That command seemed to work, but I ran into a problem when I ran:

>>> import pieceofcacke
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/namurphy/Projects/pieceofcake/pieceofcake/__init__.py", line 1, in <module>
    from .version import version as __version__
ModuleNotFoundError: No module named 'pieceofcake.version'

I did not get this problem when trying to import version 0.1 which I installed from pip install pieceofcake.

This could perhaps be resolved by doing a try/except on the import statement, and otherwise setting a default for the version number that indicates it's a development version.

Oops yes the issue was a missing pyproject.toml file, I've added it in 74d22cd. Can you try again?

Oops yes the issue was a missing pyproject.toml file, I've added it in 74d22cd. Can you try again?

Yep, that worked. Thank you!