def add_package(<EOL>self, package_name: str, package_version: str = None, *, source: Source = None, develop: bool = False<EOL>):
if source and source.name not in self.pipfile.meta.sources:<EOL><INDENT>raise InternalError(<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>package_version = PackageVersion(<EOL>name=package_name, version=package_version, develop=develop, index=source.name if source else None<EOL>)<EOL>self.pipfile.add_package_version(package_version)<EOL>
Add the given package to project.

        This method will add packages only to Pipfile, locking has to be explicitly done once package is added.