Skip to content

Commit

Permalink
Merge pull request #35 from s-ccs/python38cythonfix
Browse files Browse the repository at this point in the history
fix windows installation
  • Loading branch information
behinger authored Jan 17, 2025
2 parents eb3e1aa + 3f445be commit 663f9a8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ If you are willing to run `edf2asc` on all your files, you can use:
- Alex Kim
- Greg Schwimer
- Oscar Esteban
- Richard Veale

## Setup

Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyedfread
version = 0.3.0
version = 0.3.1
description = Read SR-Research EDF files.
keywords = psychology, neuroscience
license = BSD-2-Clause
Expand All @@ -14,8 +14,7 @@ install_requires =
numpy
pandas
h5py
package_dir =
= src
package_dir = src
packages = find:

[options.package_data]
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"""

import sys
from distutils.core import setup
from distutils.extension import Extension
#from distutils.core import setup
#from distutils.extension import Extension
from Cython.Distutils import build_ext
from setuptools import setup,find_packages, Extension
import numpy


Expand Down Expand Up @@ -49,12 +50,14 @@
"extra_link_args": ["-fopenmp"],
}


print(args)
ext_module = Extension("pyedfread.edf_read", ["src/pyedfread/edf_read.pyx"], **args)

ext_data = Extension("pyedfread.edf_data", ["src/pyedfread/edf_data.pyx"], **args)

setup(
cmdclass={'build_ext': build_ext},
ext_modules=[ext_data, ext_module],
packages = find_packages(where='src'),
package_dir = {"": "src"},
)
13 changes: 13 additions & 0 deletions src/pyedfread/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
"""Read eye-tracking information from EyeLink EDF files."""


import sys
if sys.platform.startswith("win32"):
import os
import platform
srr_basedir = r"C:\Program Files (x86)\SR Research\EyeLink"
if platform.architecture()[0] == "64bit":
arch_dir = 'x64'
else:
arch_dir = ''
# due to a change in python 3.8, the searchpath is not automatically added anymore
os.add_dll_directory(os.path.join(srr_basedir, 'libs', arch_dir))

from pyedfread.parse import read_edf
from pyedfread.edf_read import read_preamble, read_messages, read_calibration

0 comments on commit 663f9a8

Please sign in to comment.