Repository navigation
TST: exclude packages newer than a week old from resolution - #19527
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
bed8010 to
7148caa
Compare
7148caa to
57665b3
Compare
57665b3 to
7a04e61
Compare
|
Apparently the env var isn't overriding the static config properly. This issue seems specific to tox though, and I was able to confirm that uv behaves correctly on its own. |
|
will report to tox-uv later today or tomorrow. |
|
So, I tried (but failed) to reproduce the problem in a minimal project
[project]
name = "test"
version = "0.1.0"
requires-python = ">=3.14"
dependencies = [
# inifix is a tiny, 0-deps package of mine.
# 6.1.1 is almost a year old but 6.1.2 was published a couple days ago
"inifix>=6.1.1",
]
[tool.uv]
exclude-newer = "1 week"
[tox]
envlist =
py314,-pre
requires =
tox-uv
[testenv]
setenv =
pre: UV_EXCLUDE_NEWER = 0day # allow latest versions with no cooldown period. Also a security pun.
commands =
{list_dependencies_command}abridged logs I got |
|
some progress on this: it looks like tox isn't invalidating its own cache on edits to |
|
yes we are: #18835 (I forgot the specifics of this PR) |
|
except... that's not the whole story yet. The failing job is running on Circle CI, whose config wasn't updated in #18835 |
|
... and I don't think we're caching any dependency on this service. |
|
(still, I reported tox-dev/tox#3917 to clear the air) |
|
Keeping an eye out for astral-sh/uv#18839 |
97f7ee2 to
5ad8cf4
Compare
|
This is working as expected now. I would have prefered defining a global |
| clocale: LC_ALL = C | ||
| devdeps: UV_INDEX = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
| mpldev: UV_INDEX = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
| !devdeps-!mpldev-!predeps-!devpytest: UV_EXCLUDE_NEWER = 1 week |
There was a problem hiding this comment.
I am not sure about
- the dash on LHS, and
- the whitespace in "1 week"
How do we know it is working?
There was a problem hiding this comment.
the dash on LHS
I picked it up from somewhere else on our tox.ini
the whitespace in "1 week"
I checked earlier that this works as expected but I could also spell it as "1week", or "P1W", or "P7D". Any preference ?
How do we know it is working?
We could insert a uv tree --all-groups --outdated in the test commands. This would highlight any installed package that is not at current latest version. Just seeing that there are some is a strong indication that this works as intended, but you could also scrutinize some more and check how old each skipped latest version actually is...
There was a problem hiding this comment.
dash vs comma: In this section (setenv), I only see commas being used on main. Is there a difference?
There was a problem hiding this comment.
"1week", or "P1W", or "P7D". Any preference ?
I prefer something that is officially documented, which I cannot find in the sparse description of https://docs.astral.sh/uv/reference/environment/#uv_exclude_newer
There was a problem hiding this comment.
There was a problem hiding this comment.
The examples have quotes but the diff does not... 🤔
There was a problem hiding this comment.
That would be the difference between TOML (used in uv's docs) and tox.ini
There was a problem hiding this comment.
dash vs comma: In this section (setenv), I only see commas being used on main. Is there a difference?
there's an example of this in commands: !cov-!double:
And empirically, IIRC, the difference is that, if I remove the dash, tox just ignores my setting entirely
|
If we ignore the cooldown for devdeps anyway, what are we really guarding against here? |
|
Malicious releases installing on any other job. |
|
But if it is malicious and already have access to devdeps job, does it matter? |
|
It's still incremental progress. I can tighten the screw some more later on by defining a whitelist of trusted packages (numpy, scipy, matplotlib ...) that we actually want to use nightlies of, which will remove the risk from other (direct or otherwise) dependencies. |
Should that be part of this PR? |
There was a problem hiding this comment.
I think this is sensible. It should reduce noise from buggy new releases but is still much less than our release timescale, so we should see all incoming changes.
I didn't know this was a thing and now I need to go update a bajillion of my own packages.
I'm approving on the idea alone. I'm happy for @pllim and infra team maintainers to make the actual final decision.
|
There is an "upstream action required" label. Is this blocked by something else? |
My hope was to get this one merged quickly so we'd get half the benefit immediately. As it stands I would still prefer to defer the fine tuning to a follow PR.
Sorry for dropping the ball here. I should have linked to my upstream report: |
6aaeff9 to
b44f02f
Compare
|
Given @nstarman's approval and since there's nothing blocking now, I'll merge this and will open a follow up PR to tentatively refine tuning on devdeps. |
b44f02f to
b7fad7d
Compare
|
follow up: while there are options to create a white list of packages as I suggested earlier, I think I'm seeing a better solution and proposed it upstream astral-sh/uv#19749 |
|
turns out the feature I proposed already exists: 🤦🏻♂️ + 🎉 the follow up PR is at #19886 |
Description
Only allow packages to get in regular CI jobs after a cooldown period of a week, which should be more than enough time for upstream to address breaches in the style of llmlite.