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

Add pyxform version to XForm output, closes #393 #394

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

MartijnR
Copy link
Contributor

@MartijnR MartijnR commented Nov 8, 2019

Please check extra carefully, as I didn't really know what I was doing.

This code assumes each tag has the format 'v'+semantic version, as we've been using so far (except for vv0.88). If you think that may possibly change, I'd be happy to add a few lines to chop off any non numeric starting characters. Or we could not omit any characters (except trimming) and leave it up the data collection clients to do.

@MartijnR
Copy link
Contributor Author

MartijnR commented Nov 8, 2019

Oops. Will try to fix all those failing tests.

@yanokwa
Copy link
Contributor

yanokwa commented Nov 8, 2019

I didn't really know what I was doing.

Don't worry about it. None of us know what we are doing and yet here we are...

@lognaturel
Copy link
Contributor

YEAH! @MartijnR out here writing Python!!

I was hoping this would be really straightforward and get you excited about more pyxform contributions 😉 but hadn't anticipated the test problem. It seems it might be tricky to address because the old style tests do literal comparisons against expected XForm output and the version is dynamic. Darn. I wonder if there's a way to exclude that attribute in the diff? Or maybe it's time to switch those tests over to the new style?

@MartijnR
Copy link
Contributor Author

MartijnR commented Nov 8, 2019

Haha, I was excited initially, indeed!

to address because the old style tests do literal comparisons against expected XForm output and the version is dynamic. Darn. I wonder if there's a way to exclude that attribute in the diff? Or maybe it's time to switch those tests over to the new style?

Exactly what I have finally concluded! Converting to new style tests would seem great. I am trying to remove the attribute from assertXFormEqual atm, but that seems quite a bad solution

@codecov-io
Copy link

codecov-io commented Nov 9, 2019

Codecov Report

Merging #394 into master will decrease coverage by 0.01%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #394      +/-   ##
==========================================
- Coverage   82.58%   82.56%   -0.02%     
==========================================
  Files          23       23              
  Lines        3364     3373       +9     
  Branches      781      782       +1     
==========================================
+ Hits         2778     2785       +7     
- Misses        440      442       +2     
  Partials      146      146
Impacted Files Coverage Δ
pyxform/constants.py 100% <100%> (ø) ⬆️
pyxform/survey.py 90.38% <100%> (+0.04%) ⬆️
pyxform/xls2json.py 77.99% <66.66%> (-0.11%) ⬇️

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 7cce638...8caae06. Read the comment docs.

@yanokwa
Copy link
Contributor

yanokwa commented Dec 20, 2019

I spoke with @tiritea on Slack and he said, "Nothing new from me. I'm good."

@MartijnR I've gone ahead and squashed your commits and added a new commit that replaces pyxform_version with generated_by in the PR. Note that I have a space between pyxform and the version.

@yanokwa yanokwa force-pushed the feature/pyxform-version-output-393 branch from bbeb92c to 5bf9228 Compare December 20, 2019 05:45
@MartijnR
Copy link
Contributor Author

MartijnR commented Dec 20, 2019

Thank you! That saves me from having to fix my python environment which would have probably taken many hours. The space is fine with me.

@@ -1395,6 +1397,12 @@ def get_parameters(raw_parameters, allowed_parameters):
return params


def get_git_describe_tags():
return subprocess.check_output(
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be wrapped in a try/except for the unlikely case that git is not installed on the host machine. I think that in that case we should return something like unknown pyxform version or simply pyxform.

Copy link
Contributor

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Error checking request below but otherwise this looks ready to me.

@yanokwa yanokwa force-pushed the feature/pyxform-version-output-393 branch 2 times, most recently from 53e8705 to 5b303b9 Compare December 20, 2019 21:46
lognaturel
lognaturel previously approved these changes Dec 20, 2019
@yanokwa yanokwa force-pushed the feature/pyxform-version-output-393 branch from 46ae43c to 8caae06 Compare January 8, 2020 04:05
@lognaturel lognaturel merged commit 8b20020 into master Jan 8, 2020
@lognaturel lognaturel deleted the feature/pyxform-version-output-393 branch January 8, 2020 04:21
lognaturel added a commit that referenced this pull request Feb 6, 2020
Remove support for generated-by reverting #394
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.

4 participants