Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include README.md RELEASENOTES.md
include README.md RELEASENOTES.md COPYING
recursive-include docs *.md
recursive-include samples *.py
recursive-include tests *.py
Expand Down
43 changes: 43 additions & 0 deletions README.rpm-generation
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
* Notes related to RPM generation

You can generate an RPM from the upstream pyrax source tree by running:

$ make rpms

This will generate a distribution tarball by running:

$ python setup.py sdist

Code within setup.py creates a SPEC file with the version and release
replaced from the SPEC template "python-pyrax.spec.in"

Details of how the release string is generated can be found in setup.py.

Generally speaking, during development the release string should be "0".
This allows frequent rebuilds of the RPMs and will generate a timestamp
based release that is always "newer" for more recent rebuilds.

When doing a formal upstream release the "release" string can be set
to any non-zero value. This will turn off the generation of additional
time and git-based release string content.

* Snapshot Packages

If you need to generate an RPM that is not based on an entirely unmodified
upstream source release, you should set "snapshot_release" to True.
This will generate a release suffix based on the date and git hash that
meets the Fedora package guidelines presented here:

http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Snapshot_packages

(Note from imcleod@redhat.com - Monday, July 28, 2014

We are working to get pyrax into the Fedora package set. Our submission
is in bugzilla here:

https://bugzilla.redhat.com/show_bug.cgi?id=1123044

Until we can coordinate releases regularly with upstream, I will be doing
snapshot package generation as described above. I will fork upstream at
the point of release and then set the RPM version and release details as
needed to generate a package.)
56 changes: 0 additions & 56 deletions pyrax.spec.in

This file was deleted.

1 change: 0 additions & 1 deletion pyrax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, Inc.

Expand Down
1 change: 0 additions & 1 deletion pyrax/autoscale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2013 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/base_identity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


Expand Down
1 change: 0 additions & 1 deletion pyrax/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2010 Jacob Kaplan-Moss
Expand Down
1 change: 0 additions & 1 deletion pyrax/cloudblockstorage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/clouddatabases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/clouddns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/cloudloadbalancers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/cloudmonitoring.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2013 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/cloudnetworks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2013 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/fakes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
Expand Down
1 change: 0 additions & 1 deletion pyrax/identity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import glob
Expand Down
1 change: 0 additions & 1 deletion pyrax/identity/keystone_identity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import
Expand Down
1 change: 0 additions & 1 deletion pyrax/identity/rax_identity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import
Expand Down
1 change: 0 additions & 1 deletion pyrax/image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2014 Rackspace US, Inc.
Expand Down
1 change: 0 additions & 1 deletion pyrax/object_storage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2014 Rackspace
Expand Down
1 change: 0 additions & 1 deletion pyrax/queueing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c)2012 Rackspace US, Inc.
Expand Down
33 changes: 31 additions & 2 deletions pyrax/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
Expand Down Expand Up @@ -712,7 +711,37 @@ def import_class(import_str):
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)


# Code below is originally from django
# Django is 3-clause BSD, which we'll duplicate here to be safe
#
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of Django nor the names of its contributors may be used
# to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# http://code.activestate.com/recipes/
# 577257-slugify-make-a-string-usable-in-a-url-or-filename/
def slugify(value):
Expand Down
3 changes: 1 addition & 2 deletions pyrax/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

version = "1.9.0"
version = "1.9.1"
64 changes: 64 additions & 0 deletions python-pyrax.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# The python2 defines are missing in RHEL6
%if 0%{?rhel} == 6
%define __python2 %{__python}
%define python2_sitelib %{python_sitelib}
%endif

Name: python-pyrax
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: Python language bindings for OpenStack Clouds


License: ASL 2.0
Source0: http://imcleod.fedorapeople.org/src/pyrax/pyrax-%{version}.tar.gz
URL: https://github.com/rackspace/pyrax

# Earlier upstream RPMs had the name pyrax - provide this for compatibility
Provides: pyrax = %{version}
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python-mock
BuildRequires: python2-devel
Requires: python-novaclient >= 2.13.0
Requires: python-keyring


%description
A library for working with most OpenStack-based cloud deployments, though it
originally targeted the Rackspace public cloud. For example, the code for
cloudfiles contains the ability to publish your content on Rackspace's CDN
network, even though CDN support is not part of OpenStack Swift. But if you
don't use any of the CDN-related code, your app will work fine on any
standard Swift deployment.

%prep
%setup -q -n pyrax-%{version}


%build


%install
rm -rf $RPM_BUILD_ROOT
%{__python2} setup.py install --root $RPM_BUILD_ROOT

%files
%doc README COPYING samples docs
%{python2_sitelib}/*

%changelog
* Tue Jul 29 2014 Ian McLeod <imcleod@redhat.com> - 1.9.0-3
- SPEC change to add missing macros for EPEL 6 builds

* Mon Jul 28 2014 Ian McLeod <imcleod@redhat.com> - 1.9.0-2
- Remove obsolete httplib requirement from SPEC file
- Remove #! execution headers for non-executable components [BZ1123044]
- add inline license for slugify() function to satisfy 3-clause BSD requirements from django [BZ1123044]
- misc additional SPEC change to comply with Fedora package guidelines [BZ1123044]

* Thu Jul 24 2014 Ian McLeod <imcleod@redhat.com> - 1.9.0-1
- Pull in upstream 1.9.0 release

* Fri Sep 6 2013 Greg Swift <gregswift@gmail.com> - 1.5.0-1
- Initial spec
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# Set to another value when cutting official release RPMS, then change back to
# zero for the next development cycle
release = '0'
# At the moment we are doing this in a fork so every release is strictly speaking
# a snapshot. Set this to false _and_ set above release to a non-zero value to
# get short "normal" release strings
snapshot_release = False

class sdist(_sdist):
""" custom sdist command, to prep pyrax.spec file """
Expand All @@ -37,17 +41,21 @@ def run(self):
stdout=subprocess.PIPE).communicate()[0].strip()
date = time.strftime("%Y%m%d%H%M%S", time.gmtime())
git_release = "%sgit%s" % (date, git_head)
shortdate = time.strftime("%Y%m%d", time.gmtime())
snapshot_git_release = "%sgit%s" % (shortdate, git_head)

# Expand macros in pyrax.spec.in
spec_in = open('pyrax.spec.in', 'r')
spec = open('pyrax.spec', 'w')
spec_in = open('python-pyrax.spec.in', 'r')
spec = open('python-pyrax.spec', 'w')
for line in spec_in.xreadlines():
if "@VERSION@" in line:
line = line.replace("@VERSION@", version)
elif "@RELEASE@" in line:
# If development release, include date+githash in %{release}
if release.startswith('0'):
release += '.' + git_release
elif snapshot_release:
release += '.' + snapshot_git_release
line = line.replace("@RELEASE@", release)
spec.write(line)
spec_in.close()
Expand Down