-
Notifications
You must be signed in to change notification settings - Fork 19
CI: Use uv to test with lowest supported dependency versions #714
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
base: master
Are you sure you want to change the base?
Conversation
…ependency versions
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #714 +/- ##
==========================================
+ Coverage 84.29% 84.31% +0.02%
==========================================
Files 18 18
Lines 3584 3584
==========================================
+ Hits 3021 3022 +1
+ Misses 563 562 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Marking as draft, there are some failing tests... |
This reverts commit 267c240.
cd3a0ae to
0039c15
Compare
| widgetsnbextension<3.6.3 | ||
| pymysql~=0.9 | ||
| nglview~=3.0 | ||
| nglview~=3.0,>=3.0.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier patch versions failed to build on python 3.9: https://github.com/aiidalab/aiidalab-widgets-base/actions/runs/19681981549/job/56377980039
| ansi2html~=1.6 | ||
| ase~=3.18 | ||
| bokeh~=2.0 | ||
| bokeh~=2.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier versions were causing one test to fail with this stack trace:
tests/test_viewers.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
aiidalab_widgets_base/viewers.py:60: in viewer
return _viewer(obj, **kwargs)
aiidalab_widgets_base/viewers.py:1635: in __init__
from bokeh.io import output_notebook, show
.venv/lib/python3.9/site-packages/bokeh/io/__init__.py:23: in <module>
from .export import export_png, export_svgs
.venv/lib/python3.9/site-packages/bokeh/io/export.py:33: in <module>
from ..document import Document
.venv/lib/python3.9/site-packages/bokeh/document/__init__.py:35: in <module>
from .document import DEFAULT_TITLE ; DEFAULT_TITLE
.venv/lib/python3.9/site-packages/bokeh/document/document.py:49: in <module>
from ..core.templates import FILE
> from jinja2 import Environment, FileSystemLoader, Markup
E ImportError: cannot import name 'Markup' from 'jinja2' (/home/runner/work/aiidalab-widgets-base/aiidalab-widgets-base/.venv/lib/python3.9/site-packages/jinja2/__init__.py)
.venv/lib/python3.9/site-packages/bokeh/core/templates.py:42: ImportError| "cif": """ZGF0YV9pbWFnZTAKX2NoZW1pY2FsX2Zvcm11bGFfc3RydWN0dXJhbCAgICAgICBTaTIKX2NoZW1pY2FsX2Zvcm11bGFfc3VtICAgICAgICAgICAgICAiU2kyIgpfY2VsbF9sZW5ndGhfYSAgICAgICAzLjg0NzM3Cl9jZWxsX2xlbmd0aF9iICAgICAgIDMuODQ3MzY5ODYzMzc3NDQ4Cl9jZWxsX2xlbmd0aF9jICAgICAgIDMuODQ3MzY5NjE2OTM1ODM2Cl9jZWxsX2FuZ2xlX2FscGhhICAgIDU5Ljk5OTk5NzA5Nzk3MDEyCl9jZWxsX2FuZ2xlX2JldGEgICAgIDU5Ljk5OTk5NjcwNjQwOTMwNgpfY2VsbF9hbmdsZV9nYW1tYSAgICA1OS45OTk5OTg4MjUzMTc1OQoKX3NwYWNlX2dyb3VwX25hbWVfSC1NX2FsdCAgICAiUCAxIgpfc3BhY2VfZ3JvdXBfSVRfbnVtYmVyICAgICAgIDEKCmxvb3BfCiAgX3NwYWNlX2dyb3VwX3N5bW9wX29wZXJhdGlvbl94eXoKICAneCwgeSwgeicKCmxvb3BfCiAgX2F0b21fc2l0ZV90eXBlX3N5bWJvbAogIF9hdG9tX3NpdGVfbGFiZWwKICBfYXRvbV9zaXRlX3N5bW1ldHJ5X211bHRpcGxpY2l0eQogIF9hdG9tX3NpdGVfZnJhY3RfeAogIF9hdG9tX3NpdGVfZnJhY3RfeQogIF9hdG9tX3NpdGVfZnJhY3RfegogIF9hdG9tX3NpdGVfb2NjdXBhbmN5CiAgU2kgIFNpMSAgICAgICAxLjAgIDAuMCAgMC4wICAwLjAgIDEuMDAwMAogIFNpICBTaTIgICAgICAgMS4wICAwLjI1MDAwMDAwMDAwMDAwMDA2ICAwLjI1ICAwLjI1ICAxLjAwMDAK""", | ||
| } | ||
|
|
||
| # Compatibility with old ASE versions <3.23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #627 (comment)
| bumpver>=2023.1129 | ||
| pgtest~=1.3 | ||
| pre-commit>=3.5 | ||
| pre-commit>=4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this version bump in the end was not needed, but probably doesn't hurt. Happy to revert.
(I still maintain we should not be installing pre-commit into every venv, it should instead be installed globally via pipx or uv tool install)
| install_requires = | ||
| PyCifRW~=4.4 | ||
| aiida-core>=2.1,<3 | ||
| aiida-core>=2.2,<3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the pyyaml build error for Python 3.11: https://github.com/aiidalab/aiidalab-widgets-base/actions/runs/19682431292/job/56379504709
Build error
× Failed to build `pyyaml==5.4.1`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)
[stdout]
running egg_info
writing lib3/PyYAML.egg-info/PKG-INFO
writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
writing top-level names to lib3/PyYAML.egg-info/top_level.txt
[stderr]
/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/dist.py:759:
SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a
SPDX license expression:
License :: OSI Approved :: MIT License
See
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
for details.
********************************************************************************
!!
self._finalize_license_expression()
Traceback (most recent call last):
File "<string>", line 14, in <module>
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/build_meta.py",
line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/build_meta.py",
line 301, in _get_build_requires
self.run_setup()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/build_meta.py",
line 317, in run_setup
exec(code, locals())
File "<string>", line 271, in <module>
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/__init__.py",
line 115, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/core.py",
line 186, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/core.py",
line 202, in run_commands
dist.run_commands()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/dist.py",
line 1002, in run_commands
self.run_command(cmd)
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/dist.py",
line 1102, in run_command
super().run_command(command)
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/dist.py",
line 1021, in run_command
cmd_obj.run()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/command/egg_info.py",
line 312, in run
self.find_sources()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/command/egg_info.py",
line 320, in find_sources
mm.run()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/command/egg_info.py",
line 543, in run
self.add_defaults()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/command/egg_info.py",
line 581, in add_defaults
sdist.add_defaults(self)
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/command/sdist.py",
line 109, in add_defaults
super().add_defaults()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py",
line 245, in add_defaults
self._add_defaults_ext()
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py",
line 330, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 201, in get_source_files
File
"/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpAnDw32/lib/python3.11/site-packages/setuptools/_distutils/cmd.py",
line 131, in __getattr__
raise AttributeError(attr)
AttributeError: cython_sources
hint: This usually indicates a problem with the package or the build
environment.
help: `pyyaml` (v5.4.1) was included because `aiidalab-widgets-base[dev]`
(v2.4.0) depends on `pre-commit` (v4.0.0) which depends on `pyyaml`
Instead of specifying aiida-core version explicitly when running unit tests, we utilize the uv's
--resolutionparameter to tell it whether we want to test we highest or lowest versions of dependencies. This will be helpful for #644 so we can test both ipywidgets 7.x and 8.xSee more details in the corresponding change in aiida-core: aiidateam/aiida-core#6940
To make this work I needed to bump minimum versions of some packages, most notably aiida-core from 2.1 to 2.2 (see comment below why this was necessary). We could do a different workaround, but I think it is fair to drop support for 2.1 at this point. :-) The corresponding
full-stack:aiida-2.1.2image has been published 3 years ago and hopefully nobody is using it.