Compare commits

...

2 Commits

@ -21,6 +21,9 @@ __pycache__/
# file generated by setuptools_scm
/src/pEp/__version__.py
# file generated by cython
/src/pEp/_pEp_cython/*.c
# Doc artifacts
/docs/build/

@ -85,6 +85,7 @@ clean: clean-docs
rm -rf $(PYTHON_ARTIFACTS)
rm -rf $(VERSION_FILE)
rm -rf $(BUILD_INPLACE)
rm -rf $(CYTHON_ARTIFACTS)
clean-docs:
make clean -C docs/

@ -9,6 +9,8 @@ PYTHON_ARTIFACTS += ./.eggs
PYTHON_ARTIFACTS += ./src/pEp.egg-info
PYTHON_ARTIFACTS += ./.pytest_cache
VENV_DIR = ./venv
CYTHON_ARTIFACTS = src/pEp/_pEp_cython/__init__.cpython-38-darwin.so
CYTHON_ARTIFACTS += src/pEp/_pEp_cython/__init__.c
# Build config Defaults
DEBUG=0

@ -1,5 +1,13 @@
[build-system]
requires = ["setuptools >=39.2.0", "setuptools_scm >= 4.1.2", "wheel >= 0.35.1"]
# Preparing for PEP-517/PEP-518, but not in effect yet.
# These requires are not effective yet, setup.cfg is.
requires =[
"setuptools >=39.2.0",
"setuptools_scm >= 4.1.2",
"wheel >= 0.35.1",
"Cython >= 0.29.21" ]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]

@ -35,6 +35,7 @@ setup_requires =
setuptools >=39.2.0
setuptools_scm >= 4.1.2
wheel >= 0.35.1
Cython >= 0.29.21
[options.extras_require]
# To install these dependencies, run pip install .[test]
test =

@ -17,6 +17,7 @@ from setuptools import setup, Extension
from glob import glob
from setuptools.command.build_ext import build_ext
from Cython.Build import cythonize
def pEpLog(*msg):
@ -149,7 +150,6 @@ class BuildExtCommand(build_ext):
includes = []
libdirs = []
# Append prefix-dir
if self.prefix:
prefix_include = [join(self.prefix, 'include')]
@ -193,23 +193,26 @@ if sys.version_info[0] < 3:
FileNotFoundError = EnvironmentError
module_pEp = Extension(
'pEp._pEp',
sources=[
'src/pEp/_pEp/pEpmodule.cc',
'src/pEp/_pEp/basic_api.cc',
'src/pEp/_pEp/identity.cc',
'src/pEp/_pEp/message.cc',
'src/pEp/_pEp/message_api.cc',
'src/pEp/_pEp/str_attr.cc',
# 'src/pEp/_pEp/user_interface.cc',
],
)
'pEp._pEp',
sources=[
'src/pEp/_pEp/pEpmodule.cc',
'src/pEp/_pEp/basic_api.cc',
'src/pEp/_pEp/identity.cc',
'src/pEp/_pEp/message.cc',
'src/pEp/_pEp/message_api.cc',
'src/pEp/_pEp/str_attr.cc',
# 'src/pEp/_pEp/user_interface.cc',
],
)
modules = cythonize("src/pEp/_pEp_cython/__init__.pyx")
modules.append(module_pEp)
# "MAIN" Function
setup(
package_dir={'': 'src'},
packages=['pEp'],
ext_modules=[module_pEp],
ext_modules=modules,
cmdclass={
'build_ext': BuildExtCommand,
},
@ -217,7 +220,7 @@ setup(
# see https://github.com/pypa/setuptools_scm/#setupcfg-usage
use_scm_version={
'write_to': 'src/pEp/__version__.py',
#TODO: fallback_version does not seem to work in case os missing tag
'fallback_version' : '0.0.0-RC0'
# TODO: fallback_version does not seem to work in case os missing tag
'fallback_version': '0.0.0-RC0'
}
)

@ -25,10 +25,12 @@ except ImportError:
# Imports all symbols EXCEPT the ones beginning with underscore
from ._pEp import *
from ._pEp_cython import *
# import the native module into the current namespace because we also need to access the names beginning
# with an underscore (of _pEp), but we dont want to import them into this module
import pEp._pEp
import pEp._pEp_cython
# Executed on module import
def init():

@ -0,0 +1,7 @@
cimport pEp
def engine_version():
return pEp.get_engine_version()

@ -0,0 +1,14 @@
# pEp.pxd
cdef extern from "/Users/heck/local-default/include/pEp/pEpEngine.h":
const char* get_engine_version();
# void set_debug_color(PEP_SESSION session, int ansi_color);
cdef struct _pEpSession:
pass
ctypedef _pEpSession *PEP_SESSION;
Loading…
Cancel
Save