Liftoff icon indicating copy to clipboard operation
Liftoff copied to clipboard

SyntaxWarning for Python >= 3.8

Open nathanweeks opened this issue 2 years ago • 1 comments

The use of is not with a string literal argument can result in a warning for Python versions >= 3.8

https://github.com/agshumate/Liftoff/blob/8d1a6246296f0d7000442e16e4ae5ca0069a287f/liftoff/run_liftoff.py#L43

e.g., using the most recent Biocontainers build of liftoff 1.6.1 (using a Singularity image build):

$ singularity exec --cleanenv  /cvmfs/singularity.galaxyproject.org/l/i/liftoff:1.6.1--pyhdfd78af_0 liftoff --version
/usr/local/lib/python3.9/site-packages/liftoff/run_liftoff.py:43: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if args.o is not 'stdout':
v1.6.1

Suggest using != instead.

An enlightening blog post on this topic: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/

nathanweeks avatar Sep 20 '21 23:09 nathanweeks

Hello,

I get the following warning on running liftoff. I think the tool works fine.... I have not checked the output thoroughly. However, just wanted to float this and reach out to see if others are facing any issues with this.

/mnt/common/rh6/annotate/Anaconda3/lib/python3.8/site-packages/Liftoff-1.6.3-py3.8.egg/liftoff/run_liftoff.py:45: SyntaxWarning: "is not" with a literal. Did you mean "!="? /mnt/common/rh6/annotate/Anaconda3/lib/python3.8/site-packages/Liftoff-1.6.3-py3.8.egg/liftoff/run_liftoff.py:45: SyntaxWarning: "is not" with a literal. Did you mean "!="?

Thanks Abhijit

sanyalab avatar Mar 22 '22 09:03 sanyalab