def parse_args(args=None):
if args is None:<EOL><INDENT>args = sys.argv[<NUM_LIT:1>:]<EOL><DEDENT>parser = argparse.ArgumentParser(description='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', type=ph.path, nargs='<STR_LIT:?>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', type=ph.path, nargs='<STR_LIT:?>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', nargs='<STR_LIT:?>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', nargs='<STR_LIT:?>')<EOL>parsed_args = parser.parse_args()<EOL>if not parsed_args.source_dir:<EOL><INDENT>parsed_args.source_dir = ph.path(os.environ['<STR_LIT>'])<EOL><DEDENT>if not parsed_args.target_dir:<EOL><INDENT>prefix_dir = ph.path(os.environ['<STR_LIT>'])<EOL>module_name = os.environ['<STR_LIT>'].split('<STR_LIT:.>')[-<NUM_LIT:1>].replace('<STR_LIT:->', '<STR_LIT:_>')<EOL>parsed_args.target_dir = prefix_dir.joinpath('<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>module_name)<EOL><DEDENT>if not parsed_args.package_name:<EOL><INDENT>parsed_args.package_name = os.environ['<STR_LIT>']<EOL><DEDENT>return parsed_args<EOL>
Parses arguments, returns ``(options, args)``.

.. versionchanged:: 0.24.1
    Fix handling of optional :data:`args`.