Skip to content

Commit 85dde34

Browse files
committed
Minor adjustments to adapt to changes in async (due to be removed anyway)
1 parent 81707c6 commit 85dde34

File tree

11 files changed

+44
-39
lines changed

11 files changed

+44
-39
lines changed

gitdb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _init_externals():
2727
__author__ = "Sebastian Thiel"
2828
__contact__ = "[email protected]"
2929
__homepage__ = "https://github.com/gitpython-developers/gitdb"
30-
version_info = (0, 5, 4)
30+
version_info = (0, 5, 5)
3131
__version__ = '.'.join(str(i) for i in version_info)
3232

3333

gitdb/base.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Module with basic data structures - they are designed to be lightweight and fast"""
6-
from util import (
7-
bin_to_hex,
8-
zlib
9-
)
10-
6+
from util import bin_to_hex
117
from fun import (
128
type_id_to_type_map,
139
type_to_type_id_map

gitdb/ext/smmap

Submodule smmap updated from 616e9ce to f53ddc6

gitdb/fun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
BadObjectType
1111
)
1212

13-
from util import zlib
13+
import zlib
1414
decompressobj = zlib.decompressobj
1515

1616
import mmap

gitdb/pack.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Contains PackIndexFile and PackFile implementations"""
6+
import zlib
7+
68
from gitdb.exc import (
79
BadObject,
810
UnsupportedOperation,
911
ParseError
1012
)
1113
from util import (
12-
zlib,
1314
mman,
1415
LazyMixin,
1516
unpack_from,

gitdb/stream.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55

66
from cStringIO import StringIO
7-
import errno
7+
import zlib
88
import mmap
99
import os
1010

@@ -23,7 +23,6 @@
2323
make_sha,
2424
write,
2525
close,
26-
zlib
2726
)
2827

2928
has_perf_mod = False

gitdb/test/lib.py

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
ZippedStoreShaWriter
1212
)
1313

14-
from gitdb.util import zlib
15-
1614
import sys
1715
import random
1816
from array import array

gitdb/test/test_stream.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
hex_to_bin
1919
)
2020

21-
from gitdb.util import zlib
21+
import zlib
2222
from gitdb.typ import (
2323
str_blob_type
2424
)
2525

26-
import time
2726
import tempfile
2827
import os
2928

gitdb/util.py

+9-14
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,22 @@
77
import mmap
88
import sys
99
import errno
10-
11-
from cStringIO import StringIO
10+
import stat
1211

1312
# in py 2.4, StringIO is only StringI, without write support.
1413
# Hence we must use the python implementation for this
1514
if sys.version_info[1] < 5:
1615
from StringIO import StringIO
16+
else:
17+
from cStringIO import StringIO
1718
# END handle python 2.4
1819

19-
try:
20-
import async.mod.zlib as zlib
21-
except ImportError:
22-
import zlib
23-
# END try async zlib
24-
2520
from async import ThreadPool
2621
from smmap import (
27-
StaticWindowMapManager,
28-
SlidingWindowMapManager,
29-
SlidingWindowMapBuffer
30-
)
22+
StaticWindowMapManager,
23+
SlidingWindowMapManager,
24+
SlidingWindowMapBuffer
25+
)
3126

3227
# initialize our global memory manager instance
3328
# Use it to free cached (and unused) resources.
@@ -304,7 +299,7 @@ def open(self, write=False, stream=False):
304299
binary = getattr(os, 'O_BINARY', 0)
305300
lockmode = os.O_WRONLY | os.O_CREAT | os.O_EXCL | binary
306301
try:
307-
fd = os.open(self._lockfilepath(), lockmode, 0600)
302+
fd = os.open(self._lockfilepath(), lockmode, stat.S_IREAD|stat.S_IWRITE)
308303
if not write:
309304
os.close(fd)
310305
else:
@@ -373,7 +368,7 @@ def _end_writing(self, successful=True):
373368
# assure others can at least read the file - the tmpfile left it at rw--
374369
# We may also write that file, on windows that boils down to a remove-
375370
# protection as well
376-
chmod(self._filepath, 0644)
371+
chmod(self._filepath, stat.S_IREAD|stat.S_IWRITE|stat.S_IRGRP|stat.S_IROTH)
377372
else:
378373
# just delete the file so far, we failed
379374
os.remove(lockfile)

setup.py

+26-9
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_data_files(self):
7373
__author__ = "Sebastian Thiel"
7474
__contact__ = "[email protected]"
7575
__homepage__ = "https://github.com/gitpython-developers/gitdb"
76-
version_info = (0, 5, 4)
76+
version_info = (0, 5, 5)
7777
__version__ = '.'.join(str(i) for i in version_info)
7878

7979
setup(cmdclass={'build_ext':build_ext_nofail},
@@ -88,15 +88,32 @@ def get_data_files(self):
8888
ext_modules=[Extension('gitdb._perf', ['gitdb/_fun.c', 'gitdb/_delta_apply.c'], include_dirs=['gitdb'])],
8989
license = "BSD License",
9090
zip_safe=False,
91-
requires=('async (>=0.6.1)', 'smmap (>=0.8.0)'),
91+
requires=('async (>=0.6.2)', 'smmap (>=0.8.3)'),
9292
install_requires=('async >= 0.6.1', 'smmap >= 0.8.0'),
9393
long_description = """GitDB is a pure-Python git object database""",
9494
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
9595
classifiers=[
96-
# Specify the Python versions you support here. In particular, ensure
97-
# that you indicate whether you support Python 2, Python 3 or both.
98-
'Programming Language :: Python :: 2',
99-
'Programming Language :: Python :: 2.6',
100-
'Programming Language :: Python :: 2.7',
101-
],
102-
)
96+
# Picked from
97+
# http://pypi.python.org/pypi?:action=list_classifiers
98+
#"Development Status :: 1 - Planning",
99+
#"Development Status :: 2 - Pre-Alpha",
100+
#"Development Status :: 3 - Alpha",
101+
# "Development Status :: 4 - Beta",
102+
"Development Status :: 5 - Production/Stable",
103+
#"Development Status :: 6 - Mature",
104+
#"Development Status :: 7 - Inactive",
105+
"Environment :: Console",
106+
"Intended Audience :: Developers",
107+
"License :: OSI Approved :: BSD License",
108+
"Operating System :: OS Independent",
109+
"Operating System :: POSIX",
110+
"Operating System :: Microsoft :: Windows",
111+
"Operating System :: MacOS :: MacOS X",
112+
"Programming Language :: Python",
113+
"Programming Language :: Python :: 2",
114+
"Programming Language :: Python :: 2.6",
115+
"Programming Language :: Python :: 2.7",
116+
"Programming Language :: Python :: 3",
117+
"Programming Language :: Python :: 3.3",
118+
"Programming Language :: Python :: 3.4",
119+
],)

0 commit comments

Comments
 (0)