Skip to content

Commit

Permalink
Stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed May 27, 2024
1 parent 3867208 commit 5144ae1
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yaml
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 }}
34 changes: 34 additions & 0 deletions Makefile
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
18 changes: 18 additions & 0 deletions README.md
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
```
2 changes: 2 additions & 0 deletions launcherctl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import subprocess
import sys
28 changes: 28 additions & 0 deletions pyproject.toml
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"
1 change: 1 addition & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import launcherctl

0 comments on commit 5144ae1

Please sign in to comment.