-
Notifications
You must be signed in to change notification settings - Fork 337
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
rez-test breaks with packages that do not have a timestamp attribute #1237
Comments
Cheers Brent I'll track this down thx.
A
…On Tue, Mar 1, 2022 at 9:51 AM brentVilla ***@***.***> wrote:
I ran rez-test with rez-2.103.4 and I got this error:
Traceback (most recent call last):
File "/rel/third_party/rez///2.103.4/bin/rez/rez-test", line 8, in <module>
sys.exit(run_rez_test())
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 257, in run_rez_test
return run("test")
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 202, in run
returncode = run_cmd()
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 194, in run_cmd
return func(opts, opts.parser, extra_arg_groups)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/test.py", line 121, in command
ret = runner.run_test(test_name)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 283, in run_test
target_variants = self._get_target_variants(test_name)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 641, in _get_target_variants
context = self._get_context(requires, quiet=True)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 607, in _get_context
**self.context_kwargs
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolved_context.py", line 325, in __init__
resolver.solve()
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/utils/memcached.py", line 282, in wrapper
return func(*nargs, **kwargs)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 134, in solve
solver = self._solve()
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 418, in _solve
print_stats=self.print_stats)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2006, in __init__
phase = _ResolvePhase(solver=self)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 1254, in __init__
scope = _PackageScope(package_request, solver=solver)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 987, in __init__
package_request.name, package_request.range)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2369, in _get_variant_slice
package_name=package_name, range_=range_)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 959, in get_variant_slice
entries = variant_list.get_intersection(range_)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 522, in get_intersection
rule = self.solver.package_filter.excludes(package)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 266, in excludes
rule = f.excludes(package)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 125, in excludes
excl = _match(excludes)
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 117, in _match
if rule.match(package):
File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 528, in match
return (package.timestamp > self.timestamp)
TypeError: '>' not supported between instances of 'NoneType' and 'int'
You will see this error if any of the packages in your rez-test
environment do not have a timestamp attribute in their package.py. You can
reproduce the error with a package.py like this:
name = 'b'
version = '1.0.0'
tests = {
'echo': {
'command' : 'echo hello world',
}
}
*rez-test b* should fail. Add a timestamp attribute into the package.py
and it will pass. I don't know what version of rez this started breaking,
but it was working in 2.88.2 which is our current version before trying to
make the leap to 2.103.4.
—
Reply to this email directly, view it on GitHub
<#1237>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOUSWSKU66Y47SBDHZCTDU5P37HANCNFSM5PSMJTLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi, I'm not convinced this is a regression - the code causing this bug
hasn't changed in a very long time, and there's no difference since
v2.88.2. Is it just that you're using a differently configured
`package_filter` setting now?
In any case the fix looks straightforward - this filter should match any
non-timestamped package, this matches behaviour when `--timestamp` is used
so it's the most intuitive behaviour.
I'll put in a fix for this.
Cheers
A
…On Tue, Mar 1, 2022 at 10:09 AM Allan Johns ***@***.***> wrote:
Cheers Brent I'll track this down thx.
A
On Tue, Mar 1, 2022 at 9:51 AM brentVilla ***@***.***>
wrote:
> I ran rez-test with rez-2.103.4 and I got this error:
>
> Traceback (most recent call last):
> File "/rel/third_party/rez///2.103.4/bin/rez/rez-test", line 8, in <module>
> sys.exit(run_rez_test())
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 257, in run_rez_test
> return run("test")
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 202, in run
> returncode = run_cmd()
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 194, in run_cmd
> return func(opts, opts.parser, extra_arg_groups)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/test.py", line 121, in command
> ret = runner.run_test(test_name)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 283, in run_test
> target_variants = self._get_target_variants(test_name)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 641, in _get_target_variants
> context = self._get_context(requires, quiet=True)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 607, in _get_context
> **self.context_kwargs
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolved_context.py", line 325, in __init__
> resolver.solve()
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/utils/memcached.py", line 282, in wrapper
> return func(*nargs, **kwargs)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 134, in solve
> solver = self._solve()
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 418, in _solve
> print_stats=self.print_stats)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2006, in __init__
> phase = _ResolvePhase(solver=self)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 1254, in __init__
> scope = _PackageScope(package_request, solver=solver)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 987, in __init__
> package_request.name, package_request.range)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2369, in _get_variant_slice
> package_name=package_name, range_=range_)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 959, in get_variant_slice
> entries = variant_list.get_intersection(range_)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 522, in get_intersection
> rule = self.solver.package_filter.excludes(package)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 266, in excludes
> rule = f.excludes(package)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 125, in excludes
> excl = _match(excludes)
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 117, in _match
> if rule.match(package):
> File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 528, in match
> return (package.timestamp > self.timestamp)
> TypeError: '>' not supported between instances of 'NoneType' and 'int'
>
> You will see this error if any of the packages in your rez-test
> environment do not have a timestamp attribute in their package.py. You can
> reproduce the error with a package.py like this:
>
> name = 'b'
> version = '1.0.0'
>
> tests = {
> 'echo': {
> 'command' : 'echo hello world',
> }
> }
>
> *rez-test b* should fail. Add a timestamp attribute into the package.py
> and it will pass. I don't know what version of rez this started breaking,
> but it was working in 2.88.2 which is our current version before trying to
> make the leap to 2.103.4.
>
> —
> Reply to this email directly, view it on GitHub
> <#1237>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAMOUSWSKU66Y47SBDHZCTDU5P37HANCNFSM5PSMJTLA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
@nerdvegas I get the same error when I added fake packages while working with I added fake timestamps to make the error go away :). If you need a repro, let me know and I can make one. |
so this appears to be a python 3 issue. The bug is there in py2 but doesn't present as a bug since None/int comparison is valid in py2. Fix incoming. |
I ran rez-test with rez-2.103.4 and I got this error:
You will see this error if any of the packages in your rez-test environment do not have a timestamp attribute in their package.py. You can reproduce the error with a package.py like this:
rez-test b should fail. Add a timestamp attribute into the package.py and it will pass. I don't know what version of rez this started breaking, but it was working in 2.88.2 which is our current version before trying to make the leap to 2.103.4.
The text was updated successfully, but these errors were encountered: