iqbal-lab-org / make_prg

Code to create a PRG from a Multiple Sequence Alignment file
Other
21 stars 7 forks source link

Recent version of pytest gets stuck on make_prg integration tests #41

Closed leoisl closed 1 year ago

leoisl commented 1 year ago

I couldn't find a solution for this for now. As part of the new release, I've tried upgrading python version to 3.10.8 and deps to the latest ones what we could find wheel for it, so that installation is quick. pytest unfortunately gets stuck on running make_prg integration tests. In my machine, it always gets stuck at test___match_nonmatch_shortmatch. If I remove it, it gets stuck on the next one.

This is not the best idea neither, as Python version 3.7 end-of-life (EOL) is 27 Jun 2023, and we should be compatible with (I guess) the oldest python version still supported. Will revert to the latest python 3.7 version and try to update deps

leoisl commented 1 year ago

New release is not compatible with python 3.7:

Traceback (most recent call last):
  File "/home/leandro/git/make_prg/make_prg/__main__.py", line 102, in <module>
    main()
  File "/home/leandro/git/make_prg/make_prg/__main__.py", line 96, in main
    args.func(args)
  File "/home/leandro/git/make_prg/make_prg/subcommands/from_msa.py", line 175, in run
    InputOutputFilesFromMSA.create_final_files(successful_input_and_output_files, options.output_prefix)
  File "/home/leandro/git/make_prg/make_prg/utils/input_output_files.py", line 116, in create_final_files
    input_output_file.delete_files()
  File "/home/leandro/git/make_prg/make_prg/utils/input_output_files.py", line 152, in delete_files
    self._delete_file(self.prg)
  File "/home/leandro/git/make_prg/make_prg/utils/input_output_files.py", line 149, in _delete_file
    filepath.unlink(missing_ok=True)
TypeError: unlink() got an unexpected keyword argument 'missing_ok'

Process finished with exit code 1

Not hard to fix though...

leoisl commented 1 year ago

Neither with 3.8.10, I think this is a reason to fix then

mbhall88 commented 1 year ago

Seems that parameter was only added in 3.8 (https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink).

I think we can easily revert it to a v3.7 compatible methodology. Juts check if the file exists and if it does, run unlink (the race condition where it has been deleted in the time between those two calls is extremely unlikely in our use case)

leoisl commented 1 year ago

think we can easily revert it to a v3.7 compatible methodology. Juts check if the file exists and if it does, run unlink (the race condition where it has been deleted in the time between those two calls is extremely unlikely in our use case)

this was done!

leoisl commented 1 year ago

Closed in favour of https://github.com/iqbal-lab-org/make_prg/issues/44