# from WMCore import __version__ # But PYTHONPATH isn't set until after the package is built, so we can't # depend on the python module resolution behavior to load the version. # Instead, we use the imp module to load the source file directly by # filename. wmcore_root = get_path_to_wmcore_root() wmcore_package = imp.load_source('temp_module', os.path.join(wmcore_root, 'src', 'python', 'WMCore', '__init__.py')) wmcore_version = wmcore_package.__version__ setup(name='wmcore', version=wmcore_version, maintainer='CMS DMWM Group', maintainer_email='*****@*****.**', cmdclass={'deep_clean': CleanCommand, 'coverage': CoverageCommand, 'test': TestCommand, 'env': EnvCommand, 'build_system': BuildCommand, 'install_system': InstallCommand}, # base directory for all our packages package_dir={'': 'src/python/'}, # % get_path_to_wmcore_root()}, packages=DEFAULT_PACKAGES, data_files=list_static_files(), url="https://github.com/dmwm/WMCore", download_url="https://github.com/dmwm/WMCore/tarball/%s" % wmcore_version )
def parse_requirements(requirements_file): """ Create a list for the 'install_requires' component of the setup function by parsing a requirements file """ if os.path.exists(requirements_file): # return a list that contains each line of the requirements file return open(requirements_file, 'r').read().splitlines() else: print("ERROR: requirements file " + requirements_file + " not found.") sys.exit(1) setup( name='wmcore', version=wmcore_version, maintainer='CMS DMWM Group', maintainer_email='*****@*****.**', package_dir={'': 'src/python/'}, packages=list_packages([ 'src/python/Utils', 'src/python/WMCore', 'src/python/WMComponent', 'src/python/WMQuality', 'src/python/PSetTweaks' ]), data_files=list_static_files(), install_requires=parse_requirements(requirements), url="https://github.com/dmwm/WMCore", license="Apache License, Version 2.0", )
from __future__ import print_function, division import os import sys from setuptools import setup, Command from setup_build import list_static_files, things_to_build from setup_dependencies import dependencies # get the WMCore version (thanks rucio devs) sys.path.insert(0, os.path.abspath('src/python')) from WMCore import __version__ wmcore_version = __version__ # the contents of package_name are modified via tools/build_pypi_packages.sh package_name = "PACKAGE_TO_BUILD" packages, py_modules = things_to_build(package_name, pypi=True) data_files = list_static_files(dependencies[package_name]) # we need to override 'clean' command to remove specific files class CleanCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): os.system('rm -rfv ./dist ./src/python/*.egg-info')