Skip to content

Commit 2bb4c8e

Browse files
Merge pull request #114 from klehman-rally/master
fixed project scoping, fixed RallyRESTResponse __repr__ for empty res…
2 parents f00464b + 4f09791 commit 2bb4c8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+439
-272
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2016, CA Technologies; 2010-2015, Rally Software Development Corp. Boulder, Colorado USA
1+
Copyright © 2015-2017, CA Technologies; 2010-2015, Rally Software Development Corp. Boulder, Colorado USA
22
All rights reserved.
33

44
License for pyral (a Python toolkit for the Rally REST API)

PKG-INFO

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Metadata-Version: 1.1
22
Name: pyral
3-
Version: 1.2.3
3+
Version: 1.2.4
44
Summary: Python toolkit for Rally REST API
55
Home-page: https://github.com/RallyTools/RallyRestToolkitForPython
66
Author: Kip Lehman (Rally Software Development)
77
License: BSD
8-
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dist/pyral-1.2.3.zip
8+
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.2.4.zip
99
Description: This is the README file for pyral, a package implementing a
10-
Pythonic interface to the Rally REST API
10+
Pythonic interface to the Agile Central (formerly Rally) REST API
1111

1212
Description
1313
-----------
1414

1515
The Rally REST Tookit for Python consists of a package that provides a means
1616
to interact with entities and artifacts in your Rally subscription. The full
17-
spectrum of CRUD operations is available in your Rally Workspaces and Projects,
18-
providing of course that your Rally subscription credentials enable you to perform
17+
spectrum of CRUD operations is available in your Agile Central (Rally) Workspaces and Projects,
18+
providing of course that your Agile Central (Rally) subscription credentials enable you to perform
1919
those operations. The toolkit insulates the package user from having to make
2020
multiple requests to obtain the full set of qualifying items by performing any
2121
subsequent "page" requests automatically.
@@ -25,10 +25,10 @@ Description: This is the README file for pyral, a package implementing a
2525
Requirements
2626
------------
2727

28-
The pyral package requires the use of Kenneth Reitz's requests package using version 2.0.0 or better.
28+
The pyral package requires the use of Kenneth Reitz's requests package using version 2.8.0 or better.
2929
As of requests version 2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
3030
The requests package can be found via the Python Package Index site (http://pypi/python.org/index).
31-
The most recent release of pyral (1.2.3) has been tested with requests 2.8.1.
31+
The most recent release of pyral (1.2.4) has been tested with requests 2.8.1.
3232
The six module is also required.
3333

3434

@@ -55,9 +55,10 @@ Description: This is the README file for pyral, a package implementing a
5555
-------------
5656

5757
Obtain the zip file containing the HTML and CSS files comprising the document set for pyral.
58-
Unzip in a suitable location and point your web browser to the doc/build/html/index.html file
58+
Unzip in a suitable location and point your web browser to the doc/build/html/index.html file.
5959

60-
The rendered documentation is also available at http://pyral.readthedocs.io/en/latest/
60+
The rendered documentation is also available at http://pyral.readthedocs.io/en/latest/
61+
and http://pythonhosted.org/pyral
6162

6263

6364
Keywords: rally,agilecentral,api

README.rst

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
pyral - A Python toolkit for the Rally REST API
2-
===============================================
1+
pyral - A Python toolkit for the Agile Central (Rally) REST API
2+
===============================================================
33

44

55
The `pyral <http://github.com/RallyTools/RallyRestToolkitForPython>`_ package enables you to push, pull
6-
and otherwise wrangle the data in your Rally subscription using the popular
6+
and otherwise wrangle the data in your Agile Central (formerly named Rally) subscription using the popular
77
and productive Python language.
88
The ``pyral`` package provides a smooth and easy to use veneer on top
9-
of the Rally REST Web Services API using JSON.
9+
of the Agile Central (Rally) REST Web Services API using JSON.
1010

1111
As of July 2015, the Rally Software Development company was acquired by CA Technologies.
1212
The Rally product itself has been rebranded as 'Agile Central'. Over time, the documentation
@@ -18,9 +18,9 @@ will transition from using the term 'Rally' to using 'Agile Central'.
1818
Getting started
1919
---------------
2020

21-
Rally has created a Python package that you can quickly leverage to interact with the data in your
21+
Agile Central (Rally) has created a Python package that you can quickly leverage to interact with the data in your
2222
subscription via the REST web services API. You can create, read, update, and delete the common
23-
artifacts and other entities via the Python toolkit for Rally.
23+
artifacts and other entities via the Python toolkit for Agile Central (Rally).
2424

2525
Download
2626
````````
@@ -39,7 +39,7 @@ Obtain the requests_ package and install it according to that package's directio
3939
As of requests-2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
4040
Use of requests-2.x or better is recommended for use with pyral.
4141
The requests_ package can be found via the Python Package Index site (http://pypi/python.org/index).
42-
The most recent release of pyral (1.2.3) has been tested using requests 2.8.1.
42+
The most recent release of pyral (1.2.4) has been tested using requests 2.8.1.
4343

4444
Obtain and install the six_ module (available from PyPI at https://pypi.python.org/pypi/six)
4545

@@ -63,11 +63,11 @@ relevant packages.
6363
::
6464

6565
$ python
66-
Python 3.5.1 [other Python interpreter info elided ...]
66+
Python 3.5.2 [other Python interpreter info elided ...]
6767
>> import requests
6868
>> import pyral
6969
>> pyral.__version__
70-
(1, 2, 3)
70+
(1, 2, 4)
7171

7272

7373

@@ -85,13 +85,13 @@ assigned to the name **story**, the following code iterates over the tasks.
8585

8686
There is no need to make a separate call to fetch all the tasks for the story.
8787
When you follow domain model attributes in the Python code, the Python toolkit for
88-
Rally REST API machinery automatically loads in the necessary objects for you.
88+
Agile Central (Rally) REST API machinery automatically loads in the necessary objects for you.
8989

9090

9191
Full Documentation
9292
``````````````````
9393

94-
The complete documentation for the Python toolkit for Rally REST API
94+
The complete documentation for the Python toolkit for Agile Central (Rally) REST API
9595
is in the doc/build/html subdirectory in the repository.
9696
The rendered version of this is also available at
9797
http://pyral.readthedocs.io/en/latest/
@@ -102,13 +102,13 @@ Sample code
102102

103103
Common setup code ::
104104

105-
import sys
106-
from pyral import Rally, rallyWorkset
107-
options = [arg for arg in sys.argv[1:] if arg.startswith('--')]
108-
args = [arg for arg in sys.argv[1:] if arg not in options]
109-
server, user, password, apikey, workspace, project = rallyWorkset(options)
110-
rally = Rally(server, user, password, apikey=apikey, workspace=workspace, project=project)
111-
rally.enableLogging('mypyral.log')
105+
import sys
106+
from pyral import Rally, rallyWorkset
107+
options = [arg for arg in sys.argv[1:] if arg.startswith('--')]
108+
args = [arg for arg in sys.argv[1:] if arg not in options]
109+
server, user, password, apikey, workspace, project = rallyWorkset(options)
110+
rally = Rally(server, user, password, apikey=apikey, workspace=workspace, project=project)
111+
rally.enableLogging('mypyral.log')
112112

113113
Show a TestCase identified by the **FormattedID** value.
114114
Copy the above boilerplate and the following code fragment and save it in a file named gettc.py
@@ -133,12 +133,12 @@ Get a list of workspaces and projects for your subscription
133133

134134
::
135135

136-
workspaces = rally.getWorkspaces()
137-
for wksp in workspaces:
138-
print "%s %s" % (wksp.oid, wksp.Name)
139-
projects = rally.getProjects(workspace=wksp.Name)
140-
for proj in projects:
141-
print " %12.12s %s" % (proj.oid, proj.Name)
136+
workspaces = rally.getWorkspaces()
137+
for wksp in workspaces:
138+
print "%s %s" % (wksp.oid, wksp.Name)
139+
projects = rally.getProjects(workspace=wksp.Name)
140+
for proj in projects:
141+
print " %12.12s %s" % (proj.oid, proj.Name)
142142

143143
- Run the script
144144

@@ -149,12 +149,12 @@ Get a list of all users in a specific workspace
149149

150150
::
151151

152-
all_users = rally.getAllUsers()
153-
for user in all_users:
154-
tz = user.UserProfile.TimeZone or 'default'
155-
role = user.Role or '-No Role-'
156-
values = (int(user.oid), user.Name, user.UserName, role, tz)
157-
print("%12.12d %-24.24s %-30.30s %-12.12s" % values)
152+
all_users = rally.getAllUsers()
153+
for user in all_users:
154+
tz = user.UserProfile.TimeZone or 'default'
155+
role = user.Role or '-No Role-'
156+
values = (int(user.oid), user.Name, user.UserName, role, tz)
157+
print("%12.12d %-24.24s %-30.30s %-12.12s" % values)
158158

159159
- Run the script
160160

@@ -201,11 +201,11 @@ Update an existing Defect
201201
"TargetDate" : target_date,
202202
"Notes" : notes
203203
}
204-
try:
205-
defect = rally.update('Defect', defect_data)
206-
except Exception, details:
207-
sys.stderr.write('ERROR: %s \n' % details)
208-
sys.exit(1)
204+
try:
205+
defect = rally.update('Defect', defect_data)
206+
except Exception, details:
207+
sys.stderr.write('ERROR: %s \n' % details)
208+
sys.exit(1)
209209

210210
print "Defect %s updated" % defect.FormattedID
211211

@@ -262,18 +262,26 @@ The item names in config files **are** case sensitive.
262262
Prerequisites
263263
-------------
264264

265-
* Python 2.6 or 2.7 (2.7 is preferred) OR
266-
* Python 3.5 (this package not tested with earlier versions of Python 3.x)
265+
* Python 3.5 (this package not tested with earlier versions of Python 3.x) OR
266+
* Python 2.6 or 2.7 (2.7 is preferred)
267267
* The requests_ package, 2.0.0 or better (2.0.0 finally includes support for https proxy),
268268
requests 2.8.1 is recommended.
269269
* The six_ package.
270270

271271
.. _requests: http://github.com/kennethreitz/requests
272-
.. _six: https://bitbucket/gutworth/six
272+
.. _six: https://bitbucket.org/gutworth/six
273273

274274
Versions
275275
--------
276276

277+
**1.2.4**
278+
Fixed handling of projectScopeUp and projectScopeDown keyword arguments for get operation.
279+
Fixed Peristable's __getattr__ method to more properly handle getting the salient item
280+
out of a response to a getResourceByOID request when the item retrieved is a PortfolioItem sub-type.
281+
Fixed defect in SchemaItemAttribute where self._allowed_values_resolved was not always set.
282+
Fixed defect in RallyRestResponse in __repr__ method where on a response that has no qualifying items
283+
an attempt is made to get the Results out of the returned response without going through the QueryResult key.
284+
277285
**1.2.3**
278286
Fixed restapi.py Rally.getAllowedValues method to accommodate custom fields
279287
Allow attribute payload for put and post to have a list of pyral.Entity instances
@@ -310,22 +318,39 @@ Versions
310318

311319
TODO
312320
----
313-
* Investigate permanent location for web-access to rendered documentation
314-
* Dynamically construct the Rally schema hierarchy economically.
321+
* Dynamically construct the Agile Central (Rally) schema class hierarchy economically.
315322

316323

317324
License
318325
-------
319326

320-
BSD3-style license. Copyright (c) 2015-2016 CA Technologies, 2010-2015 Rally Software Development.
327+
BSD3-style license. Copyright (c) 2015-2017 CA Technologies, 2010-2015 Rally Software Development.
321328

322329
See the LICENSE file provided with the source distribution for full details.
323330

331+
332+
Warranty
333+
--------
334+
None. See the LICENSE file for full text regarding this issue.
335+
336+
337+
Support
338+
-------
339+
340+
The use of this package is on an *as-is* basis and there is no official support offered by CA Technologies.
341+
The author of this module periodically checks the GitHub repository issues for this package in the
342+
interests of providing defect fixes and small feature enhancements as time permits, but is not obligated to
343+
respond or take action.
344+
Posts to Stack Overflow (http://stackoverflow.com/questions/ask?tags=rally) are another avenue to engage
345+
others who have some exposure to ``pyral`` and might be able to offer useful information.
346+
347+
324348
Author
325349
------
326350

327351
* Kip Lehman <[email protected]>
328352

353+
329354
Additional Credits
330355
------------------
331356

README.short

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
This is the README file for pyral, a package implementing a
2-
Pythonic interface to the Rally REST API
2+
Pythonic interface to the Agile Central (formerly Rally) REST API
33

44
Description
55
-----------
66

77
The Rally REST Tookit for Python consists of a package that provides a means
88
to interact with entities and artifacts in your Rally subscription. The full
9-
spectrum of CRUD operations is available in your Rally Workspaces and Projects,
10-
providing of course that your Rally subscription credentials enable you to perform
9+
spectrum of CRUD operations is available in your Agile Central (Rally) Workspaces and Projects,
10+
providing of course that your Agile Central (Rally) subscription credentials enable you to perform
1111
those operations. The toolkit insulates the package user from having to make
1212
multiple requests to obtain the full set of qualifying items by performing any
1313
subsequent "page" requests automatically.
@@ -17,10 +17,10 @@ that may be references or collections via the familiar dot '.' notation.
1717
Requirements
1818
------------
1919

20-
The pyral package requires the use of Kenneth Reitz's requests package using version 2.0.0 or better.
20+
The pyral package requires the use of Kenneth Reitz's requests package using version 2.8.0 or better.
2121
As of requests version 2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
2222
The requests package can be found via the Python Package Index site (http://pypi/python.org/index).
23-
The most recent release of pyral (1.2.3) has been tested with requests 2.8.1.
23+
The most recent release of pyral (1.2.4) has been tested with requests 2.8.1.
2424
The six module is also required.
2525

2626

@@ -47,7 +47,8 @@ Documentation
4747
-------------
4848

4949
Obtain the zip file containing the HTML and CSS files comprising the document set for pyral.
50-
Unzip in a suitable location and point your web browser to the doc/build/html/index.html file
50+
Unzip in a suitable location and point your web browser to the doc/build/html/index.html file.
5151

52-
The rendered documentation is also available at http://pyral.readthedocs.io/en/latest/
52+
The rendered documentation is also available at http://pyral.readthedocs.io/en/latest/
53+
and http://pythonhosted.org/pyral
5354

VERSIONS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,10 @@
104104
Allow attribute payload for put and post to have a list of pyral.Entity instances
105105
as values for an attribute that is of type COLLECTION.
106106

107+
1.2.4 - Mar 2017
108+
Fixed handling of projectScopeUp and projectScopeDown keyword arguments in Rally.get operation.
109+
Fixed Peristable's __getattr__ method to more properly handle getting the salient item
110+
out of a response to a getResourceByOID request when the item retrieved is a PortfolioItem sub-type.
111+
Fixed defect in SchemaItemAttribute where self._allowed_values_resolved was not always set.
112+
Fixed defect in RallyRestResponse in __repr__ method where on a response that has no qualifying items
113+
an attempt is made to get the Results out of the returned response without going through the QueryResult key.

build_dist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import re
1414

1515
PACKAGE_NAME = "pyral"
16-
VERSION = "1.2.3"
16+
VERSION = "1.2.4"
1717

1818
AUX_FILES = ['MANIFEST.in',
1919
'PKG-INFO',
@@ -87,10 +87,10 @@ def main(args):
8787
pifi = save_pkg_info(".", 'PKG-INFO', pkg_info)
8888

8989
tarball = make_tarball(PACKAGE_NAME, VERSION, AUX_FILES, EXAMPLES, DOC_FILES)
90-
print tarball
90+
print(tarball)
9191

9292
zipped = make_zipfile(PACKAGE_NAME, VERSION, AUX_FILES, EXAMPLES, DOC_FILES)
93-
print zipped
93+
print(zipped)
9494

9595
zf = zipfile.ZipFile(zipped, 'r')
9696
for info in zf.infolist():
-2.11 KB
Binary file not shown.

doc/build/doctrees/index.doctree

-679 Bytes
Binary file not shown.
-16.6 KB
Binary file not shown.
-1.96 KB
Binary file not shown.

0 commit comments

Comments
 (0)