ucam-department-of-psychiatry / crate

Create and use de-identified research databases. Preprocess, extract text, anonymise/de-identify, link, apply natural language processing, query for research, manage consent for contact.
GNU General Public License v3.0
19 stars 7 forks source link

Inclusion files generated differently with python > 3.8 #121

Closed martinburchell closed 1 year ago

martinburchell commented 1 year ago

Building the docs with different versions of python results in different output. Currently the GitHub docs workflow assumes python 3.8.

RudolfCardinal commented 1 year ago

Using test_argparse_text.py:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--something", help="Some help")
parser.parse_args()

then python3.8 test_argparse_text.py --help gives:

usage: test_argparse_text.py [-h] [--something SOMETHING]

optional arguments:
  -h, --help            show this help message and exit
  --something SOMETHING
                        Some help

whereas python3.10 test_argparse_text.py --help gives:

usage: test_argparse_text.py [-h] [--something SOMETHING]

options:
  -h, --help            show this help message and exit
  --something SOMETHING
                        Some help

so the change from "optional arguments" to "options" looks to be a change in argparse (a standard library module) between Python 3.8 and 3.10.

RudolfCardinal commented 1 year ago

Per MB, see https://github.com/ucam-department-of-psychiatry/crate/blob/master/.github/workflows/docs.yml#L14

martinburchell commented 1 year ago

https://github.com/python/cpython/commit/41b223d29cdfeb1f222c12c3abaccc3bc128f5e7

martinburchell commented 1 year ago

Let's try moving this to Python 3.10. Add a check in the relevant build script and pin the GitHub workflow to Ubuntu 22.04 / Python 3.10. I can install python3.10 from deadsnakes.