kaiiam / mifc

A minimum information standard checklist formalizing the description of food composition data and related metadata.
MIT License
2 stars 1 forks source link

modified test and renamed example files #12

Closed turbomam closed 3 weeks ago

turbomam commented 3 weeks ago

fixes #9

also includes some commits containing a fresh poetry.lock the project/ files, as an attempt to get the GitHub actions working

I suggest using make all-all which now calls careful-clean instead of clean. That retains src/mifc/datamodel/__init__.py and now the GH actions complete.

kaiiam commented 3 weeks ago

Thanks @turbomam, unfortunately when I run make all-all I get the following error:

poetry run python -m unittest discover
E
======================================================================
ERROR: tests.test_data (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_data
Traceback (most recent call last):
  File "/Users/kai/.pyenv/versions/3.9.2/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/Users/kai/.pyenv/versions/3.9.2/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/Users/kai/Desktop/software/mifc/tests/test_data.py", line 7, in <module>
    from mifc.datamodel.mifc import Container
ModuleNotFoundError: No module named 'mifc'

----------------------------------------------------------------------

Thoughts?

kaiiam commented 3 weeks ago

In my pycharm it says I'm missing requirements from poetry.lock.

image

Prior to make all-all I had run:

poetry shell
poetry add cruft 
poetry update package
cruft check

the last one I got the success message, which I though meant I was good to go but perhaps there's more to the poetry dependency story? Could that be the source of the error? Fixing the message given in pycharm didn't change the result for running make all-all.

for reference:

(mifc-py3.9) (base) kai@Kais-MacBook-Pro:~/Desktop/scratch/mifc$which python
/Users/kai/Library/Caches/pypoetry/virtualenvs/mifc-PjsQ6RVf-py3.9/bin/python
kaiiam commented 3 weeks ago

Ok actually fixing the error as suggested in pycharm actually did seem to solve things. I am able to successfully run make all-all so I'm going to go ahead and merge this. Thank you very much @turbomam for your help with this.

turbomam commented 3 weeks ago

Maybe I made unfair assumptions about your environment management practices:

But PyCharm has to know which Poetry environment you are using. Usually it can tell, or it asks you when you start the project. But its possible for it to have its own Poetry environment that's independent of whatever you're managing form the command line. So approving its suggested imports will solve the immediate problem, but doesn't resolve the possibility of two different environments.