Kaydet (Commit) d56b2d3d authored tarafından Joffrey F's avatar Joffrey F Kaydeden (comit) GitHub

Merge pull request #1315 from bfirsh/rename-docker-py-to-docker-sdk-python

Start to rename docker-py to docker-sdk-python
FROM python:2.7 FROM python:2.7
RUN mkdir /home/docker-py RUN mkdir /src
WORKDIR /home/docker-py WORKDIR /src
COPY requirements.txt /home/docker-py/requirements.txt COPY requirements.txt /src/requirements.txt
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY test-requirements.txt /home/docker-py/test-requirements.txt COPY test-requirements.txt /src/test-requirements.txt
RUN pip install -r test-requirements.txt RUN pip install -r test-requirements.txt
COPY . /home/docker-py COPY . /src
RUN pip install . RUN pip install .
FROM python:3.5 FROM python:3.5
RUN mkdir /home/docker-py RUN mkdir /src
WORKDIR /home/docker-py WORKDIR /src
COPY requirements.txt /home/docker-py/requirements.txt COPY requirements.txt /src/requirements.txt
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY docs-requirements.txt /home/docker-py/docs-requirements.txt COPY docs-requirements.txt /src/docs-requirements.txt
RUN pip install -r docs-requirements.txt RUN pip install -r docs-requirements.txt
COPY . /home/docker-py COPY . /src
FROM python:3.5 FROM python:3.5
RUN mkdir /home/docker-py RUN mkdir /src
WORKDIR /home/docker-py WORKDIR /src
COPY requirements.txt /home/docker-py/requirements.txt COPY requirements.txt /src/requirements.txt
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY test-requirements.txt /home/docker-py/test-requirements.txt COPY test-requirements.txt /src/test-requirements.txt
RUN pip install -r test-requirements.txt RUN pip install -r test-requirements.txt
COPY . /home/docker-py COPY . /src
RUN pip install . RUN pip install .
...@@ -8,15 +8,15 @@ clean: ...@@ -8,15 +8,15 @@ clean:
.PHONY: build .PHONY: build
build: build:
docker build -t docker-py . docker build -t docker-sdk-python .
.PHONY: build-py3 .PHONY: build-py3
build-py3: build-py3:
docker build -t docker-py3 -f Dockerfile-py3 . docker build -t docker-sdk-python3 -f Dockerfile-py3 .
.PHONY: build-docs .PHONY: build-docs
build-docs: build-docs:
docker build -t docker-py-docs -f Dockerfile-docs . docker build -t docker-sdk-python-docs -f Dockerfile-docs .
.PHONY: build-dind-certs .PHONY: build-dind-certs
build-dind-certs: build-dind-certs:
...@@ -27,28 +27,28 @@ test: flake8 unit-test unit-test-py3 integration-dind integration-dind-ssl ...@@ -27,28 +27,28 @@ test: flake8 unit-test unit-test-py3 integration-dind integration-dind-ssl
.PHONY: unit-test .PHONY: unit-test
unit-test: build unit-test: build
docker run --rm docker-py py.test tests/unit docker run --rm docker-sdk-python py.test tests/unit
.PHONY: unit-test-py3 .PHONY: unit-test-py3
unit-test-py3: build-py3 unit-test-py3: build-py3
docker run --rm docker-py3 py.test tests/unit docker run --rm docker-sdk-python3 py.test tests/unit
.PHONY: integration-test .PHONY: integration-test
integration-test: build integration-test: build
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-py py.test tests/integration/${file} docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python py.test tests/integration/${file}
.PHONY: integration-test-py3 .PHONY: integration-test-py3
integration-test-py3: build-py3 integration-test-py3: build-py3
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test tests/integration/${file} docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/${file}
.PHONY: integration-dind .PHONY: integration-dind
integration-dind: build build-py3 integration-dind: build build-py3
docker rm -vf dpy-dind || : docker rm -vf dpy-dind || :
docker run -d --name dpy-dind --privileged dockerswarm/dind:1.12.0 docker daemon\ docker run -d --name dpy-dind --privileged dockerswarm/dind:1.12.0 docker daemon\
-H tcp://0.0.0.0:2375 -H tcp://0.0.0.0:2375
docker run --rm --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py\ docker run --rm --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-sdk-python\
py.test tests/integration py.test tests/integration
docker run --rm --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py3\ docker run --rm --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-sdk-python3\
py.test tests/integration py.test tests/integration
docker rm -vf dpy-dind docker rm -vf dpy-dind
...@@ -62,20 +62,20 @@ integration-dind-ssl: build-dind-certs build build-py3 ...@@ -62,20 +62,20 @@ integration-dind-ssl: build-dind-certs build build-py3
--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375
docker run --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\ docker run --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
--env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs"\ --env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs"\
--link=dpy-dind-ssl:docker docker-py py.test tests/integration --link=dpy-dind-ssl:docker docker-sdk-python py.test tests/integration
docker run --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\ docker run --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
--env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs"\ --env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs"\
--link=dpy-dind-ssl:docker docker-py3 py.test tests/integration --link=dpy-dind-ssl:docker docker-sdk-python3 py.test tests/integration
docker rm -vf dpy-dind-ssl dpy-dind-certs docker rm -vf dpy-dind-ssl dpy-dind-certs
.PHONY: flake8 .PHONY: flake8
flake8: build flake8: build
docker run --rm docker-py flake8 docker tests docker run --rm docker-sdk-python flake8 docker tests
.PHONY: docs .PHONY: docs
docs: build-docs docs: build-docs
docker run --rm -it -v `pwd`:/home/docker-py docker-py-docs sphinx-build docs ./_build docker run --rm -it -v `pwd`:/code docker-sdk-python-docs sphinx-build docs ./_build
.PHONY: shell .PHONY: shell
shell: build shell: build
docker run -it -v /var/run/docker.sock:/var/run/docker.sock docker-py python docker run -it -v /var/run/docker.sock:/var/run/docker.sock docker-sdk-python python
...@@ -4,4 +4,4 @@ from .client import DockerClient, from_env ...@@ -4,4 +4,4 @@ from .client import DockerClient, from_env
from .version import version, version_info from .version import version, version_info
__version__ = version __version__ = version
__title__ = 'docker-py' __title__ = 'docker'
...@@ -143,8 +143,8 @@ class APIClient( ...@@ -143,8 +143,8 @@ class APIClient(
warnings.warn( warnings.warn(
'The minimum API version supported is {}, but you are using ' 'The minimum API version supported is {}, but you are using '
'version {}. It is recommended you either upgrade Docker ' 'version {}. It is recommended you either upgrade Docker '
'Engine or use an older version of docker-py.'.format( 'Engine or use an older version of Docker SDK for '
MINIMUM_DOCKER_API_VERSION, self._version) 'Python.'.format(MINIMUM_DOCKER_API_VERSION, self._version)
) )
def _retrieve_server_version(self): def _retrieve_server_version(self):
......
...@@ -158,9 +158,9 @@ class DockerClient(object): ...@@ -158,9 +158,9 @@ class DockerClient(object):
s = ["'DockerClient' object has no attribute '{}'".format(name)] s = ["'DockerClient' object has no attribute '{}'".format(name)]
# If a user calls a method on APIClient, they # If a user calls a method on APIClient, they
if hasattr(APIClient, name): if hasattr(APIClient, name):
s.append("In docker-py 2.0, this method is now on the object " s.append("In Docker SDK for Python 2.0, this method is now on the "
"APIClient. See the low-level API section of the " "object APIClient. See the low-level API section of the "
"documentation for more details.".format(name)) "documentation for more details.")
raise AttributeError(' '.join(s)) raise AttributeError(' '.join(s))
......
...@@ -15,5 +15,5 @@ INSECURE_REGISTRY_DEPRECATION_WARNING = \ ...@@ -15,5 +15,5 @@ INSECURE_REGISTRY_DEPRECATION_WARNING = \
IS_WINDOWS_PLATFORM = (sys.platform == 'win32') IS_WINDOWS_PLATFORM = (sys.platform == 'win32')
DEFAULT_USER_AGENT = "docker-py/{0}".format(version) DEFAULT_USER_AGENT = "docker-sdk-python/{0}".format(version)
DEFAULT_NUM_POOLS = 25 DEFAULT_NUM_POOLS = 25
...@@ -474,7 +474,7 @@ class UserAgentTest(unittest.TestCase): ...@@ -474,7 +474,7 @@ class UserAgentTest(unittest.TestCase):
self.assertEqual(self.mock_send.call_count, 1) self.assertEqual(self.mock_send.call_count, 1)
headers = self.mock_send.call_args[0][0].headers headers = self.mock_send.call_args[0][0].headers
expected = 'docker-py/%s' % docker.__version__ expected = 'docker-sdk-python/%s' % docker.__version__
self.assertEqual(headers['User-Agent'], expected) self.assertEqual(headers['User-Agent'], expected)
def test_custom_user_agent(self): def test_custom_user_agent(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment