XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
77 stars 134 forks source link

Clean up dependencies #558

Closed lindsay-stevens closed 2 years ago

lindsay-stevens commented 2 years ago

As encountered in #548, there are numerous dependencies which should be cleaned up to avoid confusion during development and to ensure pyxform is using up to date dependencies (fixes / security / etc).

Main ideas for this ticket:

  1. setup.py declares 5 dependencies, but it seems like only xlrd and unicodecsv are used by prod code. Usages of formencode are in tests only, so it could move into the dev requirements requirements.in. The unittest2 and functools don't seem to be required anymore for currently supported python 3.7 / 3.8. unicodecsv might be straightforward to replace with stdlib csv, if it's the case that the external package was used only because of python 2 / unicode compatibility.
  2. requirements.pip seems like it may have been generated at one stage then manually updated thereafter. That's my guess since the output format from the latest pip-tools (latest 6.2.0 vs used 3.7.0) is somewhat different. In any case the requirements.in should pin to current versions and regenerate requirements.pip so it's all up to date.
  3. Remove the py2 compatibility conditional imports, i.e. instances of try: import x; except ImportError: import y as x. There's about 10 of these based on a search for ImportError.

Related ideas for separate tickets:

lindsay-stevens commented 2 years ago

@lognaturel please let me know if you have any comments