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

Codecov and flake8 fix #99

Merged
merged 12 commits into from
Aug 27, 2021
Merged

Codecov and flake8 fix #99

merged 12 commits into from
Aug 27, 2021

Conversation

ewu63
Copy link
Collaborator

@ewu63 ewu63 commented Aug 25, 2021

Purpose

This PR updates the codecov setup to not install/test in place. This is important since setup.py mistakes could be undetected when installing in place (see #97). As a result of that, this PR will fail until those changes are merged into master and subsequently into this branch (which will verify that these changes are working).

For a bit of background on what's going on, let's talk about two things.
First, Python package imports: sys.path will contain the current directory, meaning that even if you installed a package into site-packages, if you run testflo from the root it will attempt to use the local version instead. This is the reason why installing with -e worked without path fixing (see below), which confused me a lot. I'm sure this can be adjusted from the testflo side but I feel there is no elegant solution there. Instead, in this PR the tests are run once we cd into the tests directory.

Secondly, path fixing in codecov. testflo uses coverage.py to provide the coverage report, which contains the full path of all the files in the package. In order to make the paths shorter and more readable, codecov provides a mechanism to essentially search and replace these file paths. Previously we had one line in codecov.yml* to get rid of the Docker paths, and now I've added a second line to replace the site-packages paths to shorten everything. This should allow a seamless transition to using pip install .

*: we actually don't use this file because they do not support using them this way. Instead, their web UI allows specifying "Team YAML" config which is shared, and I have been maintaining both just so others know what our YAML file looks like.

Type of change

What types of change is it?
Select the appropriate type(s) that describe this PR

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

@ewu63 ewu63 requested a review from a team as a code owner August 25, 2021 22:45
@ewu63 ewu63 mentioned this pull request Aug 25, 2021
8 tasks
@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #99 (c81069e) into master (92d336a) will decrease coverage by 0.07%.
The diff coverage is 32.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   51.19%   51.12%   -0.08%     
==========================================
  Files          40       40              
  Lines        9586     9608      +22     
==========================================
+ Hits         4908     4912       +4     
- Misses       4678     4696      +18     
Impacted Files Coverage Δ
pygeo/geo_utils/bilinear_map.py 8.57% <0.00%> (-0.52%) ⬇️
pygeo/geo_utils/dcel.py 11.37% <0.00%> (ø)
pygeo/geo_utils/pointselect.py 7.14% <0.00%> (-0.27%) ⬇️
pygeo/geo_utils/split_quad.py 7.31% <0.00%> (-0.13%) ⬇️
pygeo/parameterization/DVGeoESP.py 65.48% <ø> (ø)
pygeo/parameterization/DVGeoVSP.py 81.02% <ø> (ø)
pygeo/pyGeo.py 3.93% <0.00%> (ø)
pygeo/topology.py 38.55% <18.75%> (-0.22%) ⬇️
pygeo/geo_utils/node_edge_face.py 43.26% <50.00%> (ø)
pygeo/parameterization/DVGeoAxi.py 77.21% <63.63%> (-3.35%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92d336a...c81069e. Read the comment docs.

@marcomangano
Copy link
Contributor

Secondly, path fixing in codecov. testflo uses coverage.py to provide the coverage report, which contains the full path of all the files in the package. In order to make the paths shorter and more readable, codecov provides a mechanism to essentially search and replace these file paths. Previously we had one line in codecov.yml* to get rid of the Docker paths, and now I've added a second line to replace the site-packages paths to shorten everything. This should allow a seamless transition to using pip install .

Nice stuff, let me just add this link to codecov path fixing docs for further information - I was missing the key step that the paths stored in converage.py (which will be container specific) must match the git repo structure.

marcomangano
marcomangano previously approved these changes Aug 26, 2021
@ewu63 ewu63 changed the title Codecov fix Codecov and flake8 fix Aug 26, 2021
@ewu63
Copy link
Collaborator Author

ewu63 commented Aug 27, 2021

Okay this should be all the flake8 fixes. There were some keyword arguments which were overshadowing builtins, such that changing them would break backwards compatibility. This is how I handled them:

  • for the complex keyword, I renamed it isComplex but preserved backwards compatibility by using the **kwargs to still allow complex. This is checked and if supplied, we also raise a DeprecationWarning.
  • there was one instance of format= being used, however I don't see anywhere in our code that actually use this argument (and the docstrings is missing) so I just went ahead and renamed it. This is a backwards incompatible change.

@ewu63 ewu63 requested a review from sseraj August 27, 2021 03:17
Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

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

I need to start using _i for "inactive" counters as well

@ewu63 ewu63 merged commit 9eff5c0 into master Aug 27, 2021
@ewu63 ewu63 deleted the update-codecov branch August 27, 2021 15:02
@ewu63 ewu63 mentioned this pull request Aug 30, 2021
12 tasks
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