mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
python: run sdist in build process
This commit is contained in:
parent
a05e54ca7e
commit
53df21b977
@ -513,11 +513,12 @@ write_basic_package_version_file(
|
||||
if(${BUILD_PYTHON})
|
||||
find_package(Python3 COMPONENTS Development Interpreter REQUIRED)
|
||||
file(GLOB PYSRC CONFIGURE_DEPENDS python/src/notcurses/*.py)
|
||||
file(COPY python/src/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python/)
|
||||
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.py.in")
|
||||
file(COPY python/src/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python/src)
|
||||
file(COPY python/README.md DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python)
|
||||
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/tools/setup.py.in")
|
||||
set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py")
|
||||
set(SETUP_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.cfg.in")
|
||||
set(SETUP_CFG "${CMAKE_CURRENT_BINARY_DIR}/setup.cfg")
|
||||
set(SETUP_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/tools/setup.cfg.in")
|
||||
set(SETUP_CFG "${CMAKE_CURRENT_BINARY_DIR}/python/setup.cfg")
|
||||
configure_file(${SETUP_PY_IN} ${SETUP_PY})
|
||||
configure_file(${SETUP_CFG_IN} ${SETUP_CFG})
|
||||
add_custom_command(
|
||||
@ -526,7 +527,6 @@ if(${BUILD_PYTHON})
|
||||
COMMAND
|
||||
"${Python3_EXECUTABLE}" ${SETUP_PY} build_ext -L ${CMAKE_CURRENT_BINARY_DIR} -b ${CMAKE_CURRENT_BINARY_DIR}/python -t${CMAKE_CURRENT_BINARY_DIR}/python &&
|
||||
"${Python3_EXECUTABLE}" ${SETUP_PY} build_py &&
|
||||
"${Python3_EXECUTABLE}" ${SETUP_PY} egg_info -b ${CMAKE_CURRENT_BINARY_DIR}/python &&
|
||||
"${Python3_EXECUTABLE}" ${SETUP_PY} sdist
|
||||
DEPENDS
|
||||
${PYSRC} ${SETUP_PY} ${SETUP_CFG} notcurses
|
||||
|
@ -1,15 +0,0 @@
|
||||
from setuptools import setup, find_packages
|
||||
import os
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
if __name__ == '__main__':
|
||||
setup(name='notcurses',
|
||||
version='${PROJECT_VERSION}',
|
||||
package_dir={ '': '${CMAKE_CURRENT_BINARY_DIR}/python/notcurses' },
|
||||
packages=find_packages('${CMAKE_CURRENT_BINARY_DIR}/python/notcurses'),
|
||||
cffi_modules=['${CMAKE_CURRENT_BINARY_DIR}/python/notcurses/build_notcurses.py:ffibuild'],
|
||||
py_modules=["notcurses"],
|
||||
include_dirs=['${CMAKE_CURRENT_SOURCE_DIR}/include']
|
||||
)
|
35
tools/setup.py.in
Normal file
35
tools/setup.py.in
Normal file
@ -0,0 +1,35 @@
|
||||
from setuptools import setup, find_packages
|
||||
import os
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
if __name__ == '__main__':
|
||||
setup(name='notcurses',
|
||||
version='${PROJECT_VERSION}',
|
||||
package_dir={ '': '${CMAKE_CURRENT_BINARY_DIR}/python/src/notcurses' },
|
||||
packages=find_packages('${CMAKE_CURRENT_BINARY_DIR}/python/src/notcurses'),
|
||||
cffi_modules=['${CMAKE_CURRENT_BINARY_DIR}/python/src/notcurses/build_notcurses.py:ffibuild'],
|
||||
py_modules=["notcurses"],
|
||||
include_dirs=['${CMAKE_CURRENT_SOURCE_DIR}/include'],
|
||||
long_description=read('${CMAKE_CURRENT_SOURCE_DIR}/README.md'),
|
||||
zip_safe=True,
|
||||
platforms=["any"],
|
||||
long_description_content_type="text/markdown",
|
||||
install_requires=["cffi>=1.0.0"],
|
||||
setup_requires=["cffi>=1.0.0"],
|
||||
# see https://pypi.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: Console',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Natural Language :: English',
|
||||
'Programming Language :: Python',
|
||||
],
|
||||
author="Nick Black",
|
||||
author_email="nickblack@linux.com",
|
||||
description="Blingful TUI construction library (python bindings)",
|
||||
keywords="ncurses curses tui console graphics",
|
||||
license='Apache License, Version 2.0',
|
||||
url='https://github.com/dankamongmen/notcurses'
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user