{"library":"flit","code":"# Create a directory for your package, e.g., 'my_package'\n# Inside 'my_package', create 'my_module.py' or a package directory 'my_module/__init__.py'\n\n# my_module/__init__.py (or my_module.py)\n\"\"\"An amazing sample package!\"\"\"\n__version__ = \"0.1.0\"\n\ndef greet(name):\n    return f\"Hello, {name}!\"\n\n# In the root of your package directory (e.g., 'my_package')\n# 1. Initialize Flit (creates pyproject.toml)\n# flit init\n\n# This would be the content of the generated pyproject.toml (adjust details):\n# [build-system]\n# requires = [\"flit_core >=3.2,<4\"]\n# build-backend = \"flit_core.buildapi\"\n\n# [project]\n# name = \"my-module-name\"\n# authors = [{name = \"Your Name\", email = \"your.email@example.com\"}]\n# dynamic = [\"version\", \"description\"]\n# classifiers = [\n#     \"Programming Language :: Python :: 3\",\n#     \"License :: OSI Approved :: MIT License\",\n#     \"Operating System :: OS Independent\",\n# ]\n# requires-python = \">=3.8\"\n\n# 2. Build the package (creates .whl and .tar.gz in 'dist/')\n# flit build\n\n# 3. Publish to PyPI (requires PyPI credentials setup)\n# flit publish --repository pypi\n\n# Example of using the installed package locally:\n# pip install --no-index --find-links=./dist my-module-name\n\n# import my_module\n# print(my_module.greet(\"Flit User\"))","lang":"python","description":"To get started with Flit, first create your Python module or package with a `__version__` attribute. Then, navigate to your project's root directory and run `flit init` to generate a `pyproject.toml` file. This file will contain your package's metadata. You can then build your distribution files using `flit build` and publish them to PyPI with `flit publish`.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}