-
Notifications
You must be signed in to change notification settings - Fork 8
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 #136 from realratchet/master
Added nimble support
- Loading branch information
Showing
46 changed files
with
974 additions
and
634 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,32 @@ | ||
name: Build Nimlite | ||
description: "Builds Nimlite" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: "2.0.0" | ||
- name: Nimble Install dependencies | ||
shell: bash | ||
run: | | ||
nimble -y refresh | ||
nimble -y install nimpy argparse | ||
- name: Set Environment Variables | ||
uses: allenevans/[email protected] | ||
with: | ||
NIMLITE_DIR: 'nimlite' | ||
NIM_PACKAGE_NAME: 'libnimlite' | ||
TABLITE_PACKAGE_NAME: 'tablite' | ||
NIMC_FLAGS: '--gc:refc --app:lib --threads:on -d:release -d:danger' | ||
- name: Compile Debug & import (Unix) | ||
shell: bash | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
# compile the libnimlite | ||
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
- name: Compile Debug & import (Windows) | ||
shell: bash | ||
if: runner.os == 'Windows' | ||
run: | | ||
# compile the libnimlite | ||
nim c ${{ env.NIMC_FLAGS }} --tlsEmulation:off --passL:-static --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim |
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,17 @@ | ||
name: Validate Nimlite | ||
description: "Validates Nimlite build" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Compile Debug & import (Unix) | ||
shell: bash | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
# check if compiled successfully | ||
python -c "print(__import__('${{ env.NIMLITE_DIR }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" | ||
- name: Compile Debug & import (Windows) | ||
shell: bash | ||
if: runner.os == 'Windows' | ||
run: | | ||
# check if compiled successfully | ||
python -c "print(__import__('${{ env.NIMLITE_DIR }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" |
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 |
---|---|---|
|
@@ -13,21 +13,6 @@ jobs: | |
PYTHON: '3.10' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: "2.0.0" | ||
- name: Nimble Install dependencies | ||
run: | | ||
nimble -y refresh | ||
nimble -y install nimpy argparse | ||
- name: Set Environment Variables | ||
uses: allenevans/[email protected] | ||
with: | ||
NIMLITE_DIR: 'tablite/_nimlite' | ||
NIM_PACKAGE_NAME: 'nimlite' | ||
TABLITE_PACKAGE_NAME: 'tablite' | ||
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger' | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
|
@@ -38,12 +23,7 @@ jobs: | |
python -m pip install pytest | ||
python -m pip install pytest-cov | ||
python -m pip install -r requirements.txt | ||
- name: Compile Debug & import (Unix) | ||
run: | | ||
# compile the nimlite | ||
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
# check if compiled successfully | ||
python -c "print(__import__('${{ env.TABLITE_PACKAGE_NAME }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" | ||
- uses: ./.github/actions/buildnim | ||
- name: Generate Report | ||
run: | | ||
pytest --cov=tablite tests/ --cov-report=xml | ||
|
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 |
---|---|---|
|
@@ -48,14 +48,6 @@ jobs: | |
cache-dependency-path: | | ||
requirements.txt | ||
requirements_mkdocs.txt | ||
- name: Install Nim Lang | ||
uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: "2.0.0" | ||
- name: Nimble Install dependencies | ||
run: | | ||
nimble -y refresh | ||
nimble -y install nimpy argparse | ||
- name: Install PIPs | ||
run: | | ||
python -m pip install -r requirements.txt | ||
|
@@ -67,16 +59,8 @@ jobs: | |
- name: Set Env for tablite Import | ||
uses: allenevans/[email protected] | ||
with: | ||
USE_NIMPORTER: 'false' | ||
PYTHONPATH: '.:tablite' | ||
NIMLITE_DIR: 'tablite/_nimlite' | ||
NIM_PACKAGE_NAME: 'nimlite' | ||
TABLITE_PACKAGE_NAME: 'tablite' | ||
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger' | ||
- name: Compile NimLite | ||
run: | | ||
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
python -c "print(__import__('${{ env.TABLITE_PACKAGE_NAME }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" | ||
- uses: ./.github/actions/buildnim | ||
- name: Configure Git user | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
|
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 |
---|---|---|
|
@@ -11,30 +11,7 @@ jobs: | |
os: [ubuntu-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: "2.0.0" | ||
- name: Nimble Install dependencies | ||
run: | | ||
nimble -y refresh | ||
nimble -y install nimpy argparse | ||
- name: Set Environment Variables | ||
uses: allenevans/[email protected] | ||
with: | ||
NIMLITE_DIR: 'tablite/_nimlite' | ||
NIM_PACKAGE_NAME: 'nimlite' | ||
TABLITE_PACKAGE_NAME: 'tablite' | ||
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger' | ||
- name: Compile Debug & import (Unix) | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
# compile the nimlite | ||
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
- name: Compile Debug & import (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
# compile the nimlite | ||
nim c ${{ env.NIMC_FLAGS }} --tlsEmulation:off --passL:-static --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
- uses: ./.github/actions/buildnim | ||
- name: Cache Unix | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -60,8 +37,8 @@ jobs: | |
- name: Set Environment Variables | ||
uses: allenevans/[email protected] | ||
with: | ||
NIMLITE_DIR: 'tablite/_nimlite' | ||
NIM_PACKAGE_NAME: 'nimlite' | ||
NIMLITE_DIR: 'nimlite' | ||
NIM_PACKAGE_NAME: 'libnimlite' | ||
- name: Cache Restore Unix | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
@@ -76,7 +53,7 @@ jobs: | |
${{ env.NIMLITE_DIR }} | ||
- name: install python | ||
run: | | ||
python3 -m pip install --upgrade build | ||
python3 -m pip install --upgrade build | ||
- name: build wheel | ||
run: | | ||
python3 -m build --wheel | ||
|
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,39 +24,14 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: "2.0.0" | ||
- name: Nimble Install dependencies | ||
run: | | ||
nimble -y refresh | ||
nimble -y install nimpy argparse | ||
- name: Set Environment Variables | ||
uses: allenevans/[email protected] | ||
with: | ||
NIMLITE_DIR: 'tablite/_nimlite' | ||
NIM_PACKAGE_NAME: 'nimlite' | ||
TABLITE_PACKAGE_NAME: 'tablite' | ||
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger' | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
python -m pip install -r requirements.txt | ||
- name: Compile Debug & import (Unix) | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: | | ||
# compile the nimlite | ||
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
# check if compiled successfully | ||
python -c "print(__import__('${{ env.TABLITE_PACKAGE_NAME }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" | ||
- name: Compile Debug & import (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
# compile the nimlite | ||
nim c ${{ env.NIMC_FLAGS }} --tlsEmulation:off --passL:-static --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim | ||
# check if compiled successfully | ||
python -c "print(__import__('${{ env.TABLITE_PACKAGE_NAME }}.${{ env.NIM_PACKAGE_NAME }}').__file__)" | ||
- uses: ./.github/actions/buildnim | ||
- uses: ./.github/actions/validatenim | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
|
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 @@ | ||
# This is a stub file for other modules to import |
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,13 @@ | ||
# Package | ||
|
||
version = "0.1.0" | ||
author = "Ratchet" | ||
description = "Utilities for tablite to work with nim" | ||
license = "MIT" | ||
# srcDir = "nimlite" | ||
|
||
|
||
# Dependencies | ||
|
||
requires "nim >= 2.0.0" | ||
requires "nimpy >= 0.2.0" |
File renamed without changes.
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
Oops, something went wrong.