Skip to content

0.11.* coverage plugin causes issues during build deleting sys modules #211

@MirkoRossini

Description

@MirkoRossini

Hello,

I think the new coverage plugin should be refactored, as it's a potential source of problems.
Looks like it's deleting a bunch of global modules, sparing only the ones that it consider "essential".
We have a custom python installation, the coverage plugin gets a bit confused and considers non essential things like datetime. We end up with errors like:

Traceback (most recent call last):
File "/tmp/test/env-infra/bin/pyb", line 25, in
sys.exit(pybuilder.cli.main(*sys.argv[1:]))
File "/tmp/test/env-infra/lib/python2.7/site-packages/pybuilder/cli.py", line 366, in main
end = datetime.datetime.now()
AttributeError: 'module' object has no attribute 'datetime'

Because of this issue we are unable to update to 0.11.1
I know there should be a way to fix on our side by reverse-engineering your code and put modules in strategic locations, but honestly nothing in pybuilder (nothing in anything IMHO) should play with sys.modules, as it will cause issues that are a nightmare to debug.

Downgrading to 0.10.63 fixes the issue obviously, but the install task would be nice to have for our purposes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions