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

openpyexcel upgrade #117

Merged
merged 6 commits into from
Feb 4, 2019
Merged

openpyexcel upgrade #117

merged 6 commits into from
Feb 4, 2019

Conversation

czue
Copy link
Member

@czue czue commented Jan 23, 2019

this makes it substantially easier to run commcare hq and commcare-export in the same python environment (and generally seems good to upgrade libraries).

@snopoke I tested basic query file reading and writing to an .xlsx file. do you know what else I should be testing or if there are other gotchas you might expect with this change?

EDIT: It looks like at least one change is that Excel 2007+ files are required to have a valid '.xlsx' extension even if they were previously valid files with a different name... Not sure if that's a problem.

@czue czue requested a review from snopoke January 23, 2019 13:20
@czue
Copy link
Member Author

czue commented Jan 23, 2019

(looking at tests)

@@ -70,7 +70,7 @@ def run_tests(self):
'alembic',
'argparse',
'jsonpath-rw>=1.2.1',
'openpyxl<2.1.0',
'openpyxl==2.5.12',
Copy link
Contributor

Choose a reason for hiding this comment

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

this makes it substantially easier to run commcare hq and commcare-export in the same python environment (and generally seems good to upgrade libraries).

Using == will make this much harder as we then need to upgrade both of these libraries.

as an aside: I think its a bad workflow to use the same virtualenv anyways unless we explicitly want to support that and write tests for it or include commcare-export as a dependency in commcare-hq. different projects with different environments is what virtualenv is made for.

Copy link
Member Author

@czue czue Jan 23, 2019

Choose a reason for hiding this comment

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

Using == will make this much harder as we then need to upgrade both of these libraries.

Oops. What's the right thing to do? ~=?

I think its a bad workflow to use the same virtualenv anyways unless we explicitly want to support that and write tests for it or include commcare-export as a dependency in commcare-hq. different projects with different environments is what virtualenv is made for.

Totally agree. I'm working on a project that explicitly needs to run them in the same env and so I'm looking for a reasonable way to do it and this seemed like the approach that made the most sense (can ping you on that PR when it is ready if you want). I'm not planning on making any dependencies explicit since it's a bit of a one-off.

Copy link
Member Author

Choose a reason for hiding this comment

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

my local machine:

$ ls ~/.virtualenvs/ | wc
     41      41     609

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops. What's the right thing to do? ~=?

That's hard to say and its a library by library thing. Generally if you want libraries to work together robustly, you should make them as loose as possible. Judging from https://openpyxl.readthedocs.io/en/2.6/changes.html you may want >=2.1,<3 whatever the minimum version that's required is.

I think the way most libraries test this out is to use tox to create travis builds for each version, so in this example it would test openpyxl 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.

Copy link
Member Author

@czue czue Jan 23, 2019

Choose a reason for hiding this comment

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

Gotcha. Am guessing I can figure out what versions are compatible / incompatible some way and change it. Before I go down that road, I'm just trying to understand what the value proposition of that effort is and make sure it's a good use of time.

Does your comment still apply if we continue to expect people to (mostly) use commcare-export as a standalone tool? I'm not totally sure where the upgrade dependencies/conflicts would arise.

I guess I'm tempted to just change it to >= and call it a day, but maybe I'm missing something.

Edit: I agree with Simon and think that's actually a case for leaving it as-is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. I think that's fine if this is a one-off and does not need to be maintained. Just wanted to make a note that the discrepancy between making two repository's libraries compatible and using ==

@snopoke
Copy link
Contributor

snopoke commented Jan 23, 2019 via email

@snopoke
Copy link
Contributor

snopoke commented Jan 23, 2019 via email

@czue
Copy link
Member Author

czue commented Feb 4, 2019

@snopoke is there anything else you want me to do/test on this or is it ok to merge in? Also, let me know if you'd like me to cut a new release

@snopoke snopoke merged commit c77b4b5 into master Feb 4, 2019
@snopoke snopoke deleted the pyexcel-upgrade branch February 4, 2019 11:02
@snopoke
Copy link
Contributor

snopoke commented Feb 4, 2019

no need to cut a new release unless now unless it makes things easier for you

@czue
Copy link
Member Author

czue commented Feb 4, 2019

nope all good for now, thanks!

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