Details
- Reviewers
olasd - Group Reviewers
Reviewers - Commits
- rDMOD85ca7d784800: model: use attrs_static to enforce type validation of model objects
Diff Detail
- Repository
- rDMOD Data model
- Branch
- wip
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 11098 Build 16731: tox-on-jenkins Jenkins Build 16730: arc lint + arc unit
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/214/ for more details.
I don't hate the idea (although we're missing a Debian package for this). I've suggested a few changes.
I don't understand the "runtime validation" comment in the diff description. AFAIK validators from attrs _are_ indeed run when the objects are instantiated (and the documentation seems to back me up).
mypy.ini | ||
---|---|---|
4 | looks like something that doesn't exist (yet?) | |
swh/model/model.py | ||
37 | Can we get a proper name for this function? something like attrib_typecheck would be way more sensible. It'd also be nice to support extra validators to be passed as arguments (though I guess our current attributes with validators are already stricter than a plain typecheck). If we do that then we can have all our attributes use this consistently, I guess. |
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tox/216/
See console output for more information: https://jenkins.softwareheritage.org/job/DMOD/job/tox/216/console
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tox/217/
See console output for more information: https://jenkins.softwareheritage.org/job/DMOD/job/tox/217/console
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/220/ for more details.
get rid of the attrib_typecheck() decorator to prevent the need for a mypy plugin
which would then have required to modify the mypy.ini file in every other swh
package.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/225/ for more details.
Build is green
Patch application report for D2819 (id=10440)
Rebasing onto e9a4c7519e...
Current branch diff-target is up to date.
Changes applied before test
commit 85ca7d7848008951f2e26c55c1c72ed9fa92cefb Author: David Douard <david.douard@sdfa3.org> Date: Fri Mar 20 12:59:56 2020 +0100 model: use attrs_static to enforce type validation of model objects This ensures all instanciated model entities have valid types for attributes. Related to T2308.
See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/18/ for more details.