Skip to content

Package colored_text for PyPI with typed API and CI - #2

Merged
Varun-SV merged 3 commits into
mainfrom
copilot/create-python-library-structure
Dec 28, 2025
Merged

Package colored_text for PyPI with typed API and CI#2
Varun-SV merged 3 commits into
mainfrom
copilot/create-python-library-structure

Conversation

Copilot AI commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

The repo now ships a typed colored_text library (not just a notebook) with packaging, tests, CI, and publishing instructions for PyPI readiness.

  • Packaging & Metadata: Added pyproject.toml/setup.cfg, MIT license, py.typed, pinned build backend, and README install/usage/publish guidance.
  • Library Structure: Introduced src/colored_text with Style enum plus colorize/print_colored API and available styles helper.
  • Quality & CI: Added pytest coverage for styling and invalid inputs; GitHub Actions workflow builds, tests, and runs twine check with restricted token permissions.

Example usage:

from colored_text import Style, available_styles, colorize, print_colored

print(colorize("Hello", Style.BOLD, Style.BLUE))
print_colored("Warn", "red", "underline")
print(available_styles())
Original prompt

Turn this repo into a fully packaged, installable Python library ready for publishing to PyPI. The repository currently has code for colored text printing in Python. I want:

  1. A proper package directory (e.g., colored_text) with Python modules, not just a notebook.
  2. A pyproject.toml configured for setuptools / build backend with metadata like name, version, author, description, license, classifiers, and homepage set correctly.
  3. A minimal setup.cfg if needed to support editable installs and package discovery.
  4. Include type hints and docstrings where applicable.
  5. Write unit tests using pytest under a tests/ directory covering basic functionality (color application, invalid inputs, etc.).
  6. Add GitHub Actions CI workflow (.github/workflows/python-package.yml) to build, test, and check packaging.
  7. A README.md updated with installation instructions (pip install colored_text), usage examples, and contribution guidelines.
  8. A LICENSE file with a permissive license (MIT by default) and update if needed.
  9. Create a draft release and test publishing with twine check.
  10. Ensure the package follows PyPI best practices (namespaced package, __init__.py, classifiers, Python version support).
  11. Provide instructions in the PR description for how to publish to PyPI (build steps: python -m build, twine upload dist/*).

Write all new files and modifications as required, and open a pull request.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 28, 2025 05:07
Co-authored-by: Varun-SV <99396752+Varun-SV@users.noreply.github.com>
Co-authored-by: Varun-SV <99396752+Varun-SV@users.noreply.github.com>
Copilot AI changed the title [WIP] Turn repo into a fully packaged Python library for PyPI Package colored_text for PyPI with typed API and CI Dec 28, 2025
Copilot AI requested a review from Varun-SV December 28, 2025 05:11
@Varun-SV
Varun-SV marked this pull request as ready for review December 28, 2025 05:20
@Varun-SV
Varun-SV merged commit c8100a1 into main Dec 28, 2025
2 checks passed
@Varun-SV
Varun-SV deleted the copilot/create-python-library-structure branch December 28, 2025 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants