-
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
1 parent
f281dbd
commit 91d7d58
Showing
20 changed files
with
2,541 additions
and
1 deletion.
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,66 @@ | ||
# Generated from CLion C/C++ Code Style settings | ||
BasedOnStyle: LLVM | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: None | ||
AlignOperands: Align | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllConstructorInitializersOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Always | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Always | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortLoopsOnASingleLine: true | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterUnion: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeColon | ||
BreakInheritanceList: BeforeColon | ||
ColumnLimit: 0 | ||
CompactNamespaces: false | ||
ContinuationIndentWidth: 8 | ||
IndentCaseLabels: true | ||
IndentPPDirectives: None | ||
IndentWidth: 4 | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MaxEmptyLinesToKeep: 2 | ||
NamespaceIndentation: All | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PointerAlignment: Right | ||
ReflowComments: false | ||
SpaceAfterCStyleCast: true | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
TabWidth: 4 | ||
UseTab: Never |
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,49 @@ | ||
name: "Build & Import Test" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- "ydotool/**" | ||
- "pydotool/**" | ||
- "setup.py" | ||
- "CMakeLists.txt" | ||
- ".github/workflows/import.yml" | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "ydotool/**" | ||
- "pydotool/**" | ||
- "setup.py" | ||
- "CMakeLists.txt" | ||
- ".github/workflows/import.yml" | ||
|
||
|
||
jobs: | ||
run-test: | ||
name: "run tests" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install pydotool | ||
run: | | ||
python -m pip install . | ||
- name: run import test | ||
id: tests | ||
run: | | ||
python -c "import pydotool" |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
cmake_minimum_required(VERSION 3.18) | ||
# find correct python package is implemented in cmake 3.15, find other implementation is in 3.18 | ||
|
||
project(ydotool C) | ||
|
||
set(CMAKE_C_STANDARD 99) | ||
|
||
find_package(Python3 COMPONENTS Development) | ||
# Include GNU install directory module to detect where to install | ||
# files on Linux/Unix systems (e.g., lib vs lib64) | ||
include(GNUInstallDirs) | ||
find_package(PkgConfig) | ||
|
||
|
||
execute_process(COMMAND git describe --tags --long --always RESULT_VARIABLE RC_GIT_VER OUTPUT_VARIABLE GIT_VERSION) | ||
|
||
if (${RC_GIT_VER} EQUAL 0) | ||
string(STRIP ${GIT_VERSION} GIT_VERSION) | ||
message("-- Version: " ${GIT_VERSION}) | ||
add_definitions(-DVERSION=\"${GIT_VERSION}\") | ||
endif() | ||
|
||
set(SOURCE_FILES_CLIENT ydotool/ydotool.c ydotool/pydotool.c) | ||
|
||
add_library(_pydotool SHARED ${SOURCE_FILES_CLIENT}) | ||
target_include_directories(_pydotool PRIVATE ${Python3_INCLUDE_DIRS} ydotool) | ||
target_link_libraries(_pydotool ${Python3_LIBRARIES}) | ||
|
||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") | ||
target_compile_options(_pydotool PUBLIC -Wno-unused-result) | ||
endif() | ||
|
||
# optimize for Release build | ||
if (CMAKE_BUILD_TYPE MATCHES ".*Rel.*") | ||
message("Release mode, enabling maximal optimization") | ||
target_compile_options(_pydotool PUBLIC -O3) | ||
else(CMAKE_BUILD_TYPE MATCHES ".*Rel.*") | ||
message("Debug mode, enabling debug symbols") | ||
target_compile_options(_pydotool PUBLIC -g) | ||
endif (CMAKE_BUILD_TYPE MATCHES ".*Rel.*") | ||
|
||
# install py package | ||
install(TARGETS _pydotool LIBRARY DESTINATION .) | ||
set_target_properties(_pydotool PROPERTIES PREFIX "") |
Oops, something went wrong.