This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
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.
Initial commit (incomplete, will be rewritten)
- Loading branch information
0 parents
commit 0f3819e
Showing
30 changed files
with
1,978 additions
and
0 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,7 @@ | ||
apt-get update | ||
|
||
git clone --depth=1 https://gitlab.com/kaitaiStructCompile.py/kaitaiStructCompile.py.git | ||
export KSCP=./kaitaiStructCompile.py | ||
pip install --upgrade $KSCP | ||
|
||
pip3 install --upgrade coveralls git+https://github.com/berkerpeksag/astor.git xgboost git+https://gitlab.com/KOLANICH/alternativez.py.git git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git |
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,7 @@ | ||
root = true | ||
|
||
[*] | ||
charset=utf-8 | ||
indent_style = tab | ||
indent_size = 4 | ||
insert_final_newline = false |
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 @@ | ||
KOLANICH/python_project_boilerplate.py |
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,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
allow: | ||
- dependency-type: "all" |
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,15 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: typical python workflow | ||
uses: KOLANICH-GHActions/typical-python-workflow@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,61 @@ | ||
/kaitai-struct-compiler | ||
/kaitai_struct_formats | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# Kaitai Struct generated parsers | ||
/pyxgboost/kaitai/*.py | ||
/tests/output | ||
/tests/models |
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 @@ | ||
image: registry.gitlab.com/kaitaistructcompile.py/kaitai_struct_python_docker | ||
stages: | ||
- dependencies | ||
- build | ||
- test | ||
- tooling | ||
|
||
build: | ||
tags: | ||
- shared | ||
stage: build | ||
variables: | ||
GIT_DEPTH: "1" | ||
PYTHONUSERBASE: ${CI_PROJECT_DIR}/python_user_packages | ||
|
||
before_script: | ||
- export PATH="$PATH:$PYTHONUSERBASE/bin" # don't move into `variables` | ||
- source ./.ci/before.sh | ||
|
||
cache: | ||
paths: | ||
- $PYTHONUSERBASE | ||
- kaitai_struct_formats | ||
|
||
script: | ||
- python3 setup.py bdist_wheel | ||
- coverage run --branch --source=pyxgboost -m pytest --junitxml=./rspec.xml test | ||
- pip3 install --upgrade ./dist/*.whl | ||
- mkdir wheels | ||
- mv ./dist/*.whl ./wheels/pyxgboost-0.CI-py3-none-any.whl | ||
- coverage report -m | ||
- coverage xml | ||
|
||
coverage: /^TOTAL(?:\s*\d+){4}\s(\d+%).+/ | ||
|
||
|
||
artifacts: | ||
paths: | ||
- wheels | ||
|
||
reports: | ||
junit: rspec.xml | ||
cobertura: ./coverage.xml | ||
|
||
checks: | ||
stage: test | ||
tags: | ||
- shared | ||
image: docker:latest | ||
variables: | ||
DOCKER_DRIVER: overlay2 | ||
allow_failure: true | ||
services: | ||
- docker:dind | ||
script: | ||
- docker run --env SAST_CONFIDENCE_LEVEL=5 --volume "$PWD:/code" --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/sast:latest" /app/bin/run /code | ||
#- docker run --env SOURCE_CODE="$PWD" --env CODECLIMATE_VERSION="latest" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/codequality:latest" /code | ||
#- docker run --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}" --volume "$PWD:/code" --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:latest" /code | ||
|
||
artifacts: | ||
reports: | ||
#codequality: gl-code-quality-report.json | ||
sast: gl-sast-report.json | ||
#dependency_scanning: gl-dependency-scanning-report.json |
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 @@ | ||
No codes of conduct! |
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,5 @@ | ||
include UNLICENSE | ||
global-include *.md | ||
global-include *.json | ||
include tests | ||
include .editorconfig |
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,25 @@ | ||
pyxgboost [![Unlicensed work](https://raw.githubusercontent.com/unlicense/unlicense.org/master/static/favicon.png)](https://unlicense.org/) | ||
=============== | ||
~~[wheel](https://gitlab.com/KOLANICH/pyxgboost/-/jobs/artifacts/master/raw/wheels/pyxgboost-0.CI-py3-none-any.whl?job=build)~~ | ||
[![PyPi Status](https://img.shields.io/pypi/v/pyxgboost.svg)](https://pypi.python.org/pypi/pyxgboost) | ||
~~![GitLab Build Status](https://gitlab.com/KOLANICH/pyxgboost/badges/master/pipeline.svg)~~ | ||
~~![GitLab Coverage](https://gitlab.com/KOLANICH/pyxgboost/badges/master/coverage.svg)~~ | ||
[![Libraries.io Status](https://img.shields.io/librariesio/github/KOLANICH/pyxgboost.svg)](https://libraries.io/github/KOLANICH/pyxgboost) [![Code style: antiflash](https://img.shields.io/badge/code%20style-antiflash-FFF.svg)](https://codeberg.org/KOLANICH-tools/antiflash.py) | ||
|
||
This is a tool for conversion an [`xgboost`](https://github.com/dmlc/xgboost)[![PyPI version](https://badge.fury.io/py/xgboost.svg)](https://pypi.python.org/pypi/xgboost/)[![Build Status](https://github.com/dmlc/xgboost/workflows/XGBoost-CI/badge.svg?branch=master)](https://github.com/dmlc/xgboost/actions)[![docs](https://readthedocs.org/projects/xgboost/badge/?version=latest)](https://xgboost.readthedocs.org)[![Conda version](https://img.shields.io/conda/vn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost)[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/dmlc/xgboost/badge)](https://api.securityscorecards.dev/projects/github.com/dmlc/xgboost)![License](https://img.shields.io/github/license/dmlc/xgboost.svg) tree into python AST or source. | ||
|
||
The parsers residing in [`kaitai` dir](./pyxgboost/kaitai) are generated from [Kaitai Struct](https://github.com/kaitai-io/kaitai_struct) [definitions](https://codeberg.org/KOLANICH-specs/kaitai_struct_formats/tree/xgboost/scientific/data_science/dmlc) and since that have [Apache license](./pyxgboost/kaitai). | ||
|
||
Requirements | ||
------------ | ||
* [`kaitaistruct`](https://github.com/kaitai-io/kaitai_struct_python_runtime) | ||
[![PyPi Status](https://img.shields.io/pypi/v/kaitaistruct.svg)](https://pypi.python.org/pypi/kaitaistruct) | ||
![License](https://img.shields.io/github/license/kaitai-io/kaitai_struct_python_runtime.svg) as a runtime for Kaitai Struct-generated code | ||
|
||
* for old Pythons: some of the AST-to-source conversion libraries: [`astor`](https://github.com/berkerpeksag/astor)[![PyPi Status](https://img.shields.io/pypi/v/astor.svg)](https://pypi.python.org/pypi/astor)![License](https://img.shields.io/github/license/berkerpeksag/astor.svg), [`codegen`](https://github.com/andreif/codegen)[![PyPi Status](https://img.shields.io/pypi/v/codegen.svg)](https://pypi.python.org/pypi/codegen)![License](https://img.shields.io/github/license/andreif/codegen.svg), [`astunparse`](https://github.com/simonpercivall/astunparse)[![PyPi Status](https://img.shields.io/pypi/v/astunparse.svg)](https://pypi.python.org/pypi/astunparse)![License](https://img.shields.io/github/license/simonpercivall/astunparse.svg) and [`astmonkey`](https://github.com/mutpy/astmonkey)[![PyPi Status](https://img.shields.io/pypi/v/astmonkey.svg)](https://pypi.python.org/pypi/astmonkey)![License](https://img.shields.io/github/license/mutpy/astmonkey.svg). | ||
|
||
* [`plumbum`](https://github.com/tomerfiliba/plumbum) | ||
[![PyPi Status](https://img.shields.io/pypi/v/plumbum.svg)](https://pypi.python.org/pypi/plumbum) | ||
[![Build Status](https://github.com/tomerfiliba/plumbum/workflows/CI/badge.svg)](https://github.com/tomerfiliba/plumbum/actions) | ||
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/plumbum.svg)](https://github.com/conda-forge/plumbum-feedstock) | ||
![License](https://img.shields.io/github/license/tomerfiliba/plumbum.svg) - for command line interface |
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,27 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <https://unlicense.org/> | ||
|
||
|
||
Libraries in kaitai subdirectory are under Apache-2.0 |
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,59 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.2.0", "wheel", "setuptools_scm[toml]>=3.4.3"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pyxgboost" | ||
authors = [{name = "KOLANICH"}] | ||
description = "A tool for compiling XGBoost models into python source for using without xgboost" | ||
readme = "ReadMe.md" | ||
keywords = ["machine learning", "decision tree", "xgboost", "gradient boosted tree", "compiler"] | ||
license = {text = "Unlicense"} | ||
classifiers = [ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Other Environment", | ||
"Intended Audience :: Developers", | ||
"License :: Public Domain", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
urls = {Homepage = "https://codeberg.org/KOLANICH-ML/pyxgboost"} | ||
dependencies = [ | ||
"plumbum", # @ git+https://github.com/tomerfiliba/plumbum.git#egg=plumbum | ||
"kaitaistruct", # @ git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git#egg=kaitaistruct | ||
"alternativez", # @ git+https://gitlab.com/KOLANICH/alternativez.py.git#egg=alternativez | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
"serializing-ast" = [ # any of | ||
"astor", # @ git+https://github.com/berkerpeksag/astor.git | ||
"codegen", # @ git+https://github.com/andreif/codegen.git | ||
"astunparse", # @ git+https://github.com/simonpercivall/astunparse.git | ||
"astmonkey", # @ git+https://github.com/mutpy/astmonkey.git | ||
] | ||
|
||
[project.entry-points."distutils.setup_keywords"] | ||
pyxgboost = "pyxgboost.setuptoolsHelper:pyxgboostHelper" | ||
|
||
[project.scripts] | ||
pyxgboost = "pyxgboost.__main__:PyXGBoostCLI.run" | ||
|
||
[tool.setuptools] | ||
zip-safe = true | ||
packages = ["pyxgboost", "pyxgboost.kaitai"] | ||
include-package-data = true | ||
|
||
[tool.setuptools_scm] | ||
|
||
[tool.kaitai] | ||
outputDir = "pyxgboost/kaitai" | ||
|
||
[tool.kaitai.repos."https://codeberg.org/KOLANICH-specs/kaitai_struct_formats.git"."xgboost"] | ||
update = true | ||
localPath = "kaitai_struct_formats" | ||
|
||
[tool.kaitai.repos."https://codeberg.org/KOLANICH-specs/kaitai_struct_formats.git"."xgboost".formats.xgboost] | ||
path = "scientific/data_science/dmlc/xgboost/xgboost.ksy" |
Oops, something went wrong.