Skip to content

Commit

Permalink
Merge pull request #90 from realratchet/master
Browse files Browse the repository at this point in the history
New attempt of packaging
  • Loading branch information
realratchet authored Oct 5, 2023
2 parents 18700d6 + eae98ee commit ac7e086
Show file tree
Hide file tree
Showing 24 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set Environment Variables
uses: allenevans/set-env@v2.0.0
with:
NIMLITE_DIR: '_nimlite'
NIMLITE_DIR: 'tablite/_nimlite'
NIM_PACKAGE_NAME: 'nimlite'
TABLITE_PACKAGE_NAME: 'tablite'
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Set Environment Variables
uses: allenevans/set-env@v2.0.0
with:
NIMLITE_DIR: '_nimlite'
NIMLITE_DIR: 'tablite/_nimlite'
NIM_PACKAGE_NAME: 'nimlite'
TABLITE_PACKAGE_NAME: 'tablite'
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger'
Expand All @@ -51,16 +51,16 @@ jobs:
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: MSVC
if: runner.os == 'Windows'
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
# - name: MSVC
# if: runner.os == 'Windows'
# uses: TheMrMilchmann/setup-msvc-dev@v3
# with:
# arch: x64
- 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 }}.exe ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim
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
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
long_description=long_description,
long_description_content_type="text/markdown",
keywords=keywords,
packages=["tablite", "_nimlite"],
packages=["tablite", "tablite/_nimlite"],
package_data={
"_nimlite": ["**/*.so", "**/*.pyd", "**/*.nim"], # pack builds and nim source
"tablite": ["**/_nimlite/nimlite.so", "**/_nimlite/nimlite.pyd", "**/*.pyi"], # pack builds
},
python_requires=">=3.8",
include_package_data=True,
Expand Down
Empty file added tablite/_nimlite/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added tablite/_nimlite/nimlite
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added tablite/_nimlite/nimlite.so
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tablite/nimlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
IS_WINDOWS = platform.system() == "Windows"
USE_CLI_BACKEND = IS_WINDOWS

CLI_BACKEND_PATH = Path(__file__).parent.parent / f"_nimlite/nimlite{'.exe' if IS_WINDOWS else ''}"
CLI_BACKEND_PATH = Path(__file__).parent / f"_nimlite/nimlite{'.exe' if IS_WINDOWS else ''}"

if not USE_CLI_BACKEND:
paths = sys.argv[:]
if Config.USE_NIMPORTER:
import nimporter

nimporter.Nimporter.IGNORE_CACHE = True
import _nimlite.nimlite as nl
import tablite._nimlite.nimlite as nl

sys.argv.clear()
sys.argv.extend(paths) # importing nim module messes with pythons launch arguments!!!
Expand Down
2 changes: 1 addition & 1 deletion tablite/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
major, minor, patch = 2023, 8, "dev1"
major, minor, patch = 2023, 8, "dev2"
__version_info__ = (major, minor, patch)
__version__ = ".".join(str(i) for i in __version_info__)

0 comments on commit ac7e086

Please sign in to comment.