XLSForm / pyxform

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

dev: update dependencies, testing, packaging, and linting/formatting #685

Closed lindsay-stevens closed 4 months ago

lindsay-stevens commented 5 months ago

Overall this PR modernises pyxform and lints a swathe of code. Most of the commits are progressive application of linter rules, which hopefully makes it clearer what is being done and why - refer to pyproject.toml to see what rules were enabled in that commit.

Changes summary:

Why is this the best possible solution? Were any other approaches considered?

These changes support upgrading pyxform supported Python versions, since the tools replaced in this PR are either out of date already or will not be supported in future.

A lot of code in pyxform is/was crufty due to it's origins in Python 2, and as a natural result of having dozens of committers over many years. The increased linting moves the code towards a more coherent style that is more consistent with modern Python code. This should make contributions easier in future.

What are the regression risks?

The update of AttributeColumnsTest seems to have revealed a bug introduced by #380 for custom attributes and repeats (will backref this ticket). Nobody seems to have complained about this though so perhaps it's a low priority to fix.

The release publishing GitHub action may not be 100% right since I'm not sure there's a nice way to test that.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

The code should be functionally equivalent for users. Where applicable, the README file has been updated.

Before submitting this PR, please make sure you have:

lindsay-stevens commented 4 months ago

@lognaturel thanks for the review! I'll wait for #694 to be decided before merging.

lognaturel commented 4 months ago

Let's go ahead and merge! I think we're going to let #694 simmer for a bit. We can always release off a special release branch if needed.