Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Install the man pages #139

Merged

Conversation

lmoureaux
Copy link
Contributor

@lmoureaux lmoureaux commented Jul 19, 2018

Description

This PR modifies the Makefile and setup script to install the man pages. They are installed at $BASE/share/man, where $BASE is as follows:

  • $VIRTUAL_ENV when installed within a virtualenv
  • /usr when installed system-wide

Man pages in the virtualenv can be accessed by setting the correct $MANPATH.

[outdated]
A side-effect of this change is that I figured out how to modify the default setuptools install location. All scripts and macros are now installed in $BASE/bin. This means that virtualenv can take care of updating the $PATH (system-wide installs still need a setup script).
[/outdated]

Another side-effect is that I corrected the license information in the package metadata. It was saying "MIT" while the LICENSE file always contained the text of GPLv3 (there is no way to change back to MIT without contacting every single contributor).

The setup script and developer documentation will need to be updated to use the $MANPATH.

Downsides

  • The man pages produced when the package is not installed may not be completely accurate. This is a problem for make rpm since it doesn't work inside a virtualenv.
  • [outdated]Macros and scripts are present twice in the package: under bin/ and under gempython/.... I couldn't figure out why.[/outdated]
  • CI is broken 😢

As a result of these downsides and my inability to fix them shortly, this PR is provided more as a list of commits to be cherry-picked.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context

  • Include man pages in the package #138
  • [outdated] Comment in setup.py:
    would prefer to use this for executables, if one can control the install location
    to be user defined rather than /usr/bin
    
    The preferred method (native support from setuptools) is now used. [/outdated]

How Has This Been Tested?

  • The pip and rpm packages were built, the former from a virtualenv and the latter on gem904daq01.
  • The pip package was installed; scripts and man pages are correctly installed and have the correct permissions.
  • It was checked that the rpm package contains all files.
  • The man pages built in each environment were (quickly) checked.

Since I don't have access to a rpm-based machine and I don't want to install one, I couldn't check that the rpm package installs cleanly.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Contributor

@jsturdy jsturdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are far too many changes in this PR that should have been discussed in #138 before being implemented

A side-effect of this change is that I figured out how to modify the default setuptools install location. All scripts and macros are now installed in $BASE/bin. This means that virtualenv can take care of updating the $PATH (system-wide installs still need a setup script).

This was by design, avoiding putting things in macros into /opt/cmsgemos/bin

Another side-effect is that I corrected the license information in the package metadata. It was saying "MIT" while the LICENSE file always contained the text of GPLv3 (there is no way to change back to MIT without contacting every single contributor).

This is probably the discussion that I mention inline. I would have to go back in time to figure out why a given license was (probably arbitrarily) chosen for this project, and probably raise it as a discussion, (contacting contributors on this project is pretty trivial)

@@ -23,8 +23,8 @@ 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
%attr(0755,root,root) /opt/cmsgemos/lib/python*/site-packages/gempython/scripts/*.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also explicitly avoided in the initial setup, as in future versions this will be replaced with system site-packages location macros provided by rpm (currently only works for cc7)

Copy link
Contributor Author

@lmoureaux lmoureaux Jul 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system site-packages location macros provided by rpm

Could you provide more details about this? A link to the rpm doc about this would be great

@@ -4,7 +4,7 @@ name = gempython_gemplotting
author = GEM Online Systems Group
author_email = [email protected]
summary = __summary__
license = MIT
license = GNU General Public License v3 (GPLv3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License changes must be discussed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a license change, this is reflecting the fact that the current license is GPLv3. If you want to contact all copyright holders, fine; but until you get answers the license remains GPLv3.

@@ -20,7 +20,8 @@ classifier =
Topic :: Data Acquisition
Topic :: Scientific
Topic :: Utilities
License :: OSI Approved :: MIT
License :: OSI Approved :: GNU General Public License (GPL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

# Man files
man_sections = {}
for file in listdir(mandir):
print('Found man page: %s' % file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, prefer consistent string formatting (avoid % formatting in favour of .format() formatting) for all current and future contributions, CONTRIBUTING.md will be updated to reflect this and a few other changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own ignorance, why is .format() viewed as superior?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about superior... it is the standard that was introduced to eventually replace % formatting, though I suspect that % formatting will stick around for quite some time...
Both have a few advantages, though I think .format() has more.
The primary thing here (in this comment) is maintaining consistency

@lmoureaux
Copy link
Contributor Author

avoiding putting things in macros into /opt/cmsgemos/bin

May I ask what's the rationale for the difference between scripts and macros in this project?

@lmoureaux
Copy link
Contributor Author

I would have to go back in time to figure out why a given license was (probably arbitrarily) chosen for this project

Commit 3d58f5d by... @jsturdy. The commit message ("Initial commit") isn't helpful in telling how the license was chosen.

FYI:

@jsturdy
Copy link
Contributor

jsturdy commented Jul 19, 2018

May I ask what's the rationale for the difference between scripts and macros in this project?

Mainly, it is to isolate the key executable parts (analyzing scans, which should go in /opt/cmsgemos/bin) from random plotting and style macros (can still be on the PATH for ease of use, provided PATH is modified to include the macros directory)

Further down the road, much of this will be replaced with console_scripts and entry_points, but that is a minor priority

@lmoureaux lmoureaux force-pushed the feature_installManPages branch from 20a53ab to cc83a72 Compare July 19, 2018 13:36
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Jul 19, 2018
It looks like it's required when installing them in the system location.

See issue cms-gem-daq-project#138 and PR cms-gem-daq-project#139.
@lmoureaux
Copy link
Contributor Author

Removed the controversial move to a more standard behavior using standard tools; the rpm package will now install man pages in /usr/share. Updated the first post accordingly.

lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Jul 19, 2018
@jsturdy jsturdy mentioned this pull request Jul 20, 2018
6 tasks
The LICENSE files contains GPLv3, not MIT
It looks like it's required when installing them in the system location.

See issue cms-gem-daq-project#138 and PR cms-gem-daq-project#139.
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from 0a276c3 to 9ed4e3b Compare August 13, 2018 16:58
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from 9ed4e3b to 2a56153 Compare August 13, 2018 17:09
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from 2a56153 to a0857c1 Compare August 13, 2018 17:31
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from a0857c1 to cbd8694 Compare August 13, 2018 17:49
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from cbd8694 to 6409f25 Compare August 13, 2018 18:13
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from 6409f25 to f50904f Compare August 13, 2018 18:23
lmoureaux added a commit to lmoureaux/gem-plotting-tools that referenced this pull request Aug 13, 2018
@lmoureaux lmoureaux force-pushed the feature_installManPages branch from f50904f to 23cb5e0 Compare August 13, 2018 19:01
This reverts commit 1fdebc0. It didn't
work with Python 2.6.
@lmoureaux
Copy link
Contributor Author

Comments have been addressed and I'm waiting for another review.

@jsturdy jsturdy changed the title WIP: Install the man pages Install the man pages Oct 17, 2018
Copy link
Contributor

@jsturdy jsturdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPM requirements:

rpm -q --requires -p rpm/gempython_gemplotting-1.0.0-0.0.6.30.dev5.087aeffgit.centos7.python2.7.noarch.rpm
/bin/env
/bin/sh
/usr/bin/env
cmsgemos_gempython >= 0.3.1
config(gempython_gemplotting) = 1.0.0-0.0.6.30.dev5.087aeffgit.centos7.python2.7
numpy >= 1.7
python >= 2.6
python(abi) = 2.7
root_numpy >= 4.7
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
tabulate >= 0.4.4
rpmlib(PayloadIsXz) <= 5.2-1
  • looks like some mixed shebangs are used, these should be cleaned up in the future
  • also in the future, would like to be able to provide these to bdist_rpm based on the python version, but I believe this would be a significant redesign, moving the majority of the setup.cfg stuff into functions imported in setup.py

@jsturdy jsturdy merged commit 69a710d into cms-gem-daq-project:develop Oct 17, 2018
jsturdy pushed a commit that referenced this pull request Oct 17, 2018
It looks like it's required when installing them in the system location.

See issue #138 and PR #139.
jsturdy pushed a commit that referenced this pull request Oct 17, 2018
jsturdy pushed a commit that referenced this pull request Oct 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants