From e9d51ae9ed53297dfa91848cd72f78e8368935ab Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 15:04:06 +0200 Subject: [PATCH 1/6] add packaging files for docker to released package --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index f9cc658e..d206a548 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ preprpm: default @cp -rf anaXDAQ*.py $(ScriptDir) @cp -rf ana_scans.py $(ScriptDir) @cp -rf anaXDAQLatency.py $(ScriptDir) + @cp -rf packageFiles4Docker.py $(ScriptDir) -cp -rf README.md LICENSE CHANGELOG.md MANIFEST.in requirements.txt $(PackageDir) -cp -rf README.md LICENSE CHANGELOG.md MANIFEST.in requirements.txt pkg From 87bcda8f21d556662a9d2ed8090c632f755f72fa Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 15:04:49 +0200 Subject: [PATCH 2/6] update anautilities imports --- anautilities.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/anautilities.py b/anautilities.py index e28315b6..5f7fa50c 100644 --- a/anautilities.py +++ b/anautilities.py @@ -66,7 +66,7 @@ def getDirByAnaType(anaType, cName, ztrim=4): pass # Check Paths - from gempython.utils.wrappers import envCheck + from ..utils.wrappers import envCheck envCheck('DATA_PATH') dataPath = os.getenv('DATA_PATH') @@ -125,7 +125,7 @@ def getMapping(mappingFileName): channel - the channel on the ASIC PanPin - the pin number on the panasonic connector """ - from gempython.utils.nesteddict import nesteddict + from ..utils.nesteddict import nesteddict from anaInfo import mappingNames import ROOT as r @@ -301,7 +301,7 @@ def make3x8Canvas(name, initialContent = None, initialDrawOpt = '', secondaryCon """ import ROOT as r - from gempython.gemplotting.mapping.chamberInfo import chamber_vfatPos2PadIdx + from ..mapping.chamberInfo import chamber_vfatPos2PadIdx if canv is None: canv = r.TCanvas(name,name,500*8,500*3) @@ -332,7 +332,7 @@ def makeListOfScanDatesFile(chamberName, anaType, startDate=None, endDate=None, delim - delimiter to use in output file name """ - from gempython.utils.wrappers import envCheck, runCommand + from ..utils.wrappers import envCheck, runCommand envCheck('DATA_PATH') import datetime @@ -559,7 +559,7 @@ def saveSummary(dictSummary, dictSummaryPanPin2=None, name='Summary', trimPt=Non """ import ROOT as r - from gempython.gemplotting.mapping.chamberInfo import chamber_vfatPos2PadIdx + from ..mapping.chamberInfo import chamber_vfatPos2PadIdx legend = r.TLegend(0.75,0.7,0.88,0.88) r.gStyle.SetOptStat(0) From d709671336c89c594fbedcc279958879c6058535 Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 15:58:34 +0200 Subject: [PATCH 3/6] update gembuild pointer to include pip-only targets --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index ce7fd752..2be9e426 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit ce7fd752db5b14fbc583f941687f75e7fa7691b4 +Subproject commit 2be9e426685d279437432dc5a4d7fcdf28fda986 From 6e2c554e01f12f546d1cde0d4aa2b16972cd2379 Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 16:21:04 +0200 Subject: [PATCH 4/6] add a development requirements file --- requirements-dev.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..96d5f715 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +importlib +setuptools>25,<=38 +pip>8,<10.1 From 67821eebe2e5e6316d4e22aad6c3404468814bf7 Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 16:40:56 +0200 Subject: [PATCH 5/6] installrpm.sh scriptlet becoming gemplotting specific --- pkg/installrpm.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 pkg/installrpm.sh diff --git a/pkg/installrpm.sh b/pkg/installrpm.sh new file mode 100755 index 00000000..472ce3af --- /dev/null +++ b/pkg/installrpm.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# default action +python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES + +# install 'scripts' to /opt/cmsgemos/bin +mkdir -p %{buildroot}/opt/cmsgemos/bin +cp -rfp gempython/scripts/*.py %{buildroot}/opt/cmsgemos/bin/ + +# remove the namespace gempython __init__.pyc[o] files from the RPM +find %{buildroot} -wholename "*gempython/__init__.py" -delete +find %{buildroot} -wholename "*gempython/__init__.pyo" -delete +find %{buildroot} -wholename "*gempython/__init__.pyc" -delete +find %{buildroot} -wholename '*site-packages/gempython/__init__.py' -delete +find %{buildroot} -wholename '*site-packages/gempython/__init__.pyc' -delete +find %{buildroot} -wholename '*site-packages/gempython/__init__.pyo' -delete +find %{buildroot} -type f -exec chmod a+r {} \; +find %{buildroot} -type f -iname '*.cfg' -exec chmod a-x {} \; + +cp INSTALLED_FILES INSTALLED_FILES.backup +cat INSTALLED_FILES.backup|egrep -v 'gempython/__init__.py*' > INSTALLED_FILES +# set permissions +cat <>INSTALLED_FILES +%attr(0755,root,root) /opt/cmsgemos/bin/*.py +%attr(0755,root,root) /usr/lib/python*/site-packages/gempython/scripts/*.py +EOF +echo "Modified INSTALLED_FILES" +cat INSTALLED_FILES From 6a8c2613dfb09b246c888f69487865d4efdbe520 Mon Sep 17 00:00:00 2001 From: Jared Sturdy Date: Mon, 4 Jun 2018 16:43:14 +0200 Subject: [PATCH 6/6] makefile updates for installrpm.sh scriptlet becoming gemplotting specific --- Makefile | 5 +++-- pkg/installrpm.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d206a548..25e3b827 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,9 @@ default: .PHONY: clean preprpm _rpmprep: preprpm preprpm: default - @cp -rf config/scriptlets/installrpm.sh pkg/ + @if ! [ -e pkg/installrpm.sh ]; then \ + cp -rf config/scriptlets/installrpm.sh pkg/; \ + fi $(MakeDir) $(ScriptDir) @cp -rf anaUltra*.py $(ScriptDir) @cp -rf anaSBit*.py $(ScriptDir) @@ -66,7 +68,6 @@ clean: -rm -f pkg/MANIFEST.in -rm -f pkg/CHANGELOG.md -rm -f pkg/requirements.txt - -rm -f pkg/installrpm.sh print-env: @echo BUILD_HOME $(BUILD_HOME) diff --git a/pkg/installrpm.sh b/pkg/installrpm.sh index 472ce3af..f5b47016 100755 --- a/pkg/installrpm.sh +++ b/pkg/installrpm.sh @@ -14,6 +14,7 @@ find %{buildroot} -wholename "*gempython/__init__.pyc" -delete find %{buildroot} -wholename '*site-packages/gempython/__init__.py' -delete find %{buildroot} -wholename '*site-packages/gempython/__init__.pyc' -delete find %{buildroot} -wholename '*site-packages/gempython/__init__.pyo' -delete +find %{buildroot} -wholename '*site-packages/gempython/gemplotting/macros/*.py' -print0 -exec chmod a+x {} \; find %{buildroot} -type f -exec chmod a+r {} \; find %{buildroot} -type f -iname '*.cfg' -exec chmod a-x {} \; @@ -23,6 +24,7 @@ cat INSTALLED_FILES.backup|egrep -v 'gempython/__init__.py*' > INSTALLED_FILES cat <>INSTALLED_FILES %attr(0755,root,root) /opt/cmsgemos/bin/*.py %attr(0755,root,root) /usr/lib/python*/site-packages/gempython/scripts/*.py +%attr(0755,root,root) /usr/lib/python*/site-packages/gempython/gemplotting/macros/*.py EOF echo "Modified INSTALLED_FILES" cat INSTALLED_FILES