예제 #1
0
import sys, site

# do standard skbuild setup
from packaging.version import LegacyVersion
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version
from skbuild import setup  # This line replaces 'from setuptools import setup'

# Add CMake as a build requirement if cmake is not installed or too old
setup_requires = []
try:
    if LegacyVersion(get_cmake_version()) < LegacyVersion("3.10"):
        setup_requires.append('cmake>=3.10')
except SKBuildError:
    setup_requires.append('cmake>=3.10')
setup_requires.append('numpy>=1.10')

with open('README.md', 'r') as fh:
    readme_file = fh.readlines()

long_description = ""
for line in readme_file[3:]:
    if line.rstrip() == "Quick Install":
        break
    else:
        long_description += line

long_description += "### Quick Install\n Tasmanian supports `--user` and venv install only, see the on-line documentation for details.\n"

# find out whether this is a virtual environment, real_prefix is an older test, base_refix is the newer one
if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix')
예제 #2
0
파일: setup.py 프로젝트: 00mjk/pycompwa
try:
    from skbuild import setup
except ImportError:
    print('scikit-build is required to build from source.', file=sys.stderr)
    print('Please run:', file=sys.stderr)
    print('', file=sys.stderr)
    print('  python -m pip install scikit-build')
    sys.exit(1)

# Add CMake as a build requirement if cmake is not installed or is too low a
# version
CMAKE_MINIMUM = "3.4"
SETUP_REQUIRES = []
try:
    if LegacyVersion(get_cmake_version()) < LegacyVersion(CMAKE_MINIMUM):
        SETUP_REQUIRES.append('cmake')
except SKBuildError:
    SETUP_REQUIRES.append('cmake')

DATA_FILES = [
    ('pycompwa/', [
        './ComPWA/Physics/particle_list.xml',
    ]),
]

setup(
    name='pycompwa',
    version='0.1-alpha6',
    author='The ComPWA team',
    maintainer_email="*****@*****.**",
예제 #3
0
        tf_spec = FileFinder(site_packages).find_spec("tensorflow")

# get install dir from spec
try:
    tf_install_dir = tf_spec.submodule_search_locations[0]  # type: ignore
    # AttributeError if ft_spec is None
    # TypeError if submodule_search_locations are None
    # IndexError if submodule_search_locations is an empty list
except (AttributeError, TypeError, IndexError):
    setup_requires.extend(extras_require['cpu'])
    # setuptools will re-find tensorflow after installing setup_requires
    tf_install_dir = None

# add cmake as a build requirement if cmake>3.7 is not installed
try:
    cmake_version = get_cmake_version()
except SKBuildError:
    setup_requires.append("cmake")
else:
    if cmake_version in SpecifierSet("<3.7"):
        setup_requires.append("cmake")

Path("deepmd").mkdir(exist_ok=True)

setup(
    name="deepmd-kit",
    setup_requires=setup_requires,
    use_scm_version={"write_to": "deepmd/_version.py"},
    author="Han Wang",
    author_email="*****@*****.**",
    description=
예제 #4
0
import setuptools
import os
import sys
from skbuild import setup
from skbuild.constants import CMAKE_INSTALL_DIR, skbuild_plat_name
from packaging.version import LegacyVersion
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version

# Add CMake as a build requirement if cmake is not installed or is too low a version
setup_requires = []
try:
    cmake_version = LegacyVersion(get_cmake_version())
    if cmake_version < LegacyVersion("3.5") or cmake_version >= LegacyVersion(
            "3.15"):
        setup_requires.append('cmake<3.15')
except SKBuildError:
    setup_requires.append('cmake<3.15')

# If you want to re-build the cython cpp file (DracoPy.cpp), run:
# cython --cplus -3 -I./_skbuild/linux-x86_64-3.7/cmake-install/include/draco/ ./src/TrakoDracoPy.pyx
# Replace "linux-x86_64-3.6" with the directory under _skbuild in your system
# Draco must already be built/setup.py already be run before running the above command

src_dir = './src'
lib_dir = os.path.abspath(os.path.join(CMAKE_INSTALL_DIR(), 'lib/'))
cmake_args = []
if sys.platform == 'darwin':
    plat_name = skbuild_plat_name()
    sep = [pos for pos, char in enumerate(plat_name) if char == '-']
    assert len(sep) == 2
예제 #5
0
파일: setup.py 프로젝트: anthonytw/dutyroll
import sys

from packaging.version import LegacyVersion
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version
from skbuild import setup

setup_requires = []

# Require pytest-runner only when running tests.
if any(arg in sys.argv for arg in ('pytest', 'test')):
    setup_requires.append('pytest-runner>=2.0')

# Add CMake as a build requirement if cmake is not installed or is too low a version.
try:
    if LegacyVersion(get_cmake_version()) < LegacyVersion('3.10'):
        setup_requires.append('cmake')
except SKBuildError:
    setup_requires.append('cmake')

setup(name='dutyroll',
      version='1.0.1',
      description='Parallel implementation of rolling window duty cycle.',
      author='"Anthony Wertz"<*****@*****.**>',
      license='MIT',
      packages=['dutyroll'],
      tests_require=['pytest'],
      setup_requires=setup_requires)