Closed turbomam closed 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?
In my pycharm it says I'm missing requirements from poetry.lock.
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
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.
Maybe I made unfair assumptions about your environment management practices:
poetry install
as soon as you start your project, and on any additional computers if you start using them for the project.poetry update
where there are new versions of the dependencies that you think will benefit your projectpoetry install
any time there are changes to the schema which will results in changes to the mifc.py
file. I don' think it hurts to do it on a regular basis, especially if your IDE says that it can't be found.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.
fixes #9
also includes some commits containing a fresh
poetry.lock
theproject/
files, as an attempt to get the GitHub actions workingI suggest using
make all-all
which now callscareful-clean
instead ofclean
. That retainssrc/mifc/datamodel/__init__.py
and now the GH actions complete.