Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:58:23

0001 #!/usr/bin/env python
0002 #
0003 # Licensed under the Apache License, Version 2.0 (the "License");
0004 # You may not use this file except in compliance with the License.
0005 # You may obtain a copy of the License at
0006 # http://www.apache.org/licenses/LICENSE-2.0OA
0007 #
0008 # Authors:
0009 # - Wen Guan, <wen.guan@cern.ch>, 2019 - 2025
0010 
0011 # Metadata is in pyproject.toml. This file handles data_files and scripts
0012 # which require glob patterns not supported in pyproject.toml.
0013 
0014 
0015 import glob
0016 import io
0017 import os
0018 
0019 from setuptools import setup
0020 
0021 data_files = [
0022     ('etc/idds/', glob.glob('etc/idds/*.template')),
0023     ('etc/idds/rest', glob.glob('etc/idds/rest/*')),
0024     ('etc/idds/auth', glob.glob('etc/idds/auth/*template')),
0025     ('etc/idds/website', glob.glob('etc/idds/website/*')),
0026     ('etc/idds/supervisord.d', glob.glob('etc/idds/supervisord.d/*')),
0027     ('etc/idds/condor/client', glob.glob('etc/idds/condor/client/*')),
0028     ('etc/idds/condor/server', glob.glob('etc/idds/condor/server/*')),
0029     ('etc/condor/collector', glob.glob('etc/condor/collector/*')),
0030     ('etc/condor/submitter', glob.glob('etc/condor/submitter/*')),
0031     ('etc/panda', glob.glob('etc/panda/*')),
0032     ('etc/sql', glob.glob('etc/sql/*')),
0033     ('config_default/', glob.glob('config_default/*')),
0034     ('tools/env/', glob.glob('tools/env/*')),
0035 ]
0036 
0037 scripts = glob.glob('bin/*')
0038 
0039 # Generate bin/idds.wsgi from its template at build time.
0040 # The template computes IDDS_CONFIG from sys.prefix at runtime, so no
0041 # build-time paths are baked in — we simply copy it.
0042 wsgi_template = 'bin/idds.wsgi.template'
0043 if os.path.exists(wsgi_template):
0044     wsgi_out = wsgi_template.replace('.template', '')
0045     with io.open(wsgi_template, 'r', encoding='utf8') as f:
0046         content = f.read()
0047     with io.open(wsgi_out, 'w', encoding='utf8') as f:
0048         f.write(content)
0049 
0050 setup(
0051     data_files=data_files,
0052     scripts=scripts,
0053 )