diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b102efa..c659161 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,11 +10,11 @@ jobs: matrix: # windows-latest async does not support it for now operating-system: [macos-latest, ubuntu-latest] - ocaml-version: [ '4.14.0', '4.08.1' ] + ocaml-version: [ '5.2.0', '4.14.0' ] steps: - uses: actions/checkout@master - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Cache pip @@ -29,7 +29,7 @@ jobs: - name: Install Python dependencies run: pip install pylint pycodestyle - name: Install OCaml - uses: ocaml/setup-ocaml@v2 + uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-version }} - name: Install OCaml dependencies diff --git a/src/lib/pythongen.ml b/src/lib/pythongen.ml index 70fbb74..aadaf70 100644 --- a/src/lib/pythongen.ml +++ b/src/lib/pythongen.ml @@ -98,8 +98,9 @@ class ListAction(argparse.Action): let compat_block = [ Line "get_str = str" - ; Line "if sys.version_info[0] > 2:" - ; Block [ Line "long = int"; Line "unicode = str"; Line "str = bytes" ] + ; Line "long = int" + ; Line "unicode = str" + ; Line "str = bytes" ; Line "" ] @@ -699,6 +700,7 @@ let commandline_parse _ (BoxedFunction m) = | Basic Int32 -> ", type=int" | Basic Bool -> ", type=lambda x: json.loads(x.lower())" | Basic Float -> ", type=float" + | Variant _ -> ", type=json.loads" | _ -> ""))) inputs @ [ Line "return vars(parser.parse_args())" ])