-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Check and Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
permissions: read-all | ||
jobs: | ||
build: | ||
name: Make pip packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- name: Install build tool | ||
run: pip install build | ||
- name: Building package | ||
run: python -m build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: pip | ||
path: dist/* | ||
if-no-files-found: error | ||
publish: | ||
name: Publish to PyPi | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: github.repository == 'Eeems-Org/python-launcherctl' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
permissions: | ||
id-token: write | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/launcherctl | ||
steps: | ||
- name: Download pip packages | ||
id: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: pip | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: ${{ steps.download.outputs.download-path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
VERSION := $(shell grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3) | ||
|
||
define SCRIPT | ||
if ! type pip &> /dev/null; then | ||
if ! type opkg &> /dev/null; then | ||
echo "Opkg not found, please install toltec" | ||
exit 1 | ||
fi | ||
opkg update | ||
opkg install python3-pip | ||
fi | ||
pip install --force-reinstall /tmp/launcherctl-${VERSION}-py3-none-any.whl | ||
endef | ||
export SCRIPT | ||
|
||
dist/launcherctl-${VERSION}.tar.gz: $(shell find launcherctl -type f) | ||
python -m build --sdist | ||
|
||
dist/launcherctl-${VERSION}-py3-none-any.whl: $(shell find launcherctl -type f) | ||
python -m build --wheel | ||
|
||
clean: | ||
git clean --force -dX | ||
|
||
deploy: dist/launcherctl-${VERSION}-py3-none-any.whl | ||
rsync dist/launcherctl-${VERSION}-py3-none-any.whl [email protected]:/tmp | ||
|
||
install: deploy | ||
echo -e "$$SCRIPT" | ssh [email protected] bash -le | ||
|
||
test: install | ||
cat test.py | ssh [email protected] /opt/bin/python -u | ||
|
||
.PHONY: clean install test deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[![launcherctl on PyPI](https://img.shields.io/pypi/v/launcherctl)](https://pypi.org/project/launcherctl) | ||
|
||
Python wrapper around launcherctl | ||
================================= | ||
|
||
Installation | ||
============ | ||
|
||
```bash | ||
pip install launcherctl | ||
``` | ||
|
||
Usage | ||
===== | ||
|
||
```python | ||
import launcherctl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import subprocess | ||
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[project] | ||
name = "launcherctl" | ||
description = "Python wrapper around launcherctl." | ||
readme = "README.md" | ||
version = "0.0.1" | ||
requires-python = ">= 3.11" | ||
authors = [ | ||
{name = "Nathaniel van Diepen", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "Nathaniel van Diepen", email = "[email protected]"}, | ||
] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Libraries", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/Eeems-Org/python-launcherctl" | ||
Repository = "https://github.com/Eeems-Org/python-launcherctl.git" | ||
Issues = "https://github.com/Eeems-Org/python-launcherctl/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools >= 65.0"] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import launcherctl |