-
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.
Merge pull request #15 from PerryWerneck/python
Add Python module
- Loading branch information
Showing
16 changed files
with
858 additions
and
19 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,34 @@ | ||
name: WinPackage | ||
on: | ||
push: | ||
branches: | ||
- python | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
win32-pack: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oprypin/find-latest-tag@v1 | ||
id: gettag | ||
with: | ||
repository: PerryWerneck/dmiget # The repository to scan. | ||
releases-only: true # We know that all relevant tags have a GitHub release for them. | ||
- uses: ilammy/msvc-dev-cmd@v1.4.1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: Build installer | ||
run: python setup.py bdist_wininst | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.gettag.outputs.tag }} | ||
artifacts: "dist/*.exe" | ||
allowUpdates: true | ||
draft: false | ||
makeLatest: true | ||
omitBody: true | ||
omitPrereleaseDuringUpdate: true | ||
replacesArtifacts: true | ||
|
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
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
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,6 @@ | ||
#!/bin/bash | ||
rm -fr build | ||
python3 setup.py build | ||
|
||
PYTHONPATH=$(readlink -f ./build/lib.linux-x86_64-3.6) python3 | ||
|
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,64 @@ | ||
#!/usr/bin/python | ||
#-*- coding: utf-8 | ||
|
||
from setuptools import setup, Extension | ||
import platform | ||
import os | ||
import glob | ||
|
||
include_dirs = ['src/libdmiget/include'] | ||
library_dirs = [] | ||
extra_link_args = [] | ||
library_names = [ ] | ||
src_files = [ ] | ||
|
||
for filename in glob.glob("src/libdmiget/*.cc"): | ||
src_files.append(filename) | ||
|
||
for filename in glob.glob("src/libdmiget/decoders/*.cc"): | ||
src_files.append(filename) | ||
|
||
for filename in glob.glob("src/python/*.cc"): | ||
src_files.append(filename) | ||
|
||
for filename in glob.glob("src/python/*.c"): | ||
src_files.append(filename) | ||
|
||
if platform.system() == 'Windows': | ||
|
||
for filename in glob.glob("src/libdmiget/os/windows/*.cc"): | ||
src_files.append(filename) | ||
|
||
else: | ||
|
||
for filename in glob.glob("src/libdmiget/os/linux/*.cc"): | ||
src_files.append(filename) | ||
|
||
smbios = Extension( | ||
'smbios', | ||
include_dirs = include_dirs, | ||
libraries = library_names, | ||
library_dirs=library_dirs, | ||
extra_link_args=extra_link_args, | ||
sources=src_files | ||
) | ||
|
||
package_version='0.1' | ||
with open(r'configure.ac', 'r') as fp: | ||
lines = fp.readlines() | ||
for line in lines: | ||
if line.find('AC_INIT') != -1: | ||
package_version = line.split('[')[2].split(']')[0].strip() | ||
break; | ||
|
||
setup ( name = 'smbios', | ||
version = package_version, | ||
description = 'Python library to read data from SMBIOS/DMI.', | ||
author = 'Perry Werneck', | ||
author_email = 'perry.werneck@gmail.com', | ||
url = 'https://github.com/PerryWerneck/dmiget', | ||
long_description = ''' | ||
This is an extension allowing smibios/dmi read for python applications. | ||
''', | ||
ext_modules = [ smbios ]) | ||
|
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 |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
#include <stdint.h> | ||
#include <functional> | ||
#include <memory> | ||
#include <iostream> | ||
|
||
namespace DMIget { | ||
|
||
|
Oops, something went wrong.