Skip to content

Commit

Permalink
adding all jl files to package-data, updating pytest to use path rela…
Browse files Browse the repository at this point in the history
…tive to install
  • Loading branch information
rallen10 committed Dec 3, 2024
1 parent e66a117 commit 3eef2e3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UNRELEASED] - XXXX.XX.XX

### Fixed

+ Private-source julia files included as setuptools package-data so that they are present when pip installing kspdg
+ test_jl_solvers.py imports julia files from kspdg install point, not from relative path from test script, to ensure files are present at install point

## [0.9.1] - 2024.12.02

### Added
Expand Down
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,27 @@ kspdg = [
"private_src/python3_9/Darwin_arm64/pyarmor_runtime_000000/*.so",
"private_src/python3_9/Darwin_arm64/kspdg_envs/lbg1/*.jl",
"private_src/python3_9/Darwin_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_9/Darwin_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_9/Linux_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_9/Linux_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_9/Windows_x86_64/pyarmor_runtime_000000/*.pyd",
"private_src/python3_9/Windows_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_12/Darwin_arm64/pyarmor_runtime_000000/*.so",
"private_src/python3_12/Darwin_arm64/kspdg_envs/lbg1/*.jl",
"private_src/python3_12/Darwin_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_12/Darwin_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_12/Linux_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_12/Linux_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_12/Windows_x86_64/pyarmor_runtime_000000/*.pyd",
"private_src/python3_12/Windows_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_13/Darwin_arm64/pyarmor_runtime_000000/*.so",
"private_src/python3_13/Darwin_arm64/kspdg_envs/lbg1/*.jl",
"private_src/python3_13/Darwin_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_13/Darwin_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_13/Linux_x86_64/pyarmor_runtime_000000/*.so",
"private_src/python3_13/Windows_x86_64/pyarmor_runtime_000000/*.pyd"
"private_src/python3_13/Linux_x86_64/kspdg_envs/lbg1/*.jl",
"private_src/python3_13/Windows_x86_64/pyarmor_runtime_000000/*.pyd",
"private_src/python3_13/Windows_x86_64/kspdg_envs/lbg1/*.jl"
]

# Further dependencies for dev, testing, and envrionments with advanced bots
Expand Down
2 changes: 1 addition & 1 deletion src/kspdg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Single-sourcing package version
# https://packaging.python.org/guides/single-sourcing-package-version/

__version__ = "0.9.2-alpha"
__version__ = "0.9.2-2"

# these imports make the individual environments accessible at the top-level
# of the library and assign an environment version number
Expand Down
17 changes: 14 additions & 3 deletions tests/serverless_tests/test_jl_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@
import numpy as np

from pathlib import Path
from importlib.resources import files

from kspdg.utils.private_src_utils import get_private_src_module_str

THIS_FILE = Path(__file__)

#--- Get path to solve_lbg1.jl from kspdg installation point
# (e.g. may be local to this file if pip installed editably or within a
# conda environment somewhere else in the file system)

# PosixPath to kspdg installation point
KSPDG_INSTALL_PATH = files('kspdg')

# Path to solve_lbg1.jl relative to kspdg install point, accounting for
# python version and OS-specific directories
SOLVE_LBG1_JL_PATH = get_private_src_module_str("kspdg_envs.lbg1")
SOLVE_LBG1_JL_PATH = SOLVE_LBG1_JL_PATH.replace('.','/')
SOLVE_LBG1_JL_PATH = "../../src/"+SOLVE_LBG1_JL_PATH+"/solve_lbg1.jl"
SOLVE_LBG1_JL_PATH = Path(THIS_FILE.parent, SOLVE_LBG1_JL_PATH)
SOLVE_LBG1_JL_PATH = SOLVE_LBG1_JL_PATH.partition('/')[2]

# Join the solve_lbg1.jl relative path to kspdg absolute path
SOLVE_LBG1_JL_PATH = KSPDG_INSTALL_PATH / SOLVE_LBG1_JL_PATH / "solve_lbg1.jl"

def test_solve_lbg1_jl_import():
"""check import of solve_lbg1.jl does not error"""
Expand Down

0 comments on commit 3eef2e3

Please sign in to comment.