-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 Compatibility (Part 2) #111
Changes from all commits
a1a9ac1
cc6790b
bdb0a05
bbcca36
c1f65b5
85a18ba
68c03e6
d03727e
8ea4984
b461bb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,25 @@ doc: | |
@echo Generated documentation: "file://"$$(readlink -f doc/build/html/index.html) | ||
@echo | ||
|
||
doc3: | ||
python3 setup.py build_sphinx | ||
@echo | ||
@echo Generated documentation: "file://"$$(readlink -f doc/build/html/index.html) | ||
@echo | ||
|
||
test: | ||
-find coverage/ -mindepth 1 -delete | ||
python $$(which nosetests) $${TESTS} | ||
|
||
test3: | ||
-find coverage/ -mindepth 1 -delete | ||
python3 $$(which nosetests3) $${TESTS} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this target should go. a separate these makefile targets only exist because it makes development from within a virtualenv easier (no need to run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I have no knowledge of |
||
clean: | ||
find . -name '*.py[co]' -delete | ||
|
||
dist: test | ||
python setup.py sdist | ||
|
||
dist3: test3 | ||
python3 setup.py sdist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this target is not needed at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. I've been using python3 in my invocations for building the package using stdeb, and blindly copied it in for creating the source distribution. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
# All configuration values have a default; values that are commented out | ||
# serve to show the default. | ||
|
||
import sys, os | ||
import imp | ||
from os.path import dirname, join | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
|
@@ -48,11 +49,13 @@ | |
# built documents. | ||
# | ||
# The short X.Y version. | ||
execfile(os.path.join(os.path.dirname(__file__), '../happybase/_version.py')) | ||
version = __version__ | ||
|
||
version_path = join(dirname(__file__), '../happybase/_version.py') | ||
with open(version_path) as fp: | ||
version = imp.load_source("_version", version_path, fp).__version__ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwiw, the __version__ = None
exec(open('happybase/_version.py', 'r').read()) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# The full version, including alpha/beta/rc tags. | ||
release = __version__ | ||
release = version | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ struct ColumnDescriptor { | |
6:i32 bloomFilterVectorSize = 0, | ||
7:i32 bloomFilterNbHashes = 0, | ||
8:bool blockCacheEnabled = 0, | ||
9:i32 timeToLive = -1 | ||
9:i32 timeToLive = 0x7fffffff | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. am i right in assuming that this is a unmodified upstream version of the thrift file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're correct. |
||
} | ||
|
||
/** | ||
|
@@ -906,22 +906,6 @@ service Hbase { | |
1:ScannerID id | ||
) throws (1:IOError io, 2:IllegalArgument ia) | ||
|
||
/** | ||
* Get the row just before the specified one. | ||
* | ||
* @return value for specified row/column | ||
*/ | ||
list<TCell> getRowOrBefore( | ||
/** name of table */ | ||
1:Text tableName, | ||
|
||
/** row key */ | ||
2:Text row, | ||
|
||
/** column name */ | ||
3:Text family | ||
) throws (1:IOError io) | ||
|
||
/** | ||
* Get the regininfo for the specified row. It scans | ||
* the metatable to find region's start and end keys. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ def _reset_mutations(self): | |
|
||
def send(self): | ||
"""Send the batch to the server.""" | ||
bms = [BatchMutation(row, m) for row, m in self._mutations.iteritems()] | ||
bms = [BatchMutation(row, m) for row, m in self._mutations.items()] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this makes copies into a new list which iterated over and then thrown away in python 2 :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I thought about creating a separate utility function just for iterating over items:
PEP 469 recommends this approach, though also mentions that |
||
if not bms: | ||
return | ||
|
||
|
@@ -80,7 +80,7 @@ def put(self, row, data, wal=None): | |
column=column, | ||
value=value, | ||
writeToWAL=wal) | ||
for column, value in data.iteritems()) | ||
for column, value in data.items()) | ||
|
||
self._mutation_count += len(data) | ||
if self._batch_size and self._mutation_count >= self._batch_size: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is not really needed. a separate
tox
environment for building the docs is perhaps a better solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what
tox
is. Do whatever you think is reasonable for your development needs.