Commit d93071dc authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

cleans up __init__.py and setup.py

parent f5720cc6
Pipeline #109395 passed with stages
in 32 minutes and 43 seconds
...@@ -498,6 +498,11 @@ configure_file( ...@@ -498,6 +498,11 @@ configure_file(
"${PROJECT_SOURCE_DIR}/TurTLE/__init__.py.in" "${PROJECT_SOURCE_DIR}/TurTLE/__init__.py.in"
"${PROJECT_SOURCE_DIR}/TurTLE/__init__.py" "${PROJECT_SOURCE_DIR}/TurTLE/__init__.py"
@ONLY) @ONLY)
# update setup.py
configure_file(
"${PROJECT_SOURCE_DIR}/setup.py.in"
"${PROJECT_BINARY_DIR}/python/setup.py"
@ONLY)
# copy command # copy command
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/TurTLE ${PROJECT_BINARY_DIR}/python/TurTLE/)") install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/TurTLE ${PROJECT_BINARY_DIR}/python/TurTLE/)")
if(EXISTS "${PROJECT_BINARY_DIR}/host_info.py") if(EXISTS "${PROJECT_BINARY_DIR}/host_info.py")
...@@ -509,7 +514,7 @@ else() ...@@ -509,7 +514,7 @@ else()
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/pc_host_info.py ${PROJECT_BINARY_DIR}/python/TurTLE/host_info.py)") install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/pc_host_info.py ${PROJECT_BINARY_DIR}/python/TurTLE/host_info.py)")
endif() endif()
endif() endif()
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/setup.py install --force --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python/)") install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py install --force --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python/)")
##################################################################################### #####################################################################################
......
...@@ -24,28 +24,11 @@ ...@@ -24,28 +24,11 @@
import os import os
import sys
import pickle
import pkg_resources __version__ = '@TURTLE_VERSION_LONG@'
try:
__version__ = pkg_resources.require('TurTLE')[0].version
_dist = pkg_resources.get_distribution('TurTLE')
dist_loc = os.path.realpath(_dist.location)
lib_dir = os.path.join(dist_loc, 'TurTLE')
except:
__version__ = '@TURTLE_VERSION_LONG@'
dist_loc = None
lib_dir = None
data_dir = os.path.join('@CMAKE_INSTALL_PREFIX@', 'share/TurTLE-@TURTLE_VERSION_LONG@') data_dir = os.path.join('@CMAKE_INSTALL_PREFIX@', 'share/TurTLE-@TURTLE_VERSION_LONG@')
here = os.path.normcase(__file__)
homefolder = os.path.expanduser('~')
from .host_info import host_info from .host_info import host_info
from .DNS import DNS from .DNS import DNS
......
...@@ -26,65 +26,20 @@ ...@@ -26,65 +26,20 @@
AUTHOR = 'Cristian C Lalescu' AUTHOR = 'Cristian C Lalescu'
AUTHOR_EMAIL = 'Cristian.Lalescu@ds.mpg.de' AUTHOR_EMAIL = 'Cristian.Lalescu@ds.mpg.de'
import os
import shutil
import datetime
import sys
import subprocess
import pickle import pickle
### package versioning ### package versioning
import get_version VERSION = '@TURTLE_VERSION_LONG@'
VERSION = get_version.main()
print('This is TurTLE version ' + VERSION) print('This is TurTLE version ' + VERSION)
import distutils.cmd
class CompileLibCommand(distutils.cmd.Command):
description = 'Compile TurTLE library.'
user_options = [
('timing-output=', None, 'Toggle timing output.'),
('fftw-estimate=', None, 'Use FFTW ESTIMATE.'),
('split-fftw-many=', None, 'Turn on SPLIT_FFTW_MANY.'),
('disable-fftw-omp=', None, 'Turn Off FFTW OpenMP.'),
]
def initialize_options(self):
self.timing_output = 0
self.fftw_estimate = 0
self.disable_fftw_omp = 0
self.split_fftw_many = 0
return None
def finalize_options(self):
self.timing_output = (int(self.timing_output) == 1)
self.split_fftw_many = (int(self.split_fftw_many) == 1)
self.fftw_estimate = (int(self.fftw_estimate) == 1)
self.disable_fftw_omp = (int(self.disable_fftw_omp) == 1)
return None
def run(self):
### save compiling information
pickle.dump(
{'install_date' : now,
'VERSION' : VERSION,
'git_revision' : git_revision},
open('turtle/install_info.pickle', 'wb'),
protocol = 2)
return None
from setuptools import setup from setuptools import setup
setup( setup(
name = 'TurTLE', name = 'TurTLE',
packages = ['TurTLE', 'TurTLE/test'], packages = ['TurTLE', 'TurTLE/test'],
install_requires = ['numpy>=1.8', 'h5py>=2.2.1'], install_requires = ['numpy>=1.8', 'h5py>=2.2.1'],
package_data = {'TurTLE': ['test/B32p1e4_checkpoint_0.h5', # package data is installed by CMake
'test/particle_set/NSVEparticle_set.hpp', #package_data = {'TurTLE': []},
'test/particle_set/NSVEparticle_set.cpp',
'test/profiler/scalar_evolution.hpp',
'test/profiler/scalar_evolution.cpp',
'test/profiler/Kraichnan_scalar_v1.hpp',
'test/profiler/Kraichnan_scalar_v1.cpp',
]},
entry_points = { entry_points = {
'console_scripts': [ 'console_scripts': [
'turtle = TurTLE.__main__:main', 'turtle = TurTLE.__main__:main',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment