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:
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.
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.
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:
xlrd is pinned to an old version 1.2.0 but this seems to be because afterwards, support for .xslx was removed and users were encouraged to use openpyxl for that format instead. So it would likely involve adding a dependency, and code to detect / swap library depending on input format (either by file name or some fancy detection).
formencode is pulled in just for it's xml_compare function in the older tests package. The function is a pretty neat structural comparison but the dependent tests could probably be refactored to use tests_v1 style PyxformTestCase, meaning that the dependency could be removed altogether.
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:
setup.py
declares 5 dependencies, but it seems like onlyxlrd
andunicodecsv
are used by prod code. Usages offormencode
are in tests only, so it could move into the dev requirementsrequirements.in
. Theunittest2
andfunctools
don't seem to be required anymore for currently supported python 3.7 / 3.8.unicodecsv
might be straightforward to replace with stdlibcsv
, if it's the case that the external package was used only because of python 2 / unicode compatibility.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 latestpip-tools
(latest 6.2.0 vs used 3.7.0) is somewhat different. In any case therequirements.in
should pin to current versions and regeneraterequirements.pip
so it's all up to date.try: import x; except ImportError: import y as x
. There's about 10 of these based on a search forImportError
.Related ideas for separate tickets:
xlrd
is pinned to an old version 1.2.0 but this seems to be because afterwards, support for .xslx was removed and users were encouraged to useopenpyxl
for that format instead. So it would likely involve adding a dependency, and code to detect / swap library depending on input format (either by file name or some fancy detection).formencode
is pulled in just for it'sxml_compare
function in the oldertests
package. The function is a pretty neat structural comparison but the dependent tests could probably be refactored to usetests_v1
stylePyxformTestCase
, meaning that the dependency could be removed altogether.