Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will install Python and build sdist

name: sdist

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- dev

jobs:
build-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Build package
run: |
pip install build
# fake IDL_DIR to build source package without installing IDL
IDL_DIR=/fake-idl-dir python -m build --sdist .

- name: Store source distribution as artifact
uses: actions/upload-artifact@v4
with:
path: 'dist/idlbridge-*.tar.gz'
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.md MANIFEST.in setup.py .gitignore
recursive-include idlbridge *.py *.pyx *.pxd *.pxi *.pro VERSION
recursive-include idlbridge *.py *.pyx *.pxd *.pxi *.pro
recursive-include dev *
1 change: 0 additions & 1 deletion idlbridge/VERSION

This file was deleted.

8 changes: 7 additions & 1 deletion idlbridge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@
import ctypes as _ctypes
from . import _core

try:
from importlib.metadata import version
except ImportError:
# try-except be removed if requires-python set to >= 3.8
from importlib_metadata import version

__author__ = 'Dr. Alex Meakins'
__responsible_officer__ = 'Dr. Alex Meakins'
__version__ = "1.1.0"
__version__ = version("idlbridge")

# By default the core (IDL) library is opened by Python with RTLD_LOCAL
# preventing subsequently loaded IDL DLM libraries from seeing the IDL_*
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "Cython", "numpy"]
build-backend = "setuptools.build_meta"
36 changes: 17 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IDLBridge. If not, see <http://www.gnu.org/licenses/>.

from distutils.core import setup
from distutils.extension import Extension
from setuptools import setup, Extension
from Cython.Build import cythonize
import sys
import numpy
Expand Down Expand Up @@ -57,22 +56,18 @@
extra_compile_args = []
extra_link_args = ["-Wl,-rpath,.", "-Wl,-rpath,{}".format(idl_library_path)]

setup_path = path.dirname(path.abspath(__file__))
idl_core_sources = ["idlbridge/_core.pyx"]
idl_core = Extension(
"idlbridge._core",
idl_core_sources,
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)

# build extension list
extensions = []
for root, dirs, files in os.walk(setup_path):
for file in files:
if path.splitext(file)[1] == ".pyx":
pyx_file = path.relpath(path.join(root, file), setup_path)
module = path.splitext(pyx_file)[0].replace("/", ".")
extensions.append(Extension(module,
[pyx_file],
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args))
extensions = [idl_core]

if profile:
directives = {"profile": True}
Expand All @@ -83,6 +78,7 @@
name="idlbridge",
version=__version__,
description="An IDL wrapper for Python",
requires_python=">=3.4",
author='Dr. Alex Meakins',
author_email='alex.meakins@ukaea.uk',
license="LGPLv3",
Expand All @@ -96,8 +92,10 @@
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering"
],
# setup_requires=["cython>=0.19"],
# install_requires=["cython>=0.19"],
install_requires=[
"importlib_metadata>=0.1 ; python_version < \"3.8\"",
"numpy",
],
packages=["idlbridge"],
ext_modules=cythonize(extensions, force=force, compiler_directives=directives)
)