Added support for cython when we want to use it in the future
Moved the glob to the manifest.in file
This commit is contained in:
parent
4cc8f05b50
commit
ae11106e5d
4
.gitignore
vendored
4
.gitignore
vendored
@ -6,6 +6,10 @@ __pycache__/
|
|||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
|
||||||
|
# Cython
|
||||||
|
*.c
|
||||||
|
*.html
|
||||||
|
|
||||||
# Distribution / packaging
|
# Distribution / packaging
|
||||||
.Python
|
.Python
|
||||||
build/
|
build/
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
graft amulet_map_editor
|
graft amulet_map_editor
|
||||||
include README.md
|
|
||||||
include requirements.txt
|
include requirements.txt
|
||||||
include versioneer.py
|
include versioneer.py
|
||||||
include icon.ico
|
include icon.ico
|
||||||
prune */__pycache__/*
|
prune */__pycache__/*
|
||||||
global-exclude *.py[cod]
|
global-exclude *.py[cod]
|
||||||
|
global-exclude *.c
|
||||||
|
global-exclude *.html
|
||||||
|
global-exclude *.log
|
||||||
|
global-exclude *.md
|
||||||
|
@ -3,6 +3,7 @@ requires = [
|
|||||||
"setuptools >= 42",
|
"setuptools >= 42",
|
||||||
"wheel",
|
"wheel",
|
||||||
"cython >= 0.29.13",
|
"cython >= 0.29.13",
|
||||||
"versioneer-518"
|
"versioneer-518",
|
||||||
|
"numpy"
|
||||||
]
|
]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
21
setup.py
21
setup.py
@ -1,9 +1,11 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from Cython.Build import cythonize
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
import numpy
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import versioneer
|
import versioneer
|
||||||
@ -51,19 +53,18 @@ try:
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
package_data = [
|
if next(glob.iglob("amulet_map_editor/**/*.pyx", recursive=True), None):
|
||||||
os.path.relpath(path, "amulet_map_editor")
|
# This throws an error if it does not match any files
|
||||||
for path in set(
|
ext = cythonize("amulet_map_editor/**/*.pyx")
|
||||||
glob.glob(os.path.join("amulet_map_editor", "**", "*.*"), recursive=True)
|
else:
|
||||||
)
|
ext = ()
|
||||||
- set(
|
|
||||||
glob.glob(os.path.join("amulet_map_editor", "**", "*.py[cod]"), recursive=True)
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
install_requires=required_packages,
|
install_requires=required_packages,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
package_data={"amulet_map_editor": package_data},
|
include_package_data=True,
|
||||||
cmdclass=versioneer.get_cmdclass(),
|
cmdclass=versioneer.get_cmdclass(),
|
||||||
|
ext_modules=ext,
|
||||||
|
include_dirs=[numpy.get_include()],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user