Skip to content

Commit 333cc23

Browse files
committed
Merge pull request #25 from lnxpy/feature/drop_py2
Dropping support for Python2
2 parents 4fd6cc6 + 338d5b9 commit 333cc23

File tree

11 files changed

+20
-37
lines changed

11 files changed

+20
-37
lines changed

.pre-commit-config.yaml

+4-13
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,11 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: check-added-large-files
10-
- repo: "https://github.com/psf/black"
11-
rev: 23.7.0
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.3.0
1212
hooks:
13-
- id: black
14-
- repo: "https://github.com/PyCQA/flake8"
15-
rev: 6.0.0
16-
hooks:
17-
- id: flake8
18-
args: ["--ignore=E203,E501,W503"]
19-
- repo: "https://github.com/pre-commit/mirrors-mypy"
20-
rev: v1.4.1
21-
hooks:
22-
- id: mypy
23-
args: ["--cache-dir=/dev/null", "--ignore-missing-imports"]
13+
- id: ruff
14+
- id: ruff-format
2415
- repo: https://github.com/asottile/pyupgrade
2516
rev: v3.10.1
2617
hooks:

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
## 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)
1+
## 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)
22

33

4-
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/).
4+
5+
PyAction is a [Cookiecutter](https://cookiecutter.io) template that allows you to develop custom [GitHub Actions](https://docs.github.com/en/actions) using [Python3](https://python.org/).
56

67
<!-- > [!NOTE]
78
> Read ["Writing GitHub Actions in Python"](https://imsadra.me/writing-github-actions-in-python) article that walks you through a hello-world example. -->

cookiecutter.json

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
"gplv3",
1111
"notopensource"
1212
],
13-
"python_version": [
14-
"3",
15-
"2"
16-
],
1713
"include_dependencies": "n",
1814
"include_cicd_testing": "n"
1915
}

docs/demo.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,19 @@ cookiecutter gh:lnxpy/pyaction
2020
And here would be the prompting for my action called "PyAction Hello World".
2121

2222
``` { .plaintext .no-copy }
23-
[1/8] action_name (My Awesome Action): PyAction Hello World
24-
[2/8] action_slug (pyaction-hello-world):
25-
[3/8] description (A short description..): This actions says Hello to you!
26-
[4/8] author_name (John Doe):
27-
[5/8] Select open_source_license
23+
[1/7] action_name (My Awesome Action): PyAction Hello World
24+
[2/7] action_slug (pyaction-hello-world):
25+
[3/7] description (A short description..): This actions says Hello to you!
26+
[4/7] author_name (John Doe):
27+
[5/7] Select open_source_license
2828
1 - mit
2929
2 - bsd
3030
3 - apache
3131
4 - gplv3
3232
5 - notopensource
3333
Choose from [1/2/3/4/5] (1):
34-
[6/8] Select python_version
35-
1 - 3
36-
2 - 2
37-
Choose from [1/2] (1):
38-
[7/8] include_dependencies (n):
39-
[8/8] include_cicd_testing (n):
34+
[6/7] include_dependencies (n):
35+
[7/7] include_cicd_testing (n):
4036
pyaction-hello-world is created successfully! ✅
4137
```
4238

@@ -47,7 +43,6 @@ pyaction-hello-world is created successfully! ✅
4743
| `description` | Action description | `This actions says Hello to you!` |
4844
| `author_name` | Your name | `John Doe` |
4945
| `open_source_license` | OS license | `1` = (mit) |
50-
| `python_version` | Python version | `1` = (3) |
5146
| `include_dependencies` | Using `requirements.txt` | `y` = (action has requirements) |
5247
| `include_cicd_testing` | A workflow for testing the action | `n` |
5348

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Here you can see a very basic hello-world example action generated with PyAction
106106

107107

108108
## How It Works
109-
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.
109+
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.
110110

111111
## Passion
112112
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.
File renamed without changes.
File renamed without changes.

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ skip_install = true
1212
[testenv]
1313
description = run tests
1414
deps =
15-
-r requirements-dev.ini
15+
-r requirements-dev.txt
1616
commands =
1717
coverage run -m pytest {posargs:tests}
1818
coverage report --omit={{cookiecutter.action_slug}}/*
@@ -26,5 +26,5 @@ commands = pre-commit run --all-files --show-diff-on-failure
2626
[testenv:docs]
2727
description = docs utils
2828
deps =
29-
-r requirements-docs.ini
29+
-r requirements-docs.txt
3030
commands = mkdocs {posargs:tests}

{{cookiecutter.action_slug}}/.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Run action
1717
uses: ./
1818
with:
19-
name: 'John'
19+
name: John

{{cookiecutter.action_slug}}/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# setting the base-image to alpine
2-
FROM python:{{ cookiecutter.python_version }}-slim
2+
FROM python:3-slim
33

44
# importing the action
55
COPY . /action

{{cookiecutter.action_slug}}/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## {{ 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>
1+
## {{ 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>
22

33
{{ cookiecutter.description }}
44

0 commit comments

Comments
 (0)