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

Pinning for ops-scenario should be explicit #1550

Closed
morphis opened this issue Jan 30, 2025 · 6 comments
Closed

Pinning for ops-scenario should be explicit #1550

morphis opened this issue Jan 30, 2025 · 6 comments

Comments

@morphis
Copy link

morphis commented Jan 30, 2025

Hey all!

Starting a few hours ago we see the following in our CI now that ops-scenario 7.1.0 is released

unit create: /home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/.tox/unit
unit installdeps: -r/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/requirements.txt, ops[testing]==2.17.1, pytest==8.3.4, coverage[toml]==6.5.0
unit installed: annotated-types==0.7.0,attrs==25.1.0,certifi==2024.12.14,cffi==1.17.1,charset-normalizer==3.4.1,coverage==6.5.0,cryptography==44.0.0,Deprecated==1.2.18,exceptiongroup==1.2.2,googleapis-common-protos==1.66.0,idna==3.10,importlib_metadata==8.5.0,iniconfig==2.0.0,jsonschema==4.23.0,jsonschema-specifications==2024.10.1,opentelemetry-api==1.29.0,opentelemetry-exporter-otlp-proto-common==1.29.0,opentelemetry-exporter-otlp-proto-http==1.29.0,opentelemetry-proto==1.29.0,opentelemetry-sdk==1.29.0,opentelemetry-semantic-conventions==0.50b0,ops==2.17.1,ops-scenario==7.1.0,packaging==24.2,pluggy==1.5.0,protobuf==5.29.3,pycparser==2.22,pydantic==2.10.5,pydantic_core==2.27.2,pytest==8.3.4,PyYAML==6.0.2,referencing==0.36.2,requests==2.32.3,rpds-py==0.22.3,six==1.17.0,tomli==2.2.1,typing_extensions==4.12.2,urllib3==2.3.0,websocket-client==1.8.0,wrapt==1.17.2,zipp==3.21.0
unit run-test-pre: PYTHONHASHSEED='3886596491'
unit run-test: commands[0] | coverage run --source=/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/src/ -m pytest --ignore=/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/tests/integration --tb native -v -s
===================================================================== test session starts =====================================================================
platform linux -- Python 3.10.12, pytest-8.3.4, pluggy-1.5.0 -- /home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/.tox/unit/bin/python
cachedir: .tox/unit/.pytest_cache
rootdir: /home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard
collected 0 items / 1 error                                                                                                                                   

=========================================================================== ERRORS ============================================================================
__________________________________________________________ ERROR collecting tests/unit/test_charm.py __________________________________________________________
ImportError while importing test module '/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/tests/unit/test_charm.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/unit/test_charm.py:8: in <module>
    from ops.testing import State, Context, Resource, ActionFailed, Harness
.tox/unit/lib/python3.10/site-packages/ops/testing.py:181: in <module>
    import scenario.runtime as _runtime
E   ModuleNotFoundError: No module named 'scenario.runtime'
=================================================================== short test summary info ===================================================================
ERROR tests/unit/test_charm.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================== 1 error in 0.69s =======================================================================
ERROR: InvocationError for command /home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/.tox/unit/bin/coverage run --source=/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/src/ -m pytest --ignore=/home/simon/Work/anbox-cloud-charms/charms/anbox-cloud-dashboard/tests/integration --tb native -v -s (exited with code 2)
___________________________________________________________________________ summary ___________________________________________________________________________
ERROR:   unit: commands failed

The underlying reason for this seems to be that ops-scenario is not explicitly pinned but set to "ops-scenario>=7.0.5,<8", which is then causing us to pull 7.1.0 when we set ops[testing]==2.17.1.

Can we set an explicit version for ops-scenario or better avoid breaking changes in minor versions? :-)

@morphis
Copy link
Author

morphis commented Jan 30, 2025

Also there seems to be no 7.1.0 tag on https://github.com/canonical/ops-scenario, last is 7.0.4 from September 2024. If this no longer the correct upstream for ops-scenario, can that repository be archived to avoid misunderstandings?

@tonyandrewmeyer
Copy link
Contributor

Also there seems to be no 7.1.0 tag on https://github.com/canonical/ops-scenario, last is 7.0.4 from September 2024. If this no longer the correct upstream for ops-scenario, can that repository be archived to avoid misunderstandings?

That is not the correct upstream, this repository is (you can find the link on PyPI). @PietroPasotti is taking care of archiving it.

@morphis
Copy link
Author

morphis commented Jan 30, 2025

Thanks @tonyandrewmeyer :-)

I was just going to github.com/canonical/ops-scenario straight away as that is what I guessed where the upstream is (at least I've seen it before). I haven't checked the repository linked on PyPI. If that one is correct, that is fine but we should still archive the other one to avoid any one else being confused. Thanks for pinging @PietroPasotti on this!

@tonyandrewmeyer
Copy link
Contributor

The underlying reason for this seems to be that ops-scenario is not explicitly pinned but set to "ops-scenario>=7.0.5,<8", which is then causing us to pull 7.1.0 when we set ops[testing]==2.17.1.

Sorry, I missed this. We fixed it the other way around (updating ops, not updating ops-scenario) but missed it in this direction.

I'll talk to the team about whether we want to do a .1 release on either/both the packages to avoid this, or whether it's a bit late now and we just need to do it better next time and have everyone update both to compatible versions.

Can we set an explicit version for ops-scenario or better avoid breaking changes in minor versions? :-)

We do not want to do that. It causes other problems where there are other packages that have ops-scenario pinned to a specific version, and then that prevents using a newer version of ops.

However, we certainly do need to make sure that the ops-scenario optional dependency listed in ops only lists compatible versions, and the ops dependency in ops-scenario likewise only has compatible versions. We're planning on adding matrix testing to be sure of this, but haven't managed to do that yet.

@dimaqq
Copy link
Contributor

dimaqq commented Jan 30, 2025

We can yank todays ops-scenario as a stop-gap

In fact the ops-scenario 7.1.1 could be as simple as requiring stricter version of ops.

I have a PR in #1551

@dimaqq
Copy link
Contributor

dimaqq commented Feb 1, 2025

Done!

P.S. thank you for a prompt bug report!

@dimaqq dimaqq closed this as completed Feb 1, 2025
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

No branches or pull requests

3 participants