Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #832, #26: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements #857

Merged
merged 1 commit into from
Dec 15, 2017

Conversation

andy-maier
Copy link
Contributor

@andy-maier andy-maier commented Dec 5, 2017

Ready for review and merge. For details, see commit message.

Sorry for accumulating a number of things in this PR, but they were all related. I have split out some changes that ended up being unrelated, into separate PRs (#861 and #862). The commit message of this PR here has carefully been edited to reflect all changes. So one way of simplifying the review would be to review the changes as described by the comment message and to go to the actual file changes only very partially.

The Travis CI runs for OS-X have been disabled again in this PR in order to keep the CI runs quick for PRs; the OS-X runs can be seen in PR #791 which has been rebased on this PR and has OS-X enabled.

@andy-maier andy-maier self-assigned this Dec 5, 2017
@andy-maier andy-maier added this to the 0.12.0 milestone Dec 5, 2017
@andy-maier andy-maier changed the title Use pbr and reqs files; Drop Py2.6; Drop Win32. Fixes #832: Use pbr and reqs files; Drop Py2.6; Drop Win32. Dec 5, 2017
@andy-maier andy-maier force-pushed the andy/#832-setup-pbr-req branch 7 times, most recently from 280edda to 7e3a2ff Compare December 5, 2017 07:53
@andy-maier andy-maier changed the title Fixes #832: Use pbr and reqs files; Drop Py2.6; Drop Win32. [WIP] Fixes #832: Use pbr and reqs files Dec 6, 2017
@andy-maier andy-maier changed the title [WIP] Fixes #832: Use pbr and reqs files [WIP] Fixes #832: Use pbr, requirement files, and minimum package level for pywbem setup Dec 6, 2017
@andy-maier andy-maier force-pushed the andy/#832-setup-pbr-req branch 5 times, most recently from ce92e9f to 409710c Compare December 6, 2017 21:36
@pywbem pywbem deleted a comment from coveralls Dec 6, 2017
@pywbem pywbem deleted a comment from coveralls Dec 6, 2017
@andy-maier andy-maier force-pushed the andy/#832-setup-pbr-req branch 4 times, most recently from f9577b0 to 7c6af65 Compare December 6, 2017 22:26
@andy-maier andy-maier changed the title [WIP] Fixes #832: Use pbr + req files for setup; test with min/max pkg level; add libxml2; enable OS-X [WIP] Fixes #832: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements Dec 10, 2017
@andy-maier andy-maier force-pushed the andy/#832-setup-pbr-req branch 2 times, most recently from 8bf4596 to 79778e4 Compare December 10, 2017 14:47
@pywbem pywbem deleted a comment from coveralls Dec 10, 2017
@andy-maier andy-maier changed the title [WIP] Fixes #832: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements Fixes #832: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements Dec 10, 2017
@andy-maier
Copy link
Contributor Author

andy-maier commented Dec 10, 2017

@KSchopmeyer Karl, this PR is now ready for re-review.

Please read the original comment at the top of the PR for details.

Also, please double check whether the error you reported further up in this PR can be reproduced with the latest level.

…vements

This change contains a number of related changes.

Details for using pbr+req files:
- Migrated installation and development setup to use the `pbr` package and
  Pip requirements files. Package metadata is now defined in `setup.cfg`,
  and `setup.py` has been reduced to only delegate to `pbr`. Added several
  Pip requirements files (named `*requirements.txt`).
- Changed `pywbem/_version.py` and the `makefile` to determine the pywbem
  package version from `pbr`.
- Added the capability to `pywbem_os_setup.sh` to install OS-level
  packages needed for development of pywbem and installed the `libxml2`
  package that way (needed to provide the `xmllint` utility used by the
  tests).
- Fixed the install section of the documentation to add the need for
  the `libxml2` package when developing pywbem.
- Narrowed the quickfix for symlinking the OpenSSL header files in
  `.travis.yml` to just be done when on Linux and with Python 2.6.
- Reorganized the make targets for installing packages. New targets
  `install_os` and `develop_os` install OS-level prereq packages for
  runtime and development, respectively. These targets are also included
  in the `install` and `develop` targets when invoked for the first time
  after a `make clobber`.
- The installation of the M2CryptoWin32/64 Python packages on Windows has
  been automated in the Appveyor CI, but could not be automated for users
  of Pywbem, because it is not currently possible to use the bit size of the
  Python executable as a condition (=marker) in Pip requirements files.
  Updated the install documentation accordingly, with a manual step to be
  performed when installing on Windows. Added diagnostics prints to the
  makefile comparing different ways to determine the bit size of the Python
  executable in Python (There were several methods discussed on StackOverflow).
- Removed files that are no longer used after these changes:
  `os_setup.py`, `uninstall_pbr_on_py26.py`.
- Added a new script `remove_duplicate_setuptools.py` to circumvent
  the issue 'ImportError: No module named build_clib'i on Travis CI.
  The script fixes a setup error on Travis CI by removing a duplicate
  metadata directory for the Python `setuptools` package.
  This issue came up only now because we switched to using `pbr`.
- Pinned M2Crypto to != 0.27.0 to fix dependency issue on Python 2.6
  where M2Crypto requires `unittest2==0.5.1`. This is in conflict
  with the pywbem requirements files specifying `unittest2>=1.1.0`.
  See M2Crypto issue #195.
- Fixed an error in `tox.ini` when called with the `pywin` environment for
  Windows from the Appveyor CI, where not all required environment variables
  were passed through to `make`.
- With the use of `pbr`, the development version for the upcoming 0.12.0
  version changed from `0.12.0.dev0` to `0.11.1.devNNN`. Therefore, needed
  to adjust the check for the 0.12.0 variant of tests in `test_cim_obj.py`
  from comparing `>=0.12.0` to comparing `>0.11.0`.

Details for testing min/max pkg levels:
- Because requirements files are now used, it was easy to also add
  the ability to install the dependent Python packages with either
  their latest level from Pypi, or with a defined minimum level, by
  using a Pip constraints file (`minimum-constraints.txt`).
  This is controlled by the environment variable PACKAGE_LEVEL, which
  can be set to `minimum` or `latest` (default).
- The Travis CI and Appveyor CI are now set up to test both package
  levels. In this commit, all combinations of platforms, Python
  versions, and package levels have been defined, but only a small
  subset is active - the others are commented out. Enabling all of them
  is left to other branches.

Details for fixing OS-X runs:
- Extended the OS-X combinations in `.travis.yml` to reflect mininum
  and latest package levels. Note that in this commit, the `.travis.yml`
  file continues to have all OS-X combinations commented out; it is left
  to other branches to enable them.
- Fixed the environment variables for the OpenSSL development files that were
  set in `.travis.yml` for OS-X.
- Fixed the issue that for OS-X, the virtualenv directory was in the
  pywbem working directory which caused tests from the installed packages
  to be run by py.test (and some of them failed).
- Added support to `pywbem_os_setup.sh` for automatically installing OS-level
  packages for OS-X, using Homebrew (the `brew` command).

Details for other improvements:
- Consolidated the invocation of make runs in `.travis.yml`, `tox.ini`
  and `appveyor.yaml` to be consistent. Now we are issuing 'make install'
  first to check whether it has all dependencies for runtime (and that not
  some of them are in the development dependencies by accident).
  As part of that, added  an import test 'import pywbem' to 'make install'
  to check for importability.
- Improved `makefile` and `pywbem_os_setup.sh` to always have a message
  prefix indicating the source of the message, and to let error and warning
  messages go to stderr.
- Reordered the virtual targets in the `makefile` to be consistent with
  the order shown in the `help` target.
- Added additional messages in the makefile to better allow tracing which
  target caused the commands to be executed.
- Some of the OS-level packages are needed only to install or run M2Crypto.
  nevertheless, they had been installed on Python 2 and Python 3. Now,
  they are only installed when running on Python 2 (M2Crypto is not used
  by pywbem when running on Python 3).
- Moved the install actions into separate functions in `pywbem_os_setup.sh`.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 76.599% when pulling 82863b5 on andy/#832-setup-pbr-req into 6558a84 on master.

@pywbem pywbem deleted a comment from coveralls Dec 13, 2017
@andy-maier andy-maier changed the title Fixes #832: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements Fixes #832, #26: Use pbr+req files; Add min/max pkg levels; Fix OS-X runs; Other improvements Dec 14, 2017
Copy link
Collaborator

@KSchopmeyer KSchopmeyer left a comment

Choose a reason for hiding this comment

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

I would like to work with this for another couple of hours before approving

@KSchopmeyer
Copy link
Collaborator

Karl agrees. Lets check this in

@andy-maier andy-maier merged commit e7510d1 into master Dec 15, 2017
@andy-maier andy-maier deleted the andy/#832-setup-pbr-req branch December 15, 2017 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants