Skip to content

Commit bf76926

Browse files
committed
upped version to 0.9.2, 3 new Rally convenience methods, keyword arg to specify whether SSL cert should be checked, fixed addAttachment method, added optional parm to getProject, added HTTP header for Content-Type to be application/json, adjusted processing for query params.
1 parent 62c3a68 commit bf76926

33 files changed

Lines changed: 937 additions & 300 deletions

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ pyral/restapi.py
1414
examples/getitem.py
1515
examples/periscope.py
1616
examples/showdefects.py
17+
examples/statecounts.py
1718
examples/crtask.py
1819
examples/uptask.py
20+
examples/typedefs.py
21+
examples/repoitems.py
22+
examples/wkspcounts.py
23+
examples/builddefs.py
24+
examples/creattach.py
25+
examples/get_attachments.py

README.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ relevant packages.
5555
>> import requests
5656
>> import pyral
5757
>> pyral.__version__
58-
(0, 9, 1)
58+
(0, 9, 2)
5959

6060

6161

@@ -250,14 +250,29 @@ Prerequisites
250250
-------------
251251

252252
* Python 2.6 or 2.7
253-
* The most excellent requests_ package, 0.8.2 or better
253+
* The requests_ package, 0.8.2 or better
254254
Developed using requests 0.9.3.
255-
There are reports where requests > 0.9.3 resulted in connection problems (as in not being able to connect) that may be related to SSL.
255+
There are reports where requests > 0.9.3 resulted in connection problems (as in not being able to connect) that may be related to SSL. You should be able to use the verify_ssl_cert keyword argument when
256+
obtaining a pyral Rally instance to overcome this issue.
256257
If you are using requests >- 0.9.3, you must also have certifi-0.0.8 (available on PyPI)
257258
.. _requests: http://github.com/kennethreitz/requests
258259

259260
Versions
260261
--------
262+
* 0.9.2 - Fixed getProject to take optional project name argument.
263+
Added HTTP header item in config.py to set Content-TYpe to 'application/json'.
264+
Added recognition of verify_ssl_cert=True/False as keyword argment to
265+
Rally constructor. Explicit specification results in passing a
266+
verify=True/False to the underlying requests package. This can be
267+
useful when dealing with an expired SSL certificate.
268+
Upped default WSAPI version in config.py to 1.37 to support dyna-types
269+
(specifically PortfolioItem and sub-types)..
270+
Modified addAttachment to conform with non-backward compatible change in Rally WSAPI
271+
involving how an attachment is related to an artifact.
272+
Fixed defect in calculating an Attachment file size
273+
(use pre-encoded rather than post-encoded size).
274+
This release is intended as the final beta before a 1.0 release.
275+
261276
* 0.9.1 - Upped default WSAPI version in config.py to 1.30
262277
All entities that are subclasses of WorkspaceDomainObject now have a details method
263278
that show the attribute values in an easy to read multiline format.
@@ -285,15 +300,17 @@ Versions
285300
TODO
286301
----
287302

288-
* Python 3.2 + support
303+
* Python 3.3 + support
289304

290-
* Create (better) documentation
305+
* Expand the documentation
291306

292307
* Expand the repertoire of example scripts
293308

294309
* Refactor the source code to make use decorators in pyral.restapi,
295310
dynamically construct the Rally schema hierarchy economically.
296311

312+
* Monitor requests/urllib3 for release that fully supports HTTPS over HTTP proxy.
313+
297314

298315
License
299316
-------

build_dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import zipfile
1212

1313
PACKAGE_NAME = "pyral"
14-
VERSION = "0.9.1"
14+
VERSION = "0.9.2"
1515

1616
AUX_FILES = ['MANIFEST.in',
1717
'LICENSE',

dists/pyral-0.9.2.tar.gz

130 KB
Binary file not shown.

dists/pyral-0.9.2.zip

153 KB
Binary file not shown.
768 Bytes
Binary file not shown.
12.4 KB
Binary file not shown.
6.06 KB
Binary file not shown.

doc/build/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 26e48c491c0189277b14d8a879ea5009
3+
config: 26696598777bc580c07365a7f6fb1114
44
tags: fbb0d17656682115ca4d033fb2f83ba1

doc/build/html/_sources/interface.txt

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The priority chain consists of these steps:
3939
- RALLY_PROJECT
4040
* if present, use information from a rally-<version>.cfg file in the current directory,
4141
where <version> matches the Rally WSAPI version defined in the pyral.config module.
42-
Currently, that version is defined as 1.29.
42+
Currently, that version is defined as 1.37.
4343
* if present, use the contents of a file named in the RALLY_CONFIG environment variable.
4444
* if present, use the contents of a config named on the command line via the --config-<filename>
4545
option
@@ -136,17 +136,17 @@ Rally
136136
either in this specific order or as keyword arguments.
137137

138138
You can optionally specify the following as keyword arguments.
139-
* version
140139
* workspace
141140
* project
142-
* version (specify the Rally WSAPI version, default is 1.29)
141+
* version (specify the Rally WSAPI version, default is 1.37)
142+
* verify_ssl_cert (True or False, default is True)
143143
* warn (True or False, default is True)
144144
Controls whether a warning is issued if no project is specified
145145
and the default project for the user is not in the workspace specified.
146146
Under those conditions, the project is changed to the first project
147147
(alphabetic ordering) in the list of projects for the specified workspace.
148148

149-
.. py:class:: Rally (server, user, password, version=1.29, workspace=None, project=None, warn=True)
149+
.. py:class:: Rally (server, user, password, version=1.34, workspace=None, project=None, warn=True)
150150

151151
Examples::
152152

@@ -156,7 +156,7 @@ Examples::
156156

157157
rally = Rally(server, user, password, workspace='Division #1 Products', project='ABC')
158158

159-
rally = Rally(server, user, password, workspace='Brontoville', warn=False)
159+
rally = Rally(server, user, password, workspace='Brontoville', verify_ssl_cert=False, warn=False)
160160

161161

162162

@@ -305,10 +305,15 @@ pyral.Rally instance convenience methods
305305
that project in subsequent interractions with Rally.
306306

307307

308-
.. method:: getProject(projectName)
308+
.. method:: getProject(name=None)
309309

310-
Returns an instance of a Project entity with information about the project
311-
in the currently active context.
310+
Returns a minimally hydrated Project entity instance with the Name and ref
311+
of the project in the currently active context if the name keyword arg
312+
is not supplied or the Name and ref of the project identified by the value of
313+
the name parameter as long as the name identifies a valid project in the currently
314+
selected workspace.
315+
Returns None if a name parameter is supplied that does not identify a valid project
316+
in the currently selected workspace.
312317

313318

314319
.. method:: getProjects(workspace=None)
@@ -337,7 +342,6 @@ pyral.Rally instance convenience methods
337342
Returns None if there is no match in the Rally subscription/workspace for
338343
the keyword argument used to identify the user target.
339344

340-
341345
.. method:: getAllUsers(workspace=None)
342346

343347
This method offers a convenient one-stop means of obtaining usable information
@@ -347,6 +351,28 @@ pyral.Rally instance convenience methods
347351
Return a list of User instances (fully hydrated for scalar attributes)
348352
whose ref and collection attributes will be lazy eval'ed upon access.
349353

354+
.. method:: typedef(entityName)
355+
356+
This method returns a TypeDefinition instance for the given entityName.
357+
The is handy for occasions where you need identify a specific entity
358+
for something like 'Feature' or 'Theme' when creating or updating a
359+
PortfolioItem subclass. Intended usage is to use the return *.ref* attribute.
360+
For example, within an info dict, "PortfolioItemType" : rally.typedef('Feature').ref .
361+
362+
.. method:: getState(entityName, stateName)
363+
364+
As of Rally WSAPI 1.37 (Sep 2012), the State attribute is no longer a String value for
365+
many entities, it is itself an entity (aka Rally Type). To be able to create (or update)
366+
an Artifact's State attribute, you must provide a reference (_ref or ref) in the information
367+
dictionary used to populate the Artifact's attributes. This method provides an
368+
easy means of obtaining the appropriate entity for the particular entity and state Name
369+
you want. Typically the usage would be along the lines of this example:
370+
info = { ...., "State" : rally.getState('Feature', 'Discovering').ref, ... })
371+
372+
.. method:: getStates(entityName)
373+
374+
Given an entityName, returns a list of State instances populated with information
375+
about each state value permitted for the entityName.
350376

351377
.. method:: getAllowedValues(entityName, attributeName [,workspace=None])
352378

@@ -359,6 +385,7 @@ pyral.Rally instance convenience methods
359385
it exists and then attempt to add an Attachment with the name and
360386
contents of filename into Rally and associate that Attachment with the
361387
Artifact.
388+
Returns the Attachment item.
362389

363390
.. method:: addAttachments(artifact, attachments)
364391

@@ -480,3 +507,50 @@ Item Attributes
480507
print task.oid, task.Name, task.ActualHours
481508

482509

510+
.. method:: details()
511+
512+
This convenience method is available on all *WorkspaceDomain*
513+
subclass instances and provides an organized and easy to read multiline string
514+
with the content of the instance.
515+
516+
Example::
517+
518+
response = rally.get('UserStory', fetch=True, query='FormattedID = S321')
519+
story1 = response.next()
520+
print story1.details()
521+
522+
HierarchicalRequirement
523+
oid : 12345678
524+
ref : hierarchicalrequirement/12345678
525+
ObjectID : 12345678
526+
_ref : https://rallydev.rallydev.com/slm/webservice/1.30/hierarchicalrequirement/12345678.js
527+
_CreatedAt : today at 3:14 am
528+
_hydrated : True
529+
Name : Filbert nuts should be added to all energy bars
530+
Subscription : Subscription.ref (OID 400060 Name: Company 1)
531+
Workspace : Workspace.ref (OID 722746 Name: Prime Cuts Workspace)
532+
FormattedID : S321
533+
534+
AcceptedDate : None
535+
AccountingProjec : None
536+
AccountingTask : None
537+
AffectedCustomer :
538+
Attachments : []
539+
Blocked : False
540+
Blocker : None
541+
Capitalizable : None
542+
Changesets : []
543+
Children : []
544+
CreationDate : 2012-07-12T09:14:35.852Z
545+
DefectStatus : NONE
546+
Defects : []
547+
Description : As a health conscious PO, I want better nutritional content in all bars
548+
Discussion : []
549+
IdeaURL : <pyral.entity.CustomField object at 0x101931290>
550+
IdeaVotes : None
551+
InProgressDate : 2012-07-12T09:14:36.098Z
552+
Iteration : Iteration.ref (OID 1242381 Name Iteration 5 (Summer))
553+
KanbanState : Accepted
554+
LastUpdateDate : 2012-07-12T09:14:36.237Z
555+
...
556+

0 commit comments

Comments
 (0)