Skip to content

Commit

Permalink
Merge pull request #25 from lnxpy/feature/drop_py2
Browse files Browse the repository at this point in the history
Dropping support for Python2
  • Loading branch information
lnxpy authored Mar 3, 2024
2 parents 4fd6cc6 + 338d5b9 commit 52d2e42
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 37 deletions.
17 changes: 4 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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. -->
Expand Down
4 changes: 0 additions & 4 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"gplv3",
"notopensource"
],
"python_version": [
"3",
"2"
],
"include_dependencies": "n",
"include_cicd_testing": "n"
}
19 changes: 7 additions & 12 deletions docs/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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! ✅
```

Expand All @@ -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` |

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}}/*
Expand All @@ -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}
2 changes: 1 addition & 1 deletion {{cookiecutter.action_slug}}/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Run action
uses: ./
with:
name: 'John'
name: John
2 changes: 1 addition & 1 deletion {{cookiecutter.action_slug}}/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.action_slug}}/README.md
Original file line number Diff line number Diff line change
@@ -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 }}

Expand Down

0 comments on commit 52d2e42

Please sign in to comment.