Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_classes_modifying_slot #254

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Fix get_classes_modifying_slot #254

merged 3 commits into from
Mar 17, 2023

Conversation

amc-corey-cox
Copy link
Contributor

Use slot name to check for classes modifying slot.

@amc-corey-cox amc-corey-cox marked this pull request as draft March 7, 2023 00:37
@amc-corey-cox
Copy link
Contributor Author

I almost have this... just need to fix one more thing.

@amc-corey-cox
Copy link
Contributor Author

I updated the poetry.lock file (to what main was using) and fixed the get_classes_modifying_slot function now. I'm still getting a test failure on my system and we have this failure here. I may need a little help tracking this down; I think we're failing in a file I didn't touch.

@amc-corey-cox
Copy link
Contributor Author

amc-corey-cox commented Mar 7, 2023

When I do poetry run pytest in my local linkml-runtime repository, I receive the following error. I get the error whether running a newly pulled main or my current branch:

============================================= test session starts ==============================================
platform linux -- Python 3.10.6, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/corey/Repositories/linkml-runtime
collected 130 items / 1 error

==================================================== ERRORS ====================================================
______________________ ERROR collecting tests/test_processing/test_referencevalidator.py _______________________
ImportError while importing test module '/home/corey/Repositories/linkml-runtime/tests/test_processing/test_referencevalidator.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_processing/test_referencevalidator.py:14: in <module>
    from examples import PermissibleValue
E   ImportError: cannot import name 'PermissibleValue' from 'examples' (/home/corey/.cache/pypoetry/virtualenvs/linkml-runtime-13gtrlfc-py3.10/lib/python3.10/site-packages/examples/__init__.py)
=============================================== warnings summary ===============================================
tests/support/test_environment.py:35
  /home/corey/Repositories/linkml-runtime/tests/support/test_environment.py:35: PytestCollectionWarning: cannot collect test class 'TestEnvironment' because it has a __init__ constructor (from: tests/support/test_environment.py)
    class TestEnvironment:

../../.cache/pypoetry/virtualenvs/linkml-runtime-13gtrlfc-py3.10/lib/python3.10/site-packages/_pytest/compat.py:330
  /home/corey/.cache/pypoetry/virtualenvs/linkml-runtime-13gtrlfc-py3.10/lib/python3.10/site-packages/_pytest/compat.py:330: UserWarning: Code: _pytestfixturefunction is not defined in namespace XSD
    return getattr(object, name, default)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================== short test summary info ============================================
ERROR tests/test_processing/test_referencevalidator.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================= 2 warnings, 1 error in 0.32s =========================================

I don't think this is complaining about anything that I touched but I'm not sure how to solve this. Separately, we're seeing a crash of the windows-latest test environment and I'm not clear why it is failing. I tried a rebase on linkml-runtime main and it says I'm up-to-date. Let me know what you think.

@amc-corey-cox amc-corey-cox marked this pull request as ready for review March 7, 2023 22:15
@cmungall
Copy link
Member

@pkalita-lbl @dalito any ideas?

@pkalita-lbl
Copy link
Contributor

I tried just checking out the repo and doing a poetry install on my Windows test VM. But I'm not able to reproduce the error that's happening on the Windows action runners. This issue seems to imply it's a Poetry 1.4.0 issue, although I have Poetry 1.4.0 on my VM and, again, no issue there. I'll try reading that issue more closely tomorrow and see if it offers anything useful to try.

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Merging #254 (862e760) into main (b992fe0) will increase coverage by 0.37%.
The diff coverage is 62.58%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #254      +/-   ##
==========================================
+ Coverage   63.54%   63.91%   +0.37%     
==========================================
  Files          53       53              
  Lines        6117     6236     +119     
  Branches     1650     1692      +42     
==========================================
+ Hits         3887     3986      +99     
+ Misses       1774     1769       -5     
- Partials      456      481      +25     
Impacted Files Coverage Δ
linkml_runtime/index/object_index.py 88.28% <12.50%> (-3.53%) ⬇️
linkml_runtime/dumpers/rdflib_dumper.py 94.94% <40.00%> (-2.97%) ⬇️
linkml_runtime/utils/context_utils.py 68.33% <50.00%> (-1.85%) ⬇️
linkml_runtime/utils/schemaview.py 83.29% <55.67%> (-3.11%) ⬇️
linkml_runtime/__init__.py 100.00% <100.00%> (ø)
linkml_runtime/utils/namespaces.py 73.37% <100.00%> (+2.48%) ⬆️
linkml_runtime/utils/yamlutils.py 79.44% <100.00%> (+1.29%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pkalita-lbl
Copy link
Contributor

I've pinned the Poetry version to 1.3.2 in the test workflow and that seems to have resolved the Windows test failures. I think it's not a bad practice in general to pin versions of anything used in a build/test/publish workflows in order to make it as reproducible as possible. But we should keep an eye on that issue to see when we might be able to bump the pinned version up to 1.4.x.

@cmungall cmungall merged commit 1b2af2b into main Mar 17, 2023
@sujaypatil96 sujaypatil96 deleted the 1126_slot_modyfying_classes branch March 20, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants