from setuptools import setup
from importlib import metadata


package_name = "lasagna-ai"
new_name = "lasagna"
md = metadata.metadata(package_name)
md = md.json
# dict_keys(['metadata_version', 'name', 'version', 'summary', 'project_url', 'author_email', 'license_file', 'keywords', 'classifier', 'requires_python', 'requires_dist', 'provides_extra', 'description_content_type', 'description'])
version = md["version"]
license_file = md["license_file"]
classifiers = md["classifier"]
files = metadata.files(package_name)
for f in files:
    if not f.parts[0].endswith('dist-info') or f.name != license_file:
        continue
    license = f.read_text()
    open(license_file, 'w').write(license)
setup(
    name=new_name,
    version=version,
    description=f"Mirror package that installs {package_name}",
    author="Neverik",
    author_email=md["author_email"],
    url=f"https://pypi.org/project/{package_name}",
    install_requires=[f"{package_name}=={version}"],
    python_requires=">=3.6",
    license_files=(license_file,),
    license=license.partition('\n')[0],
    classifiers=classifiers
)
