Browse Source

Add sample packaging implementation

path-arg
IamTheFij 6 months ago
parent
commit
279b57c4ef
  1. 6
      README.md
  2. 2
      pseudo_builder.py
  3. 8
      sample_pseudo_bin/.pre-commit-hooks.yaml
  4. 17
      sample_pseudo_bin/pyproject.toml

6
README.md

@ -68,3 +68,9 @@ Full usage is as follows:
A list of file name to extract from downloaded archive
--extract-all, -x Shell commands to execute after download or extraction
--url-only Only print the URL and do not download
### Pre-Commit usage
This can be used a way to wrap a binary release from a Github or Gitea by adding a `pyproject.toml` file to your current project directory and adding a `.pre-commit-hooks.yaml` file.
Take a look at the `./sample_pseudo_bin` directory to see an example.

2
pseudo_builder.py

@ -1,6 +1,6 @@
"""
This builder functions as a pseudo builder that instead downloads and installs a binary file using
release-gitter based on a pyproject.toml file
release-gitter based on a pyproject.toml file. It's a total hack...
"""
from pathlib import Path
from shutil import copytree

8
sample_pseudo_bin/.pre-commit-hooks.yaml

@ -0,0 +1,8 @@
---
- id: stylua
name: StyLua
description: An opinionated Lua code formatter
entry: stylua
language: python
types:
- lua

17
sample_pseudo_bin/pyproject.toml

@ -0,0 +1,17 @@
[build-system]
requires = ["release-gitter[builder]"]
build-backend = "pseudo_builder"
[tool.release-gitter]
# git-url is not needed if you're in the actual source repo
git-url = "https://github.com/JohnnyMorganz/StyLua"
# version is not needed if you have a Cargo.toml in the current directory
version = "0.11.3"
extract-files = [ "stylua" ]
format = "stylua-{version}-{system}.zip"
exec = "chmod +x stylua"
[tool.release-gitter.map-system]
Darwin = "macos"
Windows = "win64"
Linux = "linux"
Loading…
Cancel
Save