davidverweij / csv2docx

Generates .docx files from .csv files using a .docx template with mailmerge fields
MIT License
5 stars 0 forks source link

Doulbe-check Python 2.7 dependency for MacOS and docx-mailmerge's lxml dependency #6

Closed davidverweij closed 4 years ago

davidverweij commented 4 years ago

This project started with the need for a MacPort of the lxml dependency, though we have now upgraded to Python 3.8. I need to test whether this dependency is still there, and how to incorporate this in the poetry install.

davidverweij commented 4 years ago

See this related StackOverflow Question

davidverweij commented 4 years ago

I uninstalled the MacPort of lxml (py27-lxml) (see https://lxml.de/installation.html) and the code still runs. I am assuming it operates on one of the more updated lxml packages.

After renaming the repo and running

poetry install

it indicated lxml was installed:

`Package operations: 3 installs, 0 updates, 0 removals

@jawrainey , is this due to the dependency in poetry.lock, or a subdependency in docx-mailmerge?

jawrainey commented 4 years ago

@jawrainey is this due to the dependency in poetry.lock, or a subdependency in docx-mailmerge?

Yes, and I think the issue you had was likely due to incompatible versions between packages or some weird setup, which is typical and further motivates our use of poetry 👍

For reference, docx-mailmerge depends on lxml as you noted above. Poetry: (i) assigns lxml as a subdepdency; and (ii) chooses the highest version to use based on docx-mailmerge version (i.e. 4.5).

Interestingly, poetry by default will add all platform versions of a subdepdency to its lock file (i.e. OSX/Windows/Linux), which makes me confident that our move to poetry will make running csv2docx a success on windows. I've verified that csv2docx works on Ubuntu 18.04 with python 3.8.2 👍