Skip to content

Commit

Permalink
Merge pull request #28 from DougBurke/config-clean-up
Browse files Browse the repository at this point in the history
build: internal clean-up of the configuration code
  • Loading branch information
DougBurke authored Oct 8, 2024
2 parents 5b8afc4 + 0a2295e commit f404cb7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changes in xspec-models-cxc

## 0.0.31

Internal minor clean-up of the configuration code: remove tracking
of the model.dat file from the MANIFEST, avoid an un-used import
from the refactoring done in 0.0.30, and move the include directory
into xspec_models_cxc/ so it is more-obvious why is is installed
(although it probably should be done more as some form of a data-file).

## 0.0.30

Potential build improvements, including support for using the CXC
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ include LICENSE
include README.md
include scripts/doc-example.py
include scripts/example.py
include scripts/report_models.py
include scripts/smaug.py
include scripts/example-additive.png
include scripts/example-multiplicative.png
include scripts/example-convolution.png

include src/include/xspec_models_cxc.hh
include src/xspec_models_cxc/include/xspec_models_cxc.hh
16 changes: 5 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
#
sys.path.append(os.path.dirname(__file__))

from helpers import template

# How can we best set this up?
__version__ = "0.0.30"
__version__ = "0.0.31"


def helper(script: str, *args: str) -> list[str]:
Expand Down Expand Up @@ -129,11 +127,8 @@ def compile_code(inc_path, lib_path):

macros = [('VERSION_INFO', __version__)]

out_dir = Path('src')
out_dir = Path('src/xspec_models_cxc')

# Note: we need access to the src/include directory - can we just
# hard-code this path or access it via some setuptools method?
#
include_dir = out_dir / 'include'
if not include_dir.is_dir():
sys.stderr.write(f'ERROR: unable to find {include_dir}/')
Expand All @@ -144,8 +139,8 @@ def compile_code(inc_path, lib_path):
# Process the model.dat file and the templates to create the module
# (C++ and Python).
#
compiled_code = out_dir / 'xspec_models_cxc' / 'xspec.cxx'
python_code = out_dir / 'xspec_models_cxc' / '__init__.py'
compiled_code = out_dir / 'xspec.cxx'
python_code = out_dir / '__init__.py'

helper("apply_templates.py", str(modeldat), xspec_version,
str(compiled_code), str(python_code))
Expand All @@ -157,8 +152,7 @@ def compile_code(inc_path, lib_path):
ext_modules = [
Pybind11Extension("xspec_models_cxc._compiled",
[str(compiled_code)],
depends=[str(modeldat),
str('template/xspec.cxx') # is this useful?
depends=[str('template/xspec.cxx') # is this useful?
],
cxx_std=11,
include_dirs=[str(include_dir),
Expand Down
File renamed without changes.

0 comments on commit f404cb7

Please sign in to comment.