This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Updates to packaging #108
Merged
jsturdy
merged 6 commits into
cms-gem-daq-project:develop
from
jsturdy:updates-to-packaging
Jun 5, 2018
Merged
Updates to packaging #108
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e9d51ae
add packaging files for docker to released package
jsturdy 87bcda8
update anautilities imports
jsturdy d709671
update gembuild pointer to include pip-only targets
jsturdy 6e2c554
add a development requirements file
jsturdy 67821ee
installrpm.sh scriptlet becoming gemplotting specific
jsturdy 6a8c261
makefile updates for installrpm.sh scriptlet becoming gemplotting spe…
jsturdy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,30 @@ | ||
#!/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} -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 {} \; | ||
|
||
cp INSTALLED_FILES INSTALLED_FILES.backup | ||
cat INSTALLED_FILES.backup|egrep -v 'gempython/__init__.py*' > INSTALLED_FILES | ||
# set permissions | ||
cat <<EOF >>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 |
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,3 @@ | ||
importlib | ||
setuptools>25,<=38 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know which version got pulled in? |
||
pip>8,<10.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably my ignorance here but I don't really follow what this (change to line 69) does; or the motivation for it?
I guess it's related to the discussion:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anautilities.py
lives ingempython/gemplotting/
It wants to
import
fromwrappers.py
which lives ingempython/utils
Because
anautilities.py
will never be called standalone (no__main__
), it is a "part of the package", so it should reference allimport
s from thegempython
namespace relatively (wrt where it lives) so it imports from..utils.wrappers
(i.e., look in the package structure in the directory above where I am forutils/wrappers.py
)This type of
import
should (and can) only be done as deep as the package itself is (don'timport .....somewhere.outside.of.gempython
), and must not be done for anything that will be called either as a standalone, lives-on-the-PATH
executable, nor for a module with a__main__
(executable viapython -m <modulename>
, as those pieces are not a "part" of the package in the same sense (and can be located outside of the package itself)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so the
import ..some.package
Is like calling
cd ..
. I understand.