-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pypi packaging for wmcore and wmagent
- Loading branch information
Showing
7 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
include setup_*.py | ||
include requirements.txt | ||
include LICENSE | ||
include NOTICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# All dependencies needed to run WMAgent | ||
Cheetah==2.4.0 | ||
CherryPy==5.4.0 | ||
Markdown==3.0.1 | ||
MySQL-python==1.2.5 | ||
SQLAlchemy==1.3.3 | ||
Sphinx==1.3.5 | ||
cx-Oracle==5.2.1 | ||
dbs-client==3.7.8 | ||
decorator==3.4.2 | ||
future==0.16.0 | ||
httplib2==0.7.3 | ||
psutil==5.4.5 | ||
py==1.7.0 | ||
pyOpenSSL==18.0.0 | ||
pycurl-client==3.7.8 | ||
pycurl==7.19.3 | ||
python-cjson==1.2.1 | ||
pyzmq==17.1.2 | ||
retry==0.9.1 | ||
stomp.py==4.1.15 | ||
rucio-clients==1.19.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# WMCore requirements intentionally left blank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python | ||
|
||
# This setup script is used to build the WMAgent pypi package. | ||
# The version number comes from WMCore/__init__.py and needs to | ||
# follow PEP 440 conventions | ||
|
||
from __future__ import print_function, division | ||
import os | ||
import sys | ||
import imp | ||
from setuptools import setup | ||
from setup_build import list_packages, list_static_files, get_path_to_wmcore_root | ||
|
||
# Obnoxiously, there's a dependency cycle when building packages. We'd like | ||
# to simply get the current WMCore version by using | ||
# 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__ | ||
|
||
# Requirements file for pip dependencies | ||
requirements = "requirements.txt" | ||
|
||
|
||
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='wmagent', | ||
version=wmcore_version, | ||
maintainer='CMS DMWM Group', | ||
maintainer_email='[email protected]', | ||
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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python | ||
|
||
# This setup script is used to build the WMCore pypi package. | ||
# The version number comes from WMCore/__init__.py and needs to | ||
# follow PEP 440 conventions | ||
|
||
from __future__ import print_function, division | ||
import os | ||
import sys | ||
import imp | ||
from setuptools import setup | ||
from setup_build import list_packages, list_static_files, get_path_to_wmcore_root | ||
|
||
# Obnoxiously, there's a dependency cycle when building packages. We'd like | ||
# to simply get the current WMCore version by using | ||
# 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__ | ||
|
||
# Requirements file for pip dependencies | ||
requirements = "requirements.txt" | ||
|
||
|
||
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='[email protected]', | ||
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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
# | ||
# Script used to build each application from the WMCore repo and upload to pypi. | ||
# | ||
# Usage: | ||
# sh tools/build_pypi_packages.sh <wmagent|wmcore|all> | ||
# | ||
|
||
|
||
wmcore=false | ||
wmagent=false | ||
|
||
TOBUILD=$1 | ||
|
||
case $TOBUILD in | ||
wmagent) | ||
echo "Building wmagent package" | ||
wmagent=true | ||
;; | ||
wmcore) | ||
echo "Building wmcore package" | ||
wmcore=true | ||
;; | ||
all) | ||
echo "Building wmagent package" | ||
echo "Building wmcore package" | ||
wmcore=true | ||
wmagent=true | ||
;; | ||
*) | ||
echo "Please enter one of the following arguments." | ||
echo " all Build all WMCore packages" | ||
echo " wmagent Build wmagent package" | ||
echo " wmcore Build wmcore package" | ||
exit 1 | ||
esac | ||
|
||
if $wmagent | ||
then | ||
/bin/cp requirements.wmagent.txt requirements.txt | ||
/bin/cp setup_wmagent.py setup.py | ||
python setup.py sdist upload | ||
fi | ||
|
||
if $wmcore | ||
then | ||
/bin/cp requirements.wmcore.txt requirements.txt | ||
/bin/cp setup_wmcore.py setup.py | ||
python setup.py sdist upload | ||
fi | ||
|
||
|