Closed charman closed 4 years ago
Please let me know if you want a unit test or pull request.
@charman, thanks for finding this. The python constants were a recent addition and we must have missed this. A unit test is really what we need, but we haven't made unit tests part of our build process for python yet. If you have some suggestions for adding unit tests to this project, we would love to hear them. In the meantime, I will add the init.py file to the rdf_ontologies directory.
Please feel free to add more suggestions or submit pull requests for features that you've added and think the library/project would benefit from.
@charman, Your solution for this should be 'implemented' now. Take a look when you get a chance and let us know if it works.
@ecurley-nextcentury - I'm confirming that the changes in 618d6ae fixed the problem. Thanks!
Just for reference, I'm installing the code as a dependency by adding this line:
git+https://github.com/NextCenturyCorporation/AIDA-Interchange-Format@develop#subdirectory=python
to my requirements.txt
file and then running pip install -r requirements.txt
.
As for unit tests, does CACI(/NCC) have any institutional preferences for using Travis CI vs. GitHub Actions to run CI tests for code hosted on GitHub? Even if no one is actually writing unit tests, setting up CI to use tox to install the package in a clean virtual environment and pytest to scan for errors would have caught this particular Issue.
Great! Thanks for confirming. We usually do our installation via virtual environments using pip install -e on the python directory.
We don't currently have any institutional preferences, but I've been wondering if Github actions could work for this project. Sadly, I haven't really had the time to look into it. Those are great suggestions and we'll definitely look into them. Thanks!
Closing this issue.
TL;DR version
In the
develop
branch, whensetup.py
is used to install theaida_interchange
package,aida_interchange.rdf_ontologies
is not included in the package because there is no__init__.py
file inpython/aida_interchange/rdf_ontologies/
.Problem
The
setup.py
tool inpython/
uses setuptools.find_packages() to find any (sub)packages. Per the setuptools documentation:Because there is no
python/aida_interchange/rdf_ontologies/__init__.py
file,setup.py
will not include theaida_interchange.rdf_ontologies
package when installingaida_interchange
.The file
aida_interchange/aifutils.py
has an import statement that assumes thataida_interchange.rdf_ontologies
is installed:but if
aida_interchange
is installed viasetup.py
, the above import statement will fail with the exception:Solution
Create an empty
python/aida_interchange/rdf_ontologies/__init__.py
file.