Skip to content
Merged
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
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ if (NOT SKBUILD)
set(PYTHON_LIBRARY "${PYTHON_ROOT}/${libpython}")
endif ()

find_package(PythonExtensions REQUIRED)
find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development.Module)

add_compile_definitions(Py_BUILD_CORE) # for sizeof(PyGC_Head)
add_compile_definitions(NEED_OPCODE_TABLES) # for _PyOpcode_Caches and _PyOpcode_Deopt

add_library(_cds MODULE src/_cds/_cdsmodule.c src/_cds/lookup_table.c src/_cds/hashtable.c)
python_add_library(_cds MODULE WITH_SOABI src/_cds/_cdsmodule.c src/_cds/lookup_table.c src/_cds/hashtable.c)
# clinic-generated files access core header.
target_include_directories(_cds PRIVATE "${PYTHON_INCLUDE_DIR}/internal")
python_extension_module(_cds)

# todo: if find cpython repo, run clinic
# currently we manually run `python3 ../cpython/Tools/clinic/clinic.py --make --srcdir src/_cds`

install(TARGETS _cds LIBRARY DESTINATION "${PYTHON_RELATIVE_SITE_PACKAGES_DIR}")
install(TARGETS _cds DESTINATION .)

install(FILES src/artifacts/pycds.pth DESTINATION "${PYTHON_RELATIVE_SITE_PACKAGES_DIR}")
install(FILES src/artifacts/pycds.pth DESTINATION .)
24 changes: 23 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
[project]
name = "code-data-share"
version = "0.0.4"
readme = "README.rst"
requires-python = ">=3.8"
classifiers = [
'Development Status :: 3 - Alpha',
'Operating System :: MacOS :: MacOS X',
# 'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
]

[build-system]
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja"]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand All @@ -13,3 +32,6 @@ skip = "*-musllinux*"

[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2", "arm64"]

[tool.scikit-build]
wheel.packages = ["src/cds"]
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nox
scikit-build-core
32 changes: 0 additions & 32 deletions setup.py

This file was deleted.