-
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.
* switch to composite action * migrate to pyproject.toml * add pre-commit config and use it in CI * add unit testing and type checking * use windows CI runner for accurate testing * add .gitattributes & allow crlf in demo test files
- Loading branch information
Showing
21 changed files
with
265 additions
and
143 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,9 @@ | ||
# Prevent line ending conversions by default to avoid problems with binary files. | ||
* -text | ||
|
||
# Known text files should have LF line endings. | ||
*.py text eol=lf | ||
*.rst text eol=lf | ||
*.toml text eol=lf | ||
LICENSE text eol=lf | ||
tests/demo_project/RMSKIN.ini text eol=crlf |
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
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 |
---|---|---|
|
@@ -123,6 +123,9 @@ dmypy.json | |
# Pyre type checker | ||
.pyre/ | ||
|
||
# ruff linter | ||
.ruff_cache/ | ||
|
||
# vscode folder | ||
.vscode/ | ||
|
||
|
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,29 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-added-large-files | ||
- id: mixed-line-ending | ||
args: ['--fix=lf'] | ||
exclude: "tests/demo_project" | ||
- id: requirements-txt-fixer | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.291 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.5.1 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: ['types-Pillow'] |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,42 +1,56 @@ | ||
name: rmskin-build | ||
description: packaging tool for Rainmeter User Content | ||
|
||
# for the badge | ||
branding: | ||
icon: 'droplet' | ||
|
||
inputs: | ||
version: # 'auto' | ||
description: "Version of the Rainmeter rmskin package. Defaults to last 8 digits of SHA from commit or reference tags." | ||
required: false | ||
default: 'auto' | ||
title: # 'repo-name' | ||
description: "Name of the Rainmeter rmskin package. Defaults name of repository." | ||
required: false | ||
default: ${{ github.event.repository.name }} | ||
author: # 'repo-owner' | ||
description: "Account Username maintaining the rmskin package. Defaults to Username that triggered the commit." | ||
required: false | ||
default: ${{ github.repository_owner }} | ||
path: # '.' | ||
description: "Base directory of repo being packaged. Defaults to workflow's workspace path" | ||
required: false | ||
default: "/github/workspace" | ||
dir_out: # '.' | ||
description: "Path to save generated rmskin package. Defaults to workflow's workspace path" | ||
required: false | ||
default: "/github/workspace" | ||
|
||
outputs: | ||
arc_name: # path to & name of archive file that was generated | ||
description: "name of rmskin file" | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.path }} | ||
- ${{ inputs.version }} | ||
- ${{ inputs.author }} | ||
- ${{ inputs.title }} | ||
- ${{ inputs.dir_out }} | ||
name: rmskin-build | ||
description: packaging tool for Rainmeter User Content | ||
|
||
# for the badge | ||
branding: | ||
icon: 'droplet' | ||
|
||
inputs: | ||
version: # 'auto' | ||
description: "Version of the Rainmeter rmskin package. Defaults to last 8 digits of SHA from commit or reference tags." | ||
required: false | ||
default: 'auto' | ||
title: # 'repo-name' | ||
description: "Name of the Rainmeter rmskin package. Defaults name of repository." | ||
required: false | ||
default: ${{ github.event.repository.name }} | ||
author: # 'repo-owner' | ||
description: "Account Username maintaining the rmskin package. Defaults to Username that triggered the commit." | ||
required: false | ||
default: ${{ github.repository_owner }} | ||
path: # '.' | ||
description: "Base directory of repo being packaged. Defaults to workflow's workspace path" | ||
required: false | ||
default: "/github/workspace" | ||
dir_out: # '.' | ||
description: "Path to save generated rmskin package. Defaults to workflow's workspace path" | ||
required: false | ||
default: "/github/workspace" | ||
|
||
outputs: | ||
arc_name: # path to & name of archive file that was generated | ||
description: "name of rmskin file" | ||
value: ${{ steps.rmskin-builder.outputs.arc_name }} | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: setup-python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
update-environment: false | ||
- name: Install rmskin-builder | ||
shell: bash | ||
run: ${{ steps.setup-python.outputs.python-path }} -m pip install rmskin-builder | ||
- name: Run rmskin-builder | ||
id: rmskin-builder | ||
shell: bash | ||
run: >- | ||
rmskin-builder | ||
--path "${{ inputs.path }}" | ||
--version "${{ inputs.version }}" | ||
--author "${{ inputs.author }}" | ||
--title "${{ inputs.title }}" | ||
--dir_out "${{ inputs.dir_out }}" |
This file was deleted.
Oops, something went wrong.
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,58 @@ | ||
[build-system] | ||
requires = ["setuptools>=61", "setuptools-scm"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "rmskin-builder" | ||
description = "A script that will attempt to assemble a validating Rainmeter skin package for quick and easy distribution on Github." | ||
readme = "README.rst" | ||
keywords = ["rainmeter", "rainmeter-skin", "packaging"] | ||
license = {text = "MIT License"} | ||
authors = [ | ||
{ name = "Brendan Doherty", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
# https://pypi.org/pypi?%3Aaction=list_classifiers | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Topic :: System :: Archiving :: Packaging", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
] | ||
dynamic = ["version", "dependencies"] | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
|
||
[project.scripts] | ||
rmskin-builder = "rmskin_builder:main" | ||
|
||
[project.urls] | ||
source = "https://github.com/2bndy5/rmskin-builder" | ||
tracker = "https://github.com/2bndy5/rmskin-builder/issues" | ||
|
||
# ... other project metadata fields as specified in: | ||
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ | ||
|
||
[tool.setuptools] | ||
py-modules = ["rmskin_builder"] | ||
|
||
[tool.setuptools_scm] | ||
# It would be nice to include the commit hash in the version, but that | ||
# can't be done in a PEP 440-compatible way. | ||
version_scheme= "no-guess-dev" | ||
# Test PyPI does not support local versions. | ||
local_scheme = "no-local-version" | ||
fallback_version = "0.0.0" | ||
|
||
[tool.mypy] | ||
show_error_codes = true | ||
show_column_numbers = true | ||
ignore_missing_imports = true | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
testpaths = ["tests"] | ||
|
||
[tool.coverage.run] | ||
source = ["rmskin_builder"] |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# for detirmining if a .dll file is for 64-bit or 32-bit | ||
pefile | ||
# for verifying header image file and resizing it accordingly | ||
pillow | ||
pillow |
Oops, something went wrong.