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

Use environment marker for conditional requirements #1029

Merged
merged 1 commit into from
Feb 18, 2016

Commits on Feb 18, 2016

  1. Use environment marker for conditional requirements

    Managing different requirements files for different python version
    requires much more efforts when the requirements became too complex.
    
    This issue emerged when a required package `stevedore` decide not
    supporting Python 2.6 since version `1.11.0`.
    
    ```
    >>> import stevedore
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.6/site-packages/stevedore/__init__.py", line 23, in <module>
        LOG.addHandler(logging.NullHandler())
    AttributeError: 'module' object has no attribute 'NullHandler
    ```
    
    Pip provides a feature named [Environment
    Markers](https://www.python.org/dev/peps/pep-0496/) for requirements
    file to include specific packages conditionally which could properly
    solve this issue.
    
    This fix:
    1. Use environment markers and merge python version specific
    requirements files;
    2. Remove python version specific requirements files references in
    `Makefile` and Travis configuration;
    3. Use `pip install -r requirements.txt` to replace per-line package
    installation;
    4. Restrain package `stevedore` on Python 2.6 to `1.10.0`.
    
    Signed-off-by: Hao Liu <hliu@redhat.com>
    Hao-Liu committed Feb 18, 2016
    Configuration menu
    Copy the full SHA
    03c04b9 View commit details
    Browse the repository at this point in the history