def extract_classifier_and_extension(pkg_name, filename):
basename, _, extension = filename.rpartition('<STR_LIT:.>')<EOL>if extension == '<STR_LIT>' and filename.endswith('<STR_LIT>'):<EOL><INDENT>extension = '<STR_LIT>'<EOL>basename = filename[:-<NUM_LIT:7>]<EOL><DEDENT>if basename == pkg_name or basename[len(pkg_name)] != '<STR_LIT:->':<EOL><INDENT>return '<STR_LIT>', extension<EOL><DEDENT>basename = basename[len(pkg_name)+<NUM_LIT:1>:]<EOL>classifier_parts = basename.split('<STR_LIT:->')<EOL>if len(classifier_parts) < <NUM_LIT:3>:<EOL><INDENT>return '<STR_LIT>', extension<EOL><DEDENT>if len(classifier_parts) == <NUM_LIT:3>:<EOL><INDENT>_, _, classifier_parts[<NUM_LIT:0>] = classifier_parts[<NUM_LIT:0>].rpartition('<STR_LIT:.>')<EOL><DEDENT>return '<STR_LIT:->'.join(classifier_parts[-<NUM_LIT:3>:]), extension<EOL>
Returns a PEP425-compliant classifier (or 'py2.py3-none-any' if it cannot be extracted),
and the file extension
TODO: return a classifier 3-members namedtuple instead of a single string