Closed glatterf42 closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.4%. Comparing base (
583d3e9
) to head (8535525
).
We should include checks for message_ix v3.8.0 (or only use main)
Yes, including both the latest release and main should be our general rule.
and could try using py3.12, too.
Worth a try! I not yet sure if all of the direct dependencies here are compatible with Python 3.12, but we could find out.
Let's see how the 3.12 tests are doing. We might have to re-trigger a check evaluation to get rid of the '3.11-required' checks and update the branch protection rule if we want to keep the 3.12 version.
We might have to re-trigger a check evaluation to get rid of the '3.11-required' checks and update the branch protection rule
I find if I modify the required checks, save settings, and then refresh the PR page, then the new requirements are shown without the need to re-run any jobs.
However it looks like there are several failures, so one option would be to park some notes in an issue to be addressed separately and limit this PR to adding ixmp/message_ix 3.8.0. Or try to also address them in this PR—up to you.
This PR now refines the pytest workflow usage of python-version. A lot of the failures originated from the incompatibility of (ixmp, message_ix) < 3.8.0 with python 3.12 and we are not requiring this compatibility anywhere, so this workflow shouldn't require it either.
@khaeru I'm not sure how to handle the Code Quality issue (which is caused by pint missing library stubs or py.typed markers). Locally, this is the same for me and since pint doesn't support 3.12 officially yet, there might not be much we can do aside from adding it to tool.mypy.overrides
in pyproject.toml until official support is added.
What confuses me, though, is that recent runs of code quality checks on ixmp seem to have installed python 3.12 and successfully run mypy, even though pint is a dependency there, too, and not excluded via pyproject.toml.
lxml-stubs
or types-requests
exists, then use this. This does not install e.g. lxml
or requests
or any of their dependencies.xarray
. This results in the full, actual package being installed in the pre-commit venv used for mypy—thus also all of its dependencies.ixmp[report] @ git+https://github.com/iiasa/ixmp.git@main
. IMHO indirect dependencies are best for pyproject.toml/PyPI, but direct ones are fine for mypy.Thanks for the explanation. If I didn't misunderstand it entirely, f7d54e3 should be exactly the change you suggested. However, this doesn't solve the problem here (and probably won't for message_data, either, since the error message (also for message_data)) reads:
message_data/testing.py:7: error: Skipping analyzing "pint": module is installed, but missing library stubs or py.typed marker [import-untyped]
As far as I can tell, there's now no difference between the failing Code quality run here and e.g. this successful one for ixmp except for the packages being passed to pre-commit's mypy-venv.
[INFO] Initializing environment for local:mypy >= 1.8.0,plotnine,pytest,sdmx1,types-PyYAML,types-tqdm,ixmp @ git+https://github.com/iiasa/ixmp.git@main,message-ix @ git+https://github.com/iiasa/message_ix.git@main.
here vs
[INFO] Initializing environment for local:mypy >= 1.8.0,genno,GitPython,nbclient,pytest,sphinx,xarray.
there. Since it doesn't seem to be missing pint, my guess is that one of the dependencies here (most likely message-ix) depends on pint in a way that just ixmp doesn't require to work.
P.S.: there's also an environment variable called depth
set to 100 for ixmp, but that doesn't seem to affect this workflow.
Okay, so for the last CI check before the force-push, we had: https://github.com/iiasa/message-ix-models/blob/cba07b2e7864ad16bb20367ff7ece11a4629776c/.github/workflows/pytest.yaml#L111 commented out and https://github.com/iiasa/message-ix-models/blob/cba07b2e7864ad16bb20367ff7ece11a4629776c/.pre-commit-config.yaml#L11-L12 appended with ; python -m pip list
at the end of the quotation marks. For some reason, this made the code quality check successful, but it's failing again now.
For some reason, the Codecov action v4 keeps failing in this repository, while it works fine with ixmp and message_ix and I don't remember setting anything up differently between them.
For some reason, the Codecov action v4 keeps failing in this repository, while it works fine with ixmp and message_ix and I don't remember setting anything up differently between them.
At least this seems clear now: I forgot to pass the CODECOV_TOKEN secret to the action. On the other repos, the PR is coming from a fork, which triggers a tokenless upload.
There it is again: adding ; python -m pip list
to the pre-commit-config bash mypy call makes the code quality CI check successful. Let's see if the same happens for message_data.
@khaeru Gotta be honest: I don't understand what's going on here, but the tests are successful here and over at https://github.com/iiasa/message_data/pull/533, so it seems like we can adapt the required-successful checks to check python 3.12 and officially support 3.12 throughout the message stack :)
The publish workflow doesn't run because https://github.com/iiasa/message-ix-models/actions/runs/8433520273 is neither starting (despite the job it's waiting for being finished) nor able to get cancelled. If it's okay with you, @khaeru, I'd change the required checks and merge this, anyway.
Could you please adjust the required statuses in the repo settings? These have different names now with these changes to the workflow. Otherwise good to go.
This PR removes the trigger for CI runs on pushed to main to avoid duplicate test runs. This avoids duplicate runs.
In order for this to work properly, we should make sure that
We might also want to
All of which can be done via the settings -> branches.
For now, we require the py3.11 checks for macos, ubuntu, and windows and message_ix/main to be successful. We should include checks for message_ix v3.8.0 (or only use main) and could try using py3.12, too.
How to review
PR checklist