Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
88811a26
Kaydet (Commit)
88811a26
authored
May 25, 2016
tarafından
Daniel Nephin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1071 from graingert/support-py35
support Python 3.5
üst
26f2b696
98093544
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
70 deletions
+36
-70
.travis.yml
.travis.yml
+2
-1
Dockerfile-py3
Dockerfile-py3
+1
-1
container.py
docker/api/container.py
+1
-1
utils.py
docker/utils/utils.py
+2
-8
api.md
docs/api.md
+2
-2
tls.md
docs/tls.md
+1
-1
setup.py
setup.py
+4
-0
test-requirements.txt
test-requirements.txt
+2
-3
utils_test.py
tests/unit/utils_test.py
+19
-51
tox.ini
tox.ini
+2
-2
No files found.
.travis.yml
Dosyayı görüntüle @
88811a26
sudo
:
false
language
:
python
python
:
-
"
2.7
"
-
"
3.5
"
env
:
-
TOX_ENV=py26
-
TOX_ENV=py27
-
TOX_ENV=py33
-
TOX_ENV=py34
-
TOX_ENV=py35
-
TOX_ENV=flake8
install
:
-
pip install tox
...
...
Dockerfile-py3
Dosyayı görüntüle @
88811a26
FROM python:3.
4
FROM python:3.
5
MAINTAINER Joffrey F <joffrey@docker.com>
RUN mkdir /home/docker-py
...
...
docker/api/container.py
Dosyayı görüntüle @
88811a26
...
...
@@ -187,7 +187,7 @@ class ContainerApiMixin(object):
url
=
self
.
_url
(
"/containers/{0}/kill"
,
container
)
params
=
{}
if
signal
is
not
None
:
params
[
'signal'
]
=
signal
params
[
'signal'
]
=
int
(
signal
)
res
=
self
.
_post
(
url
,
params
=
params
)
self
.
_raise_for_status
(
res
)
...
...
docker/utils/utils.py
Dosyayı görüntüle @
88811a26
...
...
@@ -546,12 +546,6 @@ def datetime_to_timestamp(dt):
return
delta
.
seconds
+
delta
.
days
*
24
*
3600
def
longint
(
n
):
if
six
.
PY3
:
return
int
(
n
)
return
long
(
n
)
def
parse_bytes
(
s
):
if
isinstance
(
s
,
six
.
integer_types
+
(
float
,)):
return
s
...
...
@@ -574,7 +568,7 @@ def parse_bytes(s):
if
suffix
in
units
.
keys
()
or
suffix
.
isdigit
():
try
:
digits
=
long
int
(
digits_part
)
digits
=
int
(
digits_part
)
except
ValueError
:
raise
errors
.
DockerException
(
'Failed converting the string value for memory ({0}) to'
...
...
@@ -582,7 +576,7 @@ def parse_bytes(s):
)
# Reconvert to long for the final result
s
=
long
int
(
digits
*
units
[
suffix
])
s
=
int
(
digits
*
units
[
suffix
])
else
:
raise
errors
.
DockerException
(
'The specified value for memory ({0}) should specify the'
...
...
docs/api.md
Dosyayı görüntüle @
88811a26
...
...
@@ -109,7 +109,7 @@ correct value (e.g `gzip`).
```
**Raises:**
[
TypeError
](
https://docs.python.org/3.
4
/library/exceptions.html#TypeError
)
if
`path`
nor
https://docs.python.org/3.
5
/library/exceptions.html#TypeError
)
if
`path`
nor
`fileobj`
are specified
## commit
...
...
@@ -207,7 +207,7 @@ of the created container in bytes) or a string with a units identification char
character, bytes are assumed as an intended unit.
`volumes_from`
and
`dns`
arguments raise
[
TypeError
](
https://docs.python.org/3.
4
/library/exceptions.html#TypeError
)
exception if
https://docs.python.org/3.
5
/library/exceptions.html#TypeError
)
exception if
they are used against v1.10 and above of the Docker remote API. Those
arguments should be passed as part of the
`host_config`
dictionary.
...
...
docs/tls.md
Dosyayı görüntüle @
88811a26
...
...
@@ -12,7 +12,7 @@ first.*
*
ca_cert (str): Path to CA cert file
*
verify (bool or str): This can be
`False`
or a path to a CA Cert file
*
ssl_version (int): A valid
[
SSL version
](
https://docs.python.org/3.
4
/library/ssl.html#ssl.PROTOCOL_TLSv1
)
https://docs.python.org/3.
5
/library/ssl.html#ssl.PROTOCOL_TLSv1
)
*
assert_hostname (bool): Verify hostname of docker daemon
### configure_client
...
...
setup.py
Dosyayı görüntüle @
88811a26
...
...
@@ -16,6 +16,7 @@ extras_require = {
':python_version < "3.3"'
:
'ipaddress >= 1.0.16'
,
}
version
=
None
exec
(
open
(
'docker/version.py'
)
.
read
())
with
open
(
'./test-requirements.txt'
)
as
test_reqs_txt
:
...
...
@@ -42,10 +43,13 @@ setup(
'Intended Audience :: Developers'
,
'Operating System :: OS Independent'
,
'Programming Language :: Python'
,
'Programming Language :: Python :: 2'
,
'Programming Language :: Python :: 2.6'
,
'Programming Language :: Python :: 2.7'
,
'Programming Language :: Python :: 3'
,
'Programming Language :: Python :: 3.3'
,
'Programming Language :: Python :: 3.4'
,
'Programming Language :: Python :: 3.5'
,
'Topic :: Utilities'
,
'License :: OSI Approved :: Apache Software License'
,
],
...
...
test-requirements.txt
Dosyayı görüntüle @
88811a26
mock
==1.0.1
pytest
==2.
7.2
pytest
==2.
9.1
coverage
==3.7.1
pytest-cov
==2.1.0
flake8
==2.4.1
\ No newline at end of file
flake8
==2.4.1
tests/unit/utils_test.py
Dosyayı görüntüle @
88811a26
...
...
@@ -299,56 +299,30 @@ class ConverVolumeBindsTest(base.BaseTestCase):
self
.
assertEqual
(
convert_volume_binds
(
data
),
[
'/mnt/vol1:/data:rw'
])
def
test_convert_volume_binds_unicode_bytes_input
(
self
):
if
six
.
PY2
:
expected
=
[
unicode
(
'/mnt/지연:/unicode/박:rw'
,
'utf-8'
)]
data
=
{
'/mnt/지연'
:
{
'bind'
:
'/unicode/박'
,
'mode'
:
'rw'
}
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
else
:
expected
=
[
'/mnt/지연:/unicode/박:rw'
]
expected
=
[
u'/mnt/지연:/unicode/박:rw'
]
data
=
{
bytes
(
'/mnt/지연'
,
'utf-8'
):
{
'bind'
:
bytes
(
'/unicode/박'
,
'utf-8'
),
'mode'
:
'rw'
}
data
=
{
u'/mnt/지연'
.
encode
(
'utf-8'
):
{
'bind'
:
u'/unicode/박'
.
encode
(
'utf-8'
),
'mode'
:
'rw'
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
def
test_convert_volume_binds_unicode_unicode_input
(
self
):
if
six
.
PY2
:
expected
=
[
unicode
(
'/mnt/지연:/unicode/박:rw'
,
'utf-8'
)]
data
=
{
unicode
(
'/mnt/지연'
,
'utf-8'
):
{
'bind'
:
unicode
(
'/unicode/박'
,
'utf-8'
),
'mode'
:
'rw'
}
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
else
:
expected
=
[
'/mnt/지연:/unicode/박:rw'
]
expected
=
[
u'/mnt/지연:/unicode/박:rw'
]
data
=
{
'/mnt/지연'
:
{
'bind'
:
'/unicode/박'
,
'mode'
:
'rw'
}
data
=
{
u'/mnt/지연'
:
{
'bind'
:
u'/unicode/박'
,
'mode'
:
'rw'
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
}
self
.
assertEqual
(
convert_volume_binds
(
data
),
expected
)
class
ParseEnvFileTest
(
base
.
BaseTestCase
):
...
...
@@ -612,13 +586,7 @@ class UtilsTest(base.BaseTestCase):
class
SplitCommandTest
(
base
.
BaseTestCase
):
def
test_split_command_with_unicode
(
self
):
if
six
.
PY2
:
self
.
assertEqual
(
split_command
(
unicode
(
'echo μμ'
,
'utf-8'
)),
[
'echo'
,
'μμ'
]
)
else
:
self
.
assertEqual
(
split_command
(
'echo μμ'
),
[
'echo'
,
'μμ'
])
self
.
assertEqual
(
split_command
(
u'echo μμ'
),
[
'echo'
,
'μμ'
])
@pytest.mark.skipif
(
six
.
PY3
,
reason
=
"shlex doesn't support bytes in py3"
)
def
test_split_command_with_bytes
(
self
):
...
...
tox.ini
Dosyayı görüntüle @
88811a26
[tox]
envlist
=
py26, py27, py33, py34, flake8
envlist
=
py26, py27, py33, py34,
py35,
flake8
skipsdist
=
True
[testenv]
...
...
@@ -11,5 +11,5 @@ deps =
-r{toxinidir}/requirements.txt
[testenv:flake8]
commands
=
flake8 docker tests
commands
=
flake8 docker tests
setup.py
deps
=
flake8
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment