Skip to content

Commit 8577ee8

Browse files
Merge pull request #94 from klehman-rally/master
pyral 1.2.1 release
2 parents b55b541 + 384724f commit 8577ee8

59 files changed

Lines changed: 12730 additions & 794 deletions

Some content is hidden

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

MANIFEST

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ examples/showdefects.py
1717
examples/statecounts.py
1818
examples/crtask.py
1919
examples/uptask.py
20-
examples/typedefs.py
20+
examples/typedef.py
2121
examples/repoitems.py
2222
examples/wkspcounts.py
2323
examples/builddefs.py
2424
examples/creattach.py
2525
examples/get_attachments.py
26+
examples/get_schedulable_artifacts.py
2627
examples/get_schema.py
28+
examples/defrevs.py
2729
examples/add_tcrs.py
30+
examples/updtag.py
31+
examples/addtags.py

MANIFEST.in

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
1-
LICENSE
2-
README.short
3-
README.rst
4-
setup.py
5-
template.cfg
6-
rallyfire.py
7-
pyral/__init__.py
8-
pyral/config.py
9-
pyral/context.py
10-
pyral/entity.py
11-
pyral/hydrate.py
12-
pyral/rallyresp.py
13-
pyral/restapi.py
14-
examples/typedef.py
15-
examples/get_schema.py
16-
examples/periscope.py
17-
examples/getitem.py
18-
examples/showdefects.py
19-
examples/statecounts.py
20-
examples/wkspcounts.py
21-
examples/crtask.py
22-
examples/uptask.py
23-
examples/repoitems.py
24-
examples/builddefs.py
25-
examples/creattach.py
26-
examples/get_attachments.py
27-
examples/add_tcrs.py
1+
include LICENSE README.short README.rst setup.py
2+
include template.cfg rallyfire.py
3+
recursive-include pyral *.py
4+
recursive-include doc *.txt *.html *.js *.css *.png *.gif
5+
recursive-include examples *.py
6+

PKG-INFO

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Metadata-Version: 1.1
2+
Name: pyral
3+
Version: 1.2.1
4+
Summary: Python toolkit for Rally REST API
5+
Home-page: https://github.com/RallyTools/RallyRestToolkitForPython
6+
Author: Kip Lehman (Rally Software Development)
7+
License: BSD
8+
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.2.1.zip
9+
Description: This is the README file for pyral, a package implementing a
10+
Pythonic interface to the Rally REST API
11+
12+
Description
13+
-----------
14+
15+
The Rally REST Tookit for Python consists of a package that provides a means
16+
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
19+
those operations. The toolkit insulates the package user from having to make
20+
multiple requests to obtain the full set of qualifying items by performing any
21+
subsequent "page" requests automatically.
22+
An additional key feature is the ability to obtain entity sub fields
23+
that may be references or collections via the familiar dot '.' notation.
24+
25+
Requirements
26+
------------
27+
28+
The pyral package requires the use of Kenneth Reitz's requests package using version 2.0.0 or better.
29+
As of requests version 2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
30+
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.1) has been tested with requests 2.8.1.
32+
The six module is also required.
33+
34+
35+
Installation
36+
------------
37+
38+
Once requests and six has been installed, run the setup.py program supplied with
39+
this distribution as::
40+
41+
python setup.py install
42+
43+
Validation
44+
----------
45+
46+
Copy the template.cfg file to a file named my.cfg.
47+
Edit my.cfg. Uncomment and replace the values for SERVER, USER, PASSWORD.
48+
Leave the WORKSPACE and PROJECT entries commented out for now.
49+
50+
Run the rallyfire.py program as:
51+
52+
$ python rallyfire.py --config=my.cfg
53+
54+
Documentation
55+
-------------
56+
57+
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
59+
60+
The rendered documentation is also available at http://pyral.readthedocs.io/en/latest/
61+
62+
63+
Keywords: rally,agilecentral,api
64+
Requires: six
65+
Requires: requests>=2.8.1
66+
Platform: any
67+
Classifier: Development Status :: 5 - Production/Stable
68+
Classifier: Environment :: Web Environment
69+
Classifier: Intended Audience :: Developers
70+
Classifier: License :: OSI Approved :: BSD License
71+
Classifier: Operating System :: OS Independent
72+
Classifier: Programming Language :: Python
73+
Classifier: Programming Language :: Python :: 2.6
74+
Classifier: Programming Language :: Python :: 2.7
75+
Classifier: Programming Language :: Python :: 3.5
76+
Classifier: Topic :: Internet :: WWW/HTTP
77+
Classifier: Topic :: Software Development :: Libraries

README.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ 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.0) has been tested using requests 2.8.1.
42+
The most recent release of pyral (1.2.1) has been tested using requests 2.8.1.
43+
44+
Obtain and install the six_ module (available from PyPI at https://pypi.python.org/pypi/six)
4345

4446

4547
Unpack the ``pyral`` distribution file (zip or tar.gz) and then install the pyral_ package.
@@ -61,11 +63,11 @@ relevant packages.
6163
::
6264

6365
$ python
64-
Python 2.7.11 [other Python interpreter info elided ...]
66+
Python 3.5.1 [other Python interpreter info elided ...]
6567
>> import requests
6668
>> import pyral
6769
>> pyral.__version__
68-
(1, 2, 0)
70+
(1, 2, 1)
6971

7072

7173

@@ -105,7 +107,7 @@ Common setup code ::
105107
options = [arg for arg in sys.argv[1:] if arg.startswith('--')]
106108
args = [arg for arg in sys.argv[1:] if arg not in options]
107109
server, user, password, apikey, workspace, project = rallyWorkset(options)
108-
rally = Rally(server, user, password, workspace=workspace, project=project)
110+
rally = Rally(server, user, password, apikey=apikey, workspace=workspace, project=project)
109111
rally.enableLogging('mypyral.log')
110112

111113
Show a TestCase identified by the **FormattedID** value.
@@ -253,6 +255,7 @@ The item names in config files **are** case sensitive.
253255
--apikey=<APIKey> valid Rally API Key value
254256
--rallyWorkspace=<bar> Workspace in Rally you want to interact with
255257
--rallyProject=<bar> Project in Rally you want to interact with
258+
--ping boolean, ping Rally server before connection attempt?
256259
====================================== =========================================
257260

258261

@@ -263,16 +266,24 @@ Prerequisites
263266
* Python 3.5 (this package not tested with earlier versions of Python 3.x)
264267
* The requests_ package, 2.0.0 or better (2.0.0 finally includes support for https proxy),
265268
requests 2.8.1 is recommended.
269+
* The six_ package.
266270

267271
.. _requests: http://github.com/kennethreitz/requests
272+
.. _six: https://bitbucket/gutworth/six
268273

269274
Versions
270275
--------
271276

272-
1.2.0
277+
**1.2.1**
278+
Added mention that the six package is required.
279+
Fixed context setup for proper handling when a user has no default workspace/project settings.
280+
Corrected handling of allowedValues for attributes when the single allowedValue is a boolean value.
281+
Added an allowedValues.py example script.
282+
283+
**1.2.0**
273284
Support for Python 3.5.x
274285
Begin deprecation sequence for pinging the Rally server before the connection attempt,
275-
initially with this version, allow option on instantiation to bypass ping.
286+
initially with this version, allow option on instantiation to bypass ping.
276287
Added ability to rankAbove, rankBelow, rankToTop, rankToBottom for an Artifact.
277288
Fixed defect where user has no default workspace or project.
278289

@@ -286,7 +297,7 @@ Versions
286297
1.1.1
287298
Modified entity.py to allow it to pass back PortfolioItem sub type instances.
288299
Modified rallyresp.py defect referencing non-existing req_type instance var by changing
289-
reference to request_type.
300+
reference to request_type.
290301
Modified restapi.py to use user, dropped auth_user.
291302
Modified restapi.py to be more defensive when user has no associated UserProfile.
292303
Modified context.py to account for use of Cygwin in Pinger code.
@@ -296,7 +307,7 @@ Versions
296307
Modified restapi.py/entity.py to provide rudimentary support for querying of RecycleBin entries.
297308
Modified restapi.py and added search_utils.py to provide a search method for pyral Rally instances.
298309
Modified rallyresp.py to better handle some boundary conditions when response body item counts
299-
differ from what is stated in the TotalResultCount.
310+
differ from what is stated in the TotalResultCount.
300311
Modified context.py to account for scenario where user's default workspace has no projects.
301312
Modified restapi.py/getProject to return correct project.
302313

README.short

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ Requirements
2020
The pyral package requires the use of Kenneth Reitz's requests package using version 2.0.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.0) has been tested with requests 2.8.1.
23+
The most recent release of pyral (1.2.1) has been tested with requests 2.8.1.
24+
The six module is also required.
2425

2526

2627
Installation
2728
------------
2829

29-
Once requests has been installed, run the setup.py program supplied with
30+
Once requests and six has been installed, run the setup.py program supplied with
3031
this distribution as::
3132

3233
python setup.py install

build_dist.py

100755100644
Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import sys, os
1010
import tarfile
1111
import zipfile
12+
import re
1213

1314
PACKAGE_NAME = "pyral"
14-
VERSION = "1.2.0"
15+
VERSION = "1.2.1"
1516

1617
AUX_FILES = ['MANIFEST.in',
18+
'PKG-INFO',
1719
'LICENSE',
1820
'README.short',
1921
'README.rst',
@@ -30,14 +32,16 @@
3032
'repoitems.py',
3133
'get_schema.py',
3234
'typedef.py',
35+
'allowedValues.py',
3336
'wkspcounts.py',
3437
'builddefs.py',
3538
'creattach.py',
3639
'get_attachments.py',
3740
'get_schedulable_artifacts.py',
3841
'add_tcrs.py',
3942
'defrevs.py',
40-
'updtag.py'
43+
'updtag.py',
44+
'addtags.py'
4145
]
4246
DOC_FILES = ['doc/Makefile',
4347
'doc/source/conf.py',
@@ -75,6 +79,11 @@
7579
################################################################################
7680

7781
def main(args):
82+
pkgcfg = package_meta('setup.py')
83+
#peek_in_to_pkg(pkgcfg)
84+
pkg_info = pkg_info_content(pkgcfg)
85+
pifi = save_pkg_info(".", 'PKG-INFO', pkg_info)
86+
7887
tarball = make_tarball(PACKAGE_NAME, VERSION, AUX_FILES, EXAMPLES, DOC_FILES)
7988
print tarball
8089

@@ -93,6 +102,74 @@ def main(args):
93102

94103
################################################################################
95104

105+
def package_meta(filename):
106+
import imp
107+
108+
if not os.path.exists(filename):
109+
raise Exception('No such file: %s' % filename)
110+
with open(filename, 'r') as pcf:
111+
content = pcf.read()
112+
chunk, setup = re.split('setup\(', content, maxsplit=1, flags=re.M)
113+
consties = [line for line in chunk.split("\n")
114+
if (len(line) > 0 and line[0] == " ") or re.search(r'^[A-Z]', line)]
115+
assignments = "\n".join(consties)
116+
117+
#print(assignments)
118+
pkgcfg = imp.new_module('pkgcfg')
119+
exec(assignments, pkgcfg.__dict__)
120+
sys.modules['pkgcfg'] = pkgcfg
121+
return pkgcfg
122+
123+
################################################################################
124+
125+
def indentified_text(source_body):
126+
"""
127+
The source_body should be a single string with embedded newline chars.
128+
This function splits the string on the newline chars, yielding a list
129+
of strings. The indentation should only be performed lines after the first
130+
line. The first line shall have no indentation performed.
131+
Return the result as a single string.
132+
"""
133+
lines = source_body.split("\n")
134+
indented = [' %s' % line for ix, line in enumerate(lines) if ix > 0]
135+
indented.insert(0, lines[0])
136+
return "\n".join(indented)
137+
138+
139+
def pkg_info_content(pkgcfg):
140+
with open(pkgcfg.SHORT_DESCRIPTION, 'r') as sdf:
141+
short_desc = indentified_text(sdf.read())
142+
meta_ver = 'Metadata-Version: 1.1'
143+
name = 'Name: %s' % pkgcfg.PACKAGE
144+
version = 'Version: %s' % pkgcfg.VERSION
145+
summary = 'Summary: %s' % pkgcfg.OFFICIAL_NAME
146+
homepage = 'Home-page: %s' % pkgcfg.GITHUB_SITE
147+
author = 'Author: %s' % pkgcfg.AUTHOR
148+
license = 'License: %s' % pkgcfg.LICENSE
149+
download = 'Download-URL: %s' % pkgcfg.DOWNLOADABLE_ZIP
150+
desc = 'Description: %s' % short_desc
151+
keywords = 'Keywords: %s' % ",".join(pkgcfg.KEYWORDS)
152+
requires = ['Requires: %s' % reqmt for reqmt in pkgcfg.REQUIRES]
153+
platform = 'Platform: %s' % pkgcfg.PLATFORM
154+
classifiers = ['Classifier: %s' % item for item in pkgcfg.CLASSIFIERS]
155+
156+
pki_items = [meta_ver, name, version, summary, homepage, author, license,
157+
download, desc, keywords,
158+
"\n".join(requires), platform, "\n".join(classifiers)
159+
]
160+
pkg_info = "\n".join(pki_items)
161+
return pkg_info
162+
163+
164+
def save_pkg_info(directory, filename, pkg_info):
165+
full_path = os.path.join(directory, filename)
166+
with open(full_path, 'w') as pif:
167+
pif.write(pkg_info)
168+
pif.write("\n")
169+
return full_path
170+
171+
################################################################################
172+
96173
def make_tarball(pkg_name, pkg_version, base_files, example_files, doc_files):
97174

98175
base_dir = '%s-%s' % (pkg_name, pkg_version)
@@ -146,7 +223,6 @@ def make_zipfile(pkg_name, pkg_version, base_files, example_files, doc_files):
146223
elif os.path.isdir(doc_item):
147224
sub_items = os.listdir(doc_item)
148225
for sub_item in sub_items:
149-
150226
zf.write('%s/%s' % (doc_item, sub_item), '%s/%s/%s' % (base_dir, doc_item, sub_item), zipfile.ZIP_DEFLATED)
151227

152228
zf.close()
69.4 KB
Binary file not shown.

dist/pyral-1.2.1.tar.gz

941 KB
Binary file not shown.

dist/pyral-1.2.1.zip

318 KB
Binary file not shown.
1.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)