Skip to content
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

Coverage parsing speedup #151

Merged
merged 5 commits into from
Jun 9, 2022
Merged

Conversation

oev81
Copy link
Contributor

@oev81 oev81 commented Jun 3, 2022

No description provided.

@@ -40,6 +39,9 @@ install_requires =
tabulate
ruamel.yaml

[options.package_data]
* = *.jinja2, *.css
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, installing from archive misses the package data files.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gro1m I'm less familiar with this part, any concerns?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oev81 what did you observe? What do you mean by "installing from archive"? Do you mean from a zip file instead of pip install pycobertura? What was your process to get an archive?

Copy link
Contributor

@gro1m gro1m Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gro1m I'm less familiar with this part, any concerns?

This is about data file support.
In this case all jinja2 and css files are included as well and not only the Python files.
Concretely, this means when installing pycobertura, we have also access to the following files in the templates folder:

  • html.jinja2
  • html-delta.jinja2
  • normalize.css

As we have this under control, this should not be a security issue, but rather an improvement. Probably some html rendering did not work properly before in all cases, as include_package_date=True would have required an additional MANIFEST.in file (see also the reference link below).

Data File Support Reference (even if for setup.py instead of setup.cfg, but this analogue): https://setuptools.pypa.io/en/latest/userguide/datafiles.html

Hope this is clearer now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aconrad
You can install package directly from github as an archive

pip install https://github.com/oev81/pycobertura/archive/coverage_parsing_speedup.zip

or put

https://github.com/oev81/pycobertura/archive/coverage_parsing_speedup.zip

in requirements.txt

This way is very helpful for me. https://stackoverflow.com/a/24811490

@gro1m
Copy link
Contributor

gro1m commented Jun 3, 2022

@aconrad Could you please review? This looks helpful...

@aconrad aconrad self-requested a review June 3, 2022 22:44
Copy link
Owner

@aconrad aconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you for your contribution @oev81!

The black command is failing, I made a change so the console output can tell us what's wrong instead of just failing without further information. #152

@aconrad
Copy link
Owner

aconrad commented Jun 3, 2022

Can you pull the latest master into your branch so we can see what the black issue is?

@aconrad
Copy link
Owner

aconrad commented Jun 3, 2022

Can you also update the CHANGES file with a note about the fix? Feel free to tag yourself (see other entries as an example)

@@ -20,6 +20,9 @@
* Replace Travis-ci with Github Actions. We were having issues with Travis
pipeline not triggering because of quota issues.

* Changes in Cobertura class. All `"./packages//class"` elements extracted at once now, and this leads to significant speedup.
* Changes in setup.cfg related to package data. Remove `include_package_data=True`, because it requires `MANIFEST.in` and add `[options.package_data]` instead. This change makes the package installing from archive not miss `*.css` and `*.jinja2` files.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some pretty sweet changelog, thank you for doing that!

@aconrad aconrad merged commit 4079577 into aconrad:master Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants