pigamepad 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pigamepad-0.1.0/.codespellrc +15 -0
- pigamepad-0.1.0/.gitignore +7 -0
- pigamepad-0.1.0/.gitlab-ci.yml +110 -0
- pigamepad-0.1.0/CMakeLists.txt +15 -0
- pigamepad-0.1.0/LICENSE +674 -0
- pigamepad-0.1.0/PKG-INFO +29 -0
- pigamepad-0.1.0/README.md +11 -0
- pigamepad-0.1.0/custom-dict.txt +1 -0
- pigamepad-0.1.0/example/simple.py +41 -0
- pigamepad-0.1.0/pigamepad/__init__.py +12 -0
- pigamepad-0.1.0/pigamepad/c_pigamepad.pyi +6 -0
- pigamepad-0.1.0/pigamepad/pigamepad.py +317 -0
- pigamepad-0.1.0/pyproject.toml +84 -0
- pigamepad-0.1.0/src/c_pigamepad.c +158 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- analysis
|
|
3
|
+
- build
|
|
4
|
+
- deploy
|
|
5
|
+
|
|
6
|
+
.rules_common:
|
|
7
|
+
rules:
|
|
8
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
9
|
+
- if: $CI_PIPELINE_SOURCE == "push"
|
|
10
|
+
- if: $CI_COMMIT_TAG
|
|
11
|
+
- if: $CI_PIPELINE_SOURCE == "web"
|
|
12
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
13
|
+
- when: never
|
|
14
|
+
|
|
15
|
+
spelling:
|
|
16
|
+
stage: analysis
|
|
17
|
+
image: python:3.12
|
|
18
|
+
extends: .rules_common
|
|
19
|
+
before_script:
|
|
20
|
+
- pip install .[dev]
|
|
21
|
+
script:
|
|
22
|
+
- codespell .
|
|
23
|
+
|
|
24
|
+
# Python static analysis and formatting with ruff
|
|
25
|
+
# Only runs when a .py file is edited
|
|
26
|
+
ruff-checks:
|
|
27
|
+
stage: analysis
|
|
28
|
+
image: python:3.12
|
|
29
|
+
extends: .rules_common
|
|
30
|
+
before_script:
|
|
31
|
+
- pip install .[dev]
|
|
32
|
+
script:
|
|
33
|
+
- ruff check
|
|
34
|
+
- ruff format --check
|
|
35
|
+
|
|
36
|
+
mypy:
|
|
37
|
+
stage: analysis
|
|
38
|
+
image: python:3.12
|
|
39
|
+
extends: .rules_common
|
|
40
|
+
before_script:
|
|
41
|
+
- pip install .[dev]
|
|
42
|
+
script:
|
|
43
|
+
- mkdir -p mypy
|
|
44
|
+
- mypy pigamepad --cobertura-xml-report mypy --no-error-summary > mypy-out.txt
|
|
45
|
+
after_script:
|
|
46
|
+
# Installed here rather than with [dev] as the after_script runs in a new shell
|
|
47
|
+
- pip install mypy-gitlab-code-quality
|
|
48
|
+
- mypy-gitlab-code-quality < mypy-out.txt > codequality.json
|
|
49
|
+
- cat mypy-out.txt
|
|
50
|
+
|
|
51
|
+
artifacts:
|
|
52
|
+
when: always
|
|
53
|
+
reports:
|
|
54
|
+
codequality: codequality.json
|
|
55
|
+
coverage_report:
|
|
56
|
+
coverage_format: cobertura
|
|
57
|
+
path: mypy/cobertura.xml
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
linux-wheel:
|
|
61
|
+
stage: build
|
|
62
|
+
image: python:3.12
|
|
63
|
+
extends: .rules_common
|
|
64
|
+
# make a docker daemon available for cibuildwheel to use
|
|
65
|
+
services:
|
|
66
|
+
- name: docker:dind
|
|
67
|
+
entrypoint: ["env", "-u", "DOCKER_HOST"]
|
|
68
|
+
command: ["dockerd-entrypoint.sh"]
|
|
69
|
+
variables:
|
|
70
|
+
DOCKER_HOST: tcp://docker:2375/
|
|
71
|
+
DOCKER_DRIVER: overlay2
|
|
72
|
+
# See https://github.com/docker-library/docker/pull/166
|
|
73
|
+
DOCKER_TLS_CERTDIR: ""
|
|
74
|
+
CIBW_ARCHS_LINUX: "x86_64 aarch64"
|
|
75
|
+
CIBW_TEST_SKIP: "*-manylinux_aarch64"
|
|
76
|
+
# Skip musl as it is unlikley a musl system is used on hardware that needs a gamepad
|
|
77
|
+
CIBW_SKIP: "*-musllinux_*"
|
|
78
|
+
script:
|
|
79
|
+
- curl -sSL https://get.docker.com/ | sh
|
|
80
|
+
- python -m pip install cibuildwheel==3.4.0
|
|
81
|
+
- docker run --rm --privileged tonistiigi/binfmt --install all
|
|
82
|
+
- cibuildwheel --output-dir wheelhouse
|
|
83
|
+
artifacts:
|
|
84
|
+
paths:
|
|
85
|
+
- wheelhouse/
|
|
86
|
+
|
|
87
|
+
pypi-publish:
|
|
88
|
+
image: "python:3.12"
|
|
89
|
+
stage: deploy
|
|
90
|
+
id_tokens:
|
|
91
|
+
PYPI_ID_TOKEN:
|
|
92
|
+
aud: pypi
|
|
93
|
+
needs:
|
|
94
|
+
- job: linux-wheel
|
|
95
|
+
artifacts: true
|
|
96
|
+
rules:
|
|
97
|
+
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
|
|
98
|
+
- when: never
|
|
99
|
+
before_script:
|
|
100
|
+
- pip install .[dev]
|
|
101
|
+
script:
|
|
102
|
+
# Only build the source distribution
|
|
103
|
+
- python -m build --sdist
|
|
104
|
+
# Copy the wheels build by CiBuildWheel
|
|
105
|
+
- cp wheelhouse/*.whl dist
|
|
106
|
+
- twine upload dist/*
|
|
107
|
+
artifacts:
|
|
108
|
+
paths:
|
|
109
|
+
- dist/*.whl
|
|
110
|
+
- dist/*.tar.gz
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.15)
|
|
2
|
+
project(pigamepad LANGUAGES C)
|
|
3
|
+
|
|
4
|
+
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
|
|
5
|
+
|
|
6
|
+
Python_add_library(c_pigamepad MODULE src/c_pigamepad.c)
|
|
7
|
+
|
|
8
|
+
target_compile_options(c_pigamepad PRIVATE -fopenmp)
|
|
9
|
+
target_link_options(c_pigamepad PRIVATE -fopenmp)
|
|
10
|
+
|
|
11
|
+
target_link_libraries(c_pigamepad PRIVATE Python::Module)
|
|
12
|
+
|
|
13
|
+
set_target_properties(c_pigamepad PROPERTIES PREFIX "")
|
|
14
|
+
|
|
15
|
+
install(TARGETS c_pigamepad DESTINATION pigamepad)
|