-
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
* fix warning, fix #288 * include VERSION in package_data, fix #289 * fix #285, add special handling for question marks during url parsing * add unit test, fix #47
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ include LICENSE | |
include README.rst | ||
include CHANGELOG.rst | ||
include setup.py | ||
include smart_open/VERSION |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.8.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,20 @@ | |
""" | ||
|
||
import logging | ||
import os.path | ||
|
||
from .smart_open_lib import open, smart_open, register_compressor | ||
from .s3 import iter_bucket as s3_iter_bucket | ||
__all__ = ['open', 'smart_open', 's3_iter_bucket', 'register_compressor'] | ||
|
||
|
||
def _get_version(): | ||
curr_dir = os.path.dirname(os.path.abspath(__file__)) | ||
with open(os.path.join(curr_dir, 'VERSION')) as fin: | ||
return fin.read().strip() | ||
|
||
|
||
__version__ = _get_version() | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mpenkov
Author
Collaborator
|
||
|
||
logger = logging.getLogger(__name__) | ||
logger.addHandler(logging.NullHandler()) |
May be safer like this?
That is, keep a plain version string only in
setup.py
; read the run-time version frompkg_resources
.I'm not sure if there are any disadvantages / gotchas, but it seems cleaner and less error-prone (no need for any extra file and extra code).