Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ jobs:
shell: bash
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade \
-r requirements.txt \
-r requirements-dev.txt
python -m pip install --upgrade -e ".[dev]"

- name: Install Node Dependencies
shell: bash
Expand Down Expand Up @@ -78,18 +76,7 @@ jobs:
echo "::endgroup::"

echo "::group::Run Python Tests"
python -m pytest \
-rxXs \
--tb=native \
--verbose \
--color=yes \
--cov=actions \
--cov-report=term \
--cov-report=xml:coverage/python-coverage.xml \
--cov-report=json:coverage/python-coverage.json \
--junitxml=junit-python.xml \
-o junit_family=legacy \
tests
python -m pytest
echo "::endgroup::"

- name: Test with Jest
Expand Down
2 changes: 1 addition & 1 deletion actions/facebook_post/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel
COPY . /app

WORKDIR /app
RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt
RUN python -m pip install --no-cache-dir --upgrade .

# github will mount the `GITHUB_WORKSPACE` directory to /github/workspace
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir
Expand Down
18 changes: 18 additions & 0 deletions actions/facebook_post/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions-facebook-post"
version = "0.0.0"
description = "Facebook post action for GitHub workflows."
requires-python = ">=3.12"

dependencies = [
"python-dotenv==1.2.1",
"requests==2.32.5",
]

[tool.setuptools.packages.find]
where = ["."]
include = []
2 changes: 0 additions & 2 deletions actions/facebook_post/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion actions/release_homebrew/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ runs:
run: |
echo "::group::Install Python Requirements"
# install requirements required for this action to complete
"${{ steps.venv.outputs.python-path }}" -m pip install -r requirements.txt
"${{ steps.venv.outputs.python-path }}" -m pip install .
echo "::endgroup::"

- name: Checkout (org homebrew repo)
Expand Down
17 changes: 17 additions & 0 deletions actions/release_homebrew/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions-release-homebrew"
version = "0.0.0"
description = "Release Homebrew action for GitHub workflows."
requires-python = ">=3.11"

dependencies = [
"python-dotenv==1.2.1",
]

[tool.setuptools.packages.find]
where = ["."]
include = []
1 change: 0 additions & 1 deletion actions/release_homebrew/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion actions/release_setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel
COPY . /app

WORKDIR /app
RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt
RUN python -m pip install --no-cache-dir --upgrade .

# github will mount the `GITHUB_WORKSPACE` directory to /github/workspace
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir
Expand Down
18 changes: 18 additions & 0 deletions actions/release_setup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions-release-setup"
version = "0.0.0"
description = "Release setup action for GitHub workflows."
requires-python = ">=3.12"

dependencies = [
"python-dotenv==1.2.1",
"requests==2.32.5",
]

[tool.setuptools.packages.find]
where = ["."]
include = []
2 changes: 0 additions & 2 deletions actions/release_setup/requirements.txt

This file was deleted.

18 changes: 10 additions & 8 deletions actions/setup_python/post-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ if [[ -n "$WITH_PARAMS" ]]; then

# setup python
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements-dev.txt

python -m pytest \
-rxXs \
--tb=native \
--verbose \
--color=yes \
tests/setup_python

# Convert path for Windows (Git Bash/MSYS produces Unix-style paths that pip rejects)
if command -v cygpath > /dev/null 2>&1; then
INSTALL_PATH="$(cygpath -w "${SCRIPT_DIR}")"
else
INSTALL_PATH="${SCRIPT_DIR}"
fi
python -m pip install --upgrade "${INSTALL_PATH}[dev]"

python -m pytest -c "${SCRIPT_DIR}/setup.cfg" tests/setup_python
else
echo "Error: WITH_PARAMS environment variable not set" >&2
exit 1
Expand Down
23 changes: 23 additions & 0 deletions actions/setup_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions-setup-python"
version = "0.0.0"
description = "Setup Python action for GitHub workflows."

dependencies = []

[project.optional-dependencies]
dev = [
"pytest==4.6.11;python_version<'3.5'",
"pytest==6.1.2;python_version>='3.5' and python_version<'3.6'",
"pytest==7.0.1;python_version>='3.6' and python_version<'3.7'",
"pytest==8.3.5;python_version>='3.7' and python_version<'3.9'",
"pytest==9.0.2;python_version>='3.9'",
]

[tool.setuptools.packages.find]
where = ["."]
include = []
6 changes: 6 additions & 0 deletions actions/setup_python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tool:pytest]
addopts =
-rxXs
--tb=native
--verbose
--color=yes
31 changes: 31 additions & 0 deletions actions/setup_python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import re
from setuptools import setup


def get_dev_extras():
"""Read the dev extras from pyproject.toml without any TOML library dependency."""
pyproject_path = os.path.join(os.path.dirname(__file__), "pyproject.toml")

with open(pyproject_path, "r") as f:
content = f.read()

# Extract the [project.optional-dependencies] dev block
match = re.search(
r'\[project\.optional-dependencies]\s*dev\s*=\s*\[(.*?)]',
content,
re.DOTALL,
)
if not match:
return []

block = match.group(1)
# Extract each quoted string
return re.findall(r'"([^"]+)"', block)


setup(
extras_require={
"dev": get_dev_extras(),
},
)
19 changes: 19 additions & 0 deletions actions/setup_virtual_desktop/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions-setup-virtual-desktop"
version = "0.0.0"
description = "Setup virtual desktop action for GitHub workflows."
requires-python = ">=3.12"

dependencies = [
# PyGObject provides Python bindings for GObject-based libraries like GTK and AppIndicator
# Only install on Linux where AppIndicator/Ayatana is available
"pygobject==3.54.5;sys_platform=='linux'",
]

[tool.setuptools.packages.find]
where = ["."]
include = []
4 changes: 0 additions & 4 deletions actions/setup_virtual_desktop/requirements.txt

This file was deleted.

70 changes: 70 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lizardbyte-actions"
version = "0.0.0"
description = "Reusable actions for GitHub workflows."
readme = "README.md"
license = "MIT"
authors = [
{name = "LizardByte", email = "lizardbyte@users.noreply.github.com"}
]

dependencies = [
"lizardbyte-actions-facebook-post @ file:./actions/facebook_post",
"lizardbyte-actions-release-homebrew @ file:./actions/release_homebrew",
"lizardbyte-actions-release-setup @ file:./actions/release_setup",
]

[project.optional-dependencies]
dev = [
"pytest==9.0.2",
"pytest-cov==7.0.0",
]

[project.urls]
Homepage = "https://github.com/LizardByte/actions#readme"
Repository = "https://github.com/LizardByte/actions"
Issues = "https://github.com/LizardByte/actions/issues"

[tool.setuptools.packages.find]
include = ["actions*"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-rxXs",
"--tb=native",
"--verbose",
"--color=yes",
"--cov=actions",
"--cov-report=term",
"--cov-report=xml:coverage/python-coverage.xml",
"--cov-report=json:coverage/python-coverage.json",
"--junitxml=junit-python.xml",
"-o", "junit_family=legacy",
]

[tool.coverage.run]
source = ["actions"]
omit = [
"*/tests/*",
"*/__pycache__/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.