From 9daf42f478c9a3820af82ca5ea7c2d308484b66a Mon Sep 17 00:00:00 2001 From: Tom Saunders <57846408+sirfuzzalot@users.noreply.github.com> Date: Sat, 11 Jun 2022 20:59:09 -0400 Subject: [PATCH] feat: github action publish (#33) - add github actions publish to PyPI on release - migrate from setup.cfg to pyproject.toml - update README with release notes - update version to 0.2.6 --- .github/workflows/python-publish.yml | 38 ++++++++++++++++++++++++ README.md | 18 +++--------- pyproject.toml | 43 ++++++++++++++++++++++++++-- setup.cfg | 39 ------------------------- src/textual_inputs/__init__.py | 2 +- 5 files changed, 83 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/python-publish.yml delete mode 100644 setup.cfg diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..251ef54 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,38 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.md b/README.md index 3c28cbe..0363aba 100644 --- a/README.md +++ b/README.md @@ -13,27 +13,17 @@ Textual Inputs is a collection of input widgets for the [Textual](https://github ## News -### v0.2.5 +### v0.2.6 -Adds support for syntax highlighting. To add syntax highlighting to your -input text set the `syntax` argument to a language supported by -`pygments`. Currently this is set to the default theme. - -```python -TextInput( - name="code", - placeholder="enter some python code...", - title="Code", - syntax="python", -) -``` +- Support for text overflow in TextInput +- Patch for crash when IntegerInput is empty and backspace is pressed. ## Quick Start Installation ```bash -python -m pip install textual-inputs~=0.2.5 +python -m pip install textual-inputs~=0.2.6 ``` To use Textual Inputs diff --git a/pyproject.toml b/pyproject.toml index 2eb0fc7..7f09589 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,51 @@ +[project] +name = "textual-inputs" +license = { text = "MIT" } +description = "textual-inputs is a collection of input widgets for the Textual TUI framework" +readme = "README.md" +keywords = ["tui", "terminal", "widget"] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "License :: OSI Approved :: MIT License", + "Environment :: Console", + "Intended Audience :: Developers", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10" +] +requires-python = ">=3.7" +dependencies = ["textual >= 0.1.18,< 0.2"] +dynamic = ["version"] + +[[project.authors]] +author = "Tom Saunders" +email = "57846408+sirfuzzalot@users.noreply.github.com" + +[project.urls] +Source = "https://github.com/sirfuzzalot/textual-inputs" +Documentation = "https://github.com/sirfuzzalot/textual-inputs" +Tracker = "https://github.com/sirfuzzalot/textual-inputs/issues" + [build-system] requires = [ - "setuptools>=42", + "setuptools>=61", "wheel" ] build-backend = "setuptools.build_meta" +[tool.setuptools.dynamic] +version = { attr = "textual_inputs.__version__" } + [tool.black] -exclude = 'venv' +exclude = 'venv*' [tool.isort] profile = "black" multi_line_output = 3 -skip = ["venv"] +skip = ["venv*"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 83fec05..0000000 --- a/setup.cfg +++ /dev/null @@ -1,39 +0,0 @@ -[metadata] -name = textual-inputs -version = attr: textual_inputs.__version__ -author = Tom Saunders -license = MIT License -license_files = LICENSE -description = textual-inputs is a collection of input widgets for the Textual TUI framework -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/sirfuzzalot/textual-inputs -project_urls = - Tracker = https://github.com/sirfuzzalot/textual-inputs/issues - Documentation = https://github.com/sirfuzzalot/textual-inputs - Source = https://github.com/sirfuzzalot/textual-inputs -classifiers = - Development Status :: 2 - Pre-Alpha - License :: OSI Approved :: MIT License - Environment :: Console - Intended Audience :: Developers - Operating System :: MacOS - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - -[options] -package_dir = - = src -packages = find: -python_requires = >=3.7 -install_requires = - textual >= 0.1.14,< 0.2 - -[options.packages.find] -where = src diff --git a/src/textual_inputs/__init__.py b/src/textual_inputs/__init__.py index 2f745af..92e7ab9 100644 --- a/src/textual_inputs/__init__.py +++ b/src/textual_inputs/__init__.py @@ -1,6 +1,6 @@ from .integer_input import IntegerInput from .text_input import TextInput -__version__ = "0.2.5" +__version__ = "0.2.6" __all__ = ["IntegerInput", "TextInput"]