Skip to content

Commit 96dff8e

Browse files
Merge pull request #120 from klehman-rally/master
custom fields allowedValues retrieval, integration headers handling
2 parents cf3b61f + bc212bf commit 96dff8e

Some content is hidden

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

41 files changed

+370
-132
lines changed

PKG-INFO

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Metadata-Version: 1.1
22
Name: pyral
3-
Version: 1.3.0
4-
Summary: Python toolkit for Rally REST API
3+
Version: 1.3.1
4+
Summary: Python toolkit for Agile Central (Rally) REST API
55
Home-page: https://github.com/RallyTools/RallyRestToolkitForPython
6-
Author: Kip Lehman (Rally Software Development)
6+
Author: Kip Lehman (CA Technologies, AgileCentral Business Unit)
77
License: BSD
8-
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.3.0.zip
8+
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.3.1.zip
99
Description: This is the README file for pyral, a package implementing a
1010
Pythonic interface to the Agile Central (formerly Rally) REST API
1111

@@ -28,18 +28,28 @@ Description: This is the README file for pyral, a package implementing a
2828
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.3.0) has been tested with requests 2.12.5.
31+
The most recent release of pyral (1.3.1) has been tested with requests 2.12.5.
3232
The six module is also required.
3333

3434

3535
Installation
3636
------------
3737

38+
If you want to pull down the latest release from standard Python package repository
39+
(pypi.python.org) and install the package, the easiest way is to use
40+
pip, the Python package installation utility.::
41+
42+
pip install pyral
43+
44+
Alternatively if you've got the tar.gz or zip distribution on hand, as long as you've
45+
satisfied the dependency requirements on the six and requests packages, you can use
46+
the setup mechanism.
3847
Once requests and six has been installed, run the setup.py program supplied with
3948
this distribution as::
4049

4150
python setup.py install
4251

52+
4353
Validation
4454
----------
4555

@@ -63,7 +73,7 @@ Description: This is the README file for pyral, a package implementing a
6373

6474
Keywords: rally,agilecentral,api
6575
Requires: six
66-
Requires: requests>=2.8.1
76+
Requires: requests>=2.10.1
6777
Platform: any
6878
Classifier: Development Status :: 5 - Production/Stable
6979
Classifier: Environment :: Web Environment
@@ -74,5 +84,6 @@ Classifier: Programming Language :: Python
7484
Classifier: Programming Language :: Python :: 2.6
7585
Classifier: Programming Language :: Python :: 2.7
7686
Classifier: Programming Language :: Python :: 3.5
87+
Classifier: Programming Language :: Python :: 3.6
7788
Classifier: Topic :: Internet :: WWW/HTTP
7889
Classifier: Topic :: Software Development :: Libraries

README.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ The git repository is available at https://github.com/RallyTools/RallyRestToolki
3535
Installation
3636
````````````
3737

38+
If you want to pull down the latest release from standard Python package repository
39+
(pypi.python.org) and install the package, the easiest way is to use
40+
pip, the Python package installation utility.::
41+
42+
pip install pyral
43+
44+
Alternatively, if you've got the tar.gz or zip distribution on hand, as long as you've
45+
satisfied the dependency requirements on the six and requests packages, you can use
46+
the setup mechanism.
3847
Obtain the requests_ package and install it according to that package's directions.
3948
As of requests-2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
4049
Use of requests-2.x or better is recommended for use with pyral.
4150
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.3.0) has been tested using requests 2.12.5.
51+
The most recent release of pyral (1.3.1) has been tested using requests 2.12.5.
4352

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

@@ -67,7 +76,7 @@ relevant packages.
6776
>> import requests
6877
>> import pyral
6978
>> pyral.__version__
70-
(1, 3, 0)
79+
(1, 3, 1)
7180

7281

7382

@@ -273,6 +282,17 @@ Prerequisites
273282

274283
Versions
275284
--------
285+
**1.3.1**
286+
Adjusted getAllowedValues so that custom fields with an allowedValues endpoint get resolved.
287+
Disqualifed a group of standard attributes whose allowedValue is of type COLLECTION when retrieving
288+
allowed values in SchemaItem.complete(). This is primarily relevant only to attributes defined as
289+
Drop Down List or Multi Value Drop Down List.
290+
Fixed mechanism of supplying headers dict to Rally instantiation so that the X-RallyIntegration*
291+
headers get overwritten with supplied headers (for name, vendor, version) to better identify the
292+
origin of the integration.
293+
Updated official name to reference Agile Central in setup.py, mention threads keyword arg in the
294+
get method in the the interface.rst file.
295+
276296
**1.3.0**
277297
Introduced automatic multi-threading for Rally.get operation to speed up retrieval of large
278298
result sets. Implemented step two of the Pinger deprecation plan, ping=False is the new default.

README.short

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,28 @@ Requirements
2020
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.3.0) has been tested with requests 2.12.5.
23+
The most recent release of pyral (1.3.1) has been tested with requests 2.12.5.
2424
The six module is also required.
2525

2626

2727
Installation
2828
------------
2929

30+
If you want to pull down the latest release from standard Python package repository
31+
(pypi.python.org) and install the package, the easiest way is to use
32+
pip, the Python package installation utility.::
33+
34+
pip install pyral
35+
36+
Alternatively if you've got the tar.gz or zip distribution on hand, as long as you've
37+
satisfied the dependency requirements on the six and requests packages, you can use
38+
the setup mechanism.
3039
Once requests and six has been installed, run the setup.py program supplied with
3140
this distribution as::
3241

3342
python setup.py install
3443

44+
3545
Validation
3646
----------
3747

VERSIONS

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,22 @@
111111
Fixed defect in SchemaItemAttribute where self._allowed_values_resolved was not always set.
112112
Fixed defect in RallyRestResponse in __repr__ method where on a response that has no qualifying items
113113
an attempt is made to get the Results out of the returned response without going through the QueryResult key.
114+
115+
1.3.0 - Apr 2017
116+
Introduced automatic multi-threading for Rally.get operation to speed up retrieval of large
117+
result sets. Implemented step two of the Pinger deprecation plan, ping=False is the new default.
118+
Increased default page size to 500. Maximum useful page size limit is 2000 but 1000 seems
119+
to be the sweet spot for multithreading requests.
120+
Fixed Rally.getAllUsers so that non subscription admin accounts can see the user list.
121+
Updated recommendation for version of requests package.
122+
123+
1.3.1 - Apr 2017
124+
Adjusted getAllowedValues so that custom fields with an allowedValues endpoint get resolved.
125+
Disqualifed a group of standard attributes whose allowedValue is of type COLLECTION when retrieving
126+
allowed values in SchemaItem.complete(). This is primarily relevant only to attributes defined as
127+
Drop Down List or Multi Value Drop Down List.
128+
Fixed mechanism of supplying headers dict to Rally instantiation so that the X-RallyIntegration*
129+
headers get overwritten with supplied headers (for name, vendor, version) to better identify the
130+
origin of the integration.
131+
Updated official name to reference Agile Central in setup.py, mention threads keyword arg in the
132+
get method in the the interface.rst file.

build_dist.py

100755100644
Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
#############################################################################
88

99
import sys, os
10+
import types
1011
import tarfile
1112
import zipfile
1213
import shutil
1314
import re
1415

1516
PACKAGE_NAME = "pyral"
16-
VERSION = "1.3.0"
17+
VERSION = "1.3.1"
1718

1819
AUX_FILES = ['MANIFEST.in',
1920
'PKG-INFO',
@@ -71,6 +72,7 @@
7172
'test/test_inflation.py',
7273
'test/test_field_access.py',
7374
'test/test_workspaces.py'
75+
'test/test_allowed_values.py',
7476
'test/test_wksprj_setting.py',
7577
'test/test_query.py',
7678
'test/test_big_query.py',
@@ -103,28 +105,36 @@ def main(args):
103105
reduction_pct = int(reduction_fraction * 100)
104106
print("%-52.52s %6d (%2d%%)" % (info.filename, info.compress_size, reduction_pct))
105107

106-
# got to use Python 2.7 to be able to run python setup.py bdist_wheel
107-
os.system('/usr/local/bin/python setup.py bdist_wheel')
108+
# in order to get a wheel file built, the python used has to have available a setup.py
109+
# that exposes a bdist_wheel method, which in versions of python beyond 2.7, like 3.5., 3.6, etc
110+
# you'll need to have done a 'pip install wheel' which sets up the necessary infrastructure.
111+
os.system('python setup.py bdist_wheel')
108112
wheel_file = "%s-%s-py2.py3-none-any.whl" % (PACKAGE_NAME, VERSION)
109113
# the wheel_file gets written into the dist subdir by default, no need for a copy...
110114

111115
store_packages('dist', [tarball])
112116
store_packages('dists', [tarball, zipped])
113117

118+
doc_dir = 'doc/build/html'
119+
doc_files = [path.split('/')[-1] for path in DOC_FILES if path.startswith(doc_dir)]
120+
webdocs_zip = make_online_docs_zipfile(PACKAGE_NAME, VERSION, doc_dir, doc_files)
121+
webdocs_location = os.path.join(doc_dir, webdocs_zip)
122+
store_packages('dist', [webdocs_location])
123+
114124
################################################################################
115125

116126
def store_packages(subdir, files):
117127
for file in files:
118128
if os.path.exists(file):
119-
shutil.copy(file, '%s/%s' % (subdir, file))
129+
leaf_name = os.path.basename(file)
130+
shutil.copy(file, '%s/%s' % (subdir, leaf_name))
120131
else:
121132
problem = "No such file found: {0} to copy into {1}".format(file, subdir)
122133
sys.stderr.write(problem)
123134

124135
################################################################################
125136

126137
def package_meta(filename):
127-
import imp
128138

129139
if not os.path.exists(filename):
130140
raise Exception('No such file: %s' % filename)
@@ -136,8 +146,8 @@ def package_meta(filename):
136146
assignments = "\n".join(consties)
137147

138148
#print(assignments)
139-
pkgcfg = imp.new_module('pkgcfg')
140-
exec(assignments, pkgcfg.__dict__)
149+
pkgcfg = types.ModuleType('pkgcfg') # make a new empty module, internally.. no file created
150+
exec(assignments, pkgcfg.__dict__) # now populate the module with our assignments
141151
sys.modules['pkgcfg'] = pkgcfg
142152
return pkgcfg
143153

@@ -220,6 +230,25 @@ def make_tarball(pkg_name, pkg_version, base_files, example_files, doc_files):
220230

221231
################################################################################
222232

233+
def make_online_docs_zipfile(pkg_name, pkg_version, doc_dir, doc_files):
234+
zf_name = '%s-%s.docs.html.zip' % (pkg_name, pkg_version)
235+
cur_dir = os.getcwd()
236+
os.chdir(doc_dir)
237+
zf = zipfile.ZipFile(zf_name, 'w')
238+
for fn in doc_files:
239+
zf.write(fn, fn, zipfile.ZIP_DEFLATED)
240+
zf.close()
241+
242+
## The following is what has been done before on the command line, when you
243+
## get the recursion opt on the above logic you can drop the os.system call
244+
os.system("zip %s -r %s" % (zf_name, " ".join(doc_files)))
245+
##
246+
247+
os.chdir(cur_dir)
248+
return zf_name
249+
250+
################################################################################
251+
223252
def make_zipfile(pkg_name, pkg_version, base_files, example_files, doc_files):
224253
base_dir = '%s-%s' % (pkg_name, pkg_version)
225254

73.3 KB
Binary file not shown.
74.9 KB
Binary file not shown.

dist/pyral-1.3.1.docs.html.zip

874 KB
Binary file not shown.

dist/pyral-1.3.1.tar.gz

949 KB
Binary file not shown.

dists/pyral-1.3.1.tar.gz

949 KB
Binary file not shown.

0 commit comments

Comments
 (0)