Repository: lnxpy/pyaction (language: python)

Issue:
Drop support for Python2
Running the action in `python:2-slim` docker images causes issues since Python2 doesn't support some syntaxes from Python3.



Discussion / hints:

Fix patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8f237f6..fe50c32 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -7,20 +7,11 @@ repos:
       - id: trailing-whitespace
       - id: end-of-file-fixer
       - id: check-added-large-files
-  - repo: "https://github.com/psf/black"
-    rev: 23.7.0
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    rev: v0.3.0
     hooks:
-      - id: black
-  - repo: "https://github.com/PyCQA/flake8"
-    rev: 6.0.0
-    hooks:
-      - id: flake8
-        args: ["--ignore=E203,E501,W503"]
-  - repo: "https://github.com/pre-commit/mirrors-mypy"
-    rev: v1.4.1
-    hooks:
-      - id: mypy
-        args: ["--cache-dir=/dev/null", "--ignore-missing-imports"]
+      - id: ruff
+      - id: ruff-format
   - repo: https://github.com/asottile/pyupgrade
     rev: v3.10.1
     hooks:
diff --git a/README.md b/README.md
index 6d459ab..aa74d03 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
-## PyAction [![docs ci](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml) [![main](https://github.com/lnxpy/pyaction/actions/workflows/main.yml/badge.svg)](https://github.com/lnxpy/pyaction/actions/workflows/main.yml) ![GitHub tag (with filter)](https://img.shields.io/github/v/tag/lnxpy/pyaction?label=Version)
+## PyAction [![docs ci](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/lnxpy/pyaction/actions/workflows/docs.yml) [![main](https://github.com/lnxpy/pyaction/actions/workflows/main.yml/badge.svg)](https://github.com/lnxpy/pyaction/actions/workflows/main.yml) ![version)](https://img.shields.io/github/v/tag/lnxpy/pyaction?label=Version)
 
 
-PyAction is a [Cookiecutter](https://cookiecutter.io) template that allows you to develop custom [GitHub Actions](https://docs.github.com/en/actions) using [Python](https://python.org/).
+
+PyAction is a [Cookiecutter](https://cookiecutter.io) template that allows you to develop custom [GitHub Actions](https://docs.github.com/en/actions) using [Python 3](https://python.org/).
 
 <!-- > [!NOTE]
 > Read ["Writing GitHub Actions in Python"](https://imsadra.me/writing-github-actions-in-python) article that walks you through a hello-world example. -->
diff --git a/cookiecutter.json b/cookiecutter.json
index 199e2a9..f27a569 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -10,10 +10,6 @@
         "gplv3",
         "notopensource"
     ],
-    "python_version": [
-        "3",
-        "2"
-    ],
     "include_dependencies": "n",
     "include_cicd_testing": "n"
 }
diff --git a/docs/demo.md b/docs/demo.md
index 865e298..a55ce23 100644
--- a/docs/demo.md
+++ b/docs/demo.md
@@ -20,23 +20,19 @@ cookiecutter gh:lnxpy/pyaction
 And here would be the prompting for my action called "PyAction Hello World".
 
 ``` { .plaintext .no-copy }
-[1/8] action_name (My Awesome Action): PyAction Hello World
-[2/8] action_slug (pyaction-hello-world):
-[3/8] description (A short description..): This actions says Hello to you!
-[4/8] author_name (John Doe):
-[5/8] Select open_source_license
+[1/7] action_name (My Awesome Action): PyAction Hello World
+[2/7] action_slug (pyaction-hello-world):
+[3/7] description (A short description..): This actions says Hello to you!
+[4/7] author_name (John Doe):
+[5/7] Select open_source_license
   1 - mit
   2 - bsd
   3 - apache
   4 - gplv3
   5 - notopensource
   Choose from [1/2/3/4/5] (1):
-[6/8] Select python_version
-  1 - 3
-  2 - 2
-  Choose from [1/2] (1):
-[7/8] include_dependencies (n):
-[8/8] include_cicd_testing (n):
+[6/7] include_dependencies (n):
+[7/7] include_cicd_testing (n):
 pyaction-hello-world is created successfully! ✅
 ```
 
@@ -47,7 +43,6 @@ pyaction-hello-world is created successfully! ✅
 | `description`          | Action description                | `This actions says Hello to you!` |
 | `author_name`          | Your name                         | `John Doe`                        |
 | `open_source_license`  | OS license                        | `1` = (mit)                       |
-| `python_version`       | Python version                    | `1` = (3)                         |
 | `include_dependencies` | Using `requirements.txt`          | `y` = (action has requirements)   |
 | `include_cicd_testing` | A workflow for testing the action | `n`                               |
 
diff --git a/docs/index.md b/docs/index.md
index 65f7737..a83f5bc 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -106,7 +106,7 @@ Here you can see a very basic hello-world example action generated with PyAction
 
 
 ## How It Works
-Custom GitHub Actions can be developed in different ways. PyAction uses the [Docker Container](https://docs.github.com/en/actions/creating-actions/about-custom-actions#docker-container-actions) method which is highly stable with different Python environments. This way, you'll be able to specify the requirements for your actions and run them inside a lightweight isolated container with all the dependencies installed.
+Custom GitHub Actions can be developed in different ways. PyAction uses the [Docker Container](https://docs.github.com/en/actions/creating-actions/about-custom-actions#docker-container-actions) method which is highly stable with Python environments. This way, you'll be able to specify the requirements for your actions and run them inside a lightweight isolated container with all the dependencies installed.
 
 ## Passion
 As a Python developer, I always wanted to help the community and be impactful in its growth. Watching that GitHub supports JavaScript as an official method for creating actions, made me think of inventing a way for Python developers to help the community be able to write actions in Python and benefit from the powerful packages and tools from Python's world.
diff --git a/requirements-dev.ini b/requirements-dev.txt
similarity index 100%
rename from requirements-dev.ini
rename to requirements-dev.txt
diff --git a/requirements-docs.ini b/requirements-docs.txt
similarity index 100%
rename from requirements-docs.ini
rename to requirements-docs.txt
diff --git a/tox.ini b/tox.ini
index d57bd4e..36ffbc3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,7 +12,7 @@ skip_install = true
 [testenv]
 description = run tests
 deps =
-    -r requirements-dev.ini
+    -r requirements-dev.txt
 commands =
     coverage run -m pytest {posargs:tests}
     coverage report --omit={{cookiecutter.action_slug}}/*
@@ -26,5 +26,5 @@ commands = pre-commit run --all-files --show-diff-on-failure
 [testenv:docs]
 description = docs utils
 deps =
-    -r requirements-docs.ini
+    -r requirements-docs.txt
 commands = mkdocs {posargs:tests}
diff --git a/{{cookiecutter.action_slug}}/Dockerfile b/{{cookiecutter.action_slug}}/Dockerfile
index 2a40ac1..9a1d477 100644
--- a/{{cookiecutter.action_slug}}/Dockerfile
+++ b/{{cookiecutter.action_slug}}/Dockerfile
@@ -1,5 +1,5 @@
 # setting the base-image to alpine
-FROM python:{{ cookiecutter.python_version }}-slim
+FROM python:3-slim
 
 # importing the action
 COPY . /action
diff --git a/{{cookiecutter.action_slug}}/README.md b/{{cookiecutter.action_slug}}/README.md
index c3c8ac6..ddd4309 100644
--- a/{{cookiecutter.action_slug}}/README.md
+++ b/{{cookiecutter.action_slug}}/README.md
@@ -1,4 +1,4 @@
-## {{ cookiecutter.action_name }} <img alt="action-badge" src="https://img.shields.io/badge/{{ cookiecutter.action_name }}-white?logo=github-actions&label=GitHub%20Action&labelColor=white&color=0064D7"> <a href="https://github.com/lnxpy/pyaction"><img alt="pyaction" src="https://img.shields.io/badge/pyaction-white?logo=cookiecutter&label=Made%20with&labelColor=white&color=0064D7"></a>
+## {{ cookiecutter.action_name }} <img alt="action-badge" src="https://img.shields.io/badge/{{ cookiecutter.action_name }}-white?logo=github-actions&label=GitHub%20Action&labelColor=white&color=0064D7"> <a href="https://github.com/lnxpy/pyaction"><img alt="pyaction" src="https://img.shields.io/badge/PyAction-white?logo=cookiecutter&label=Made%20with&labelColor=white&color=0064D7"></a>
 
 {{ cookiecutter.description }}
 


Test patch:
diff --git a/{{cookiecutter.action_slug}}/.github/workflows/test.yml b/{{cookiecutter.action_slug}}/.github/workflows/test.yml
index 78c6ae0..e024901 100644
--- a/{{cookiecutter.action_slug}}/.github/workflows/test.yml
+++ b/{{cookiecutter.action_slug}}/.github/workflows/test.yml
@@ -16,4 +16,4 @@ jobs:
       - name: Run action
         uses: ./
         with:
-          name: 'John'
+          name: John