Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Move SDK to top-level
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Beck-Buysse <[email protected]>
  • Loading branch information
rbuysse committed Feb 18, 2019
1 parent c67bb0d commit cf25d39
Show file tree
Hide file tree
Showing 59 changed files with 38 additions and 39 deletions.
3 changes: 1 addition & 2 deletions sdk/python/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# docker build -f sdk/python/Dockerfile-installed -t sawtooth-sdk-python-local .
# docker build -f Dockerfile -t sawtooth-sdk-python-local .

# -------------=== python sdk build ===-------------

Expand Down Expand Up @@ -50,6 +50,5 @@ WORKDIR /project/sawtooth-core

CMD echo "\033[0;32m--- Building python sdk ---\n\033[0m" \
&& bin/protogen \
&& cd sdk/python \
&& python3 setup.py clean --all \
&& python3 setup.py build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# docker build -f sdk/python/Dockerfile-installed-bionic -t sawtooth-sdk-python .
# docker build -f Dockerfile-installed-bionic -t sawtooth-sdk-python .

# -------------=== signing build ===-------------
FROM ubuntu:bionic as sawtooth-signing-builder
Expand Down Expand Up @@ -77,7 +77,7 @@ COPY . /project
RUN dpkg -i /tmp/python3-sawtooth-*.deb || true \
&& apt-get -f -y install \
&& /project/bin/protogen \
&& cd /project/sdk/python \
&& cd /project \
&& if [ -d "debian" ]; then rm -rf debian; fi \
&& python3 setup.py clean --all \
&& python3 setup.py --command-packages=stdeb.command debianize \
Expand All @@ -92,7 +92,7 @@ RUN apt-get update \
&& apt-get install gnupg -y

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

RUN echo "deb http://repo.sawtooth.me/ubuntu/ci bionic universe" >> /etc/apt/sources.list \
&& (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# docker build -f sdk/python/Dockerfile-installed-xenial -t sawtooth-sdk-python .
# docker build -f Dockerfile-installed-xenial -t sawtooth-sdk-python .

# -------------=== signing build ===-------------
FROM ubuntu:xenial as sawtooth-signing-builder
Expand Down Expand Up @@ -71,7 +71,7 @@ COPY . /project
RUN dpkg -i /tmp/python3-sawtooth-*.deb || true \
&& apt-get -f -y install \
&& /project/bin/protogen \
&& cd /project/sdk/python \
&& cd /project \
&& if [ -d "debian" ]; then rm -rf debian; fi \
&& python3 setup.py clean --all \
&& python3 setup.py --command-packages=stdeb.command debianize \
Expand All @@ -83,7 +83,7 @@ RUN dpkg -i /tmp/python3-sawtooth-*.deb || true \
FROM ubuntu:xenial

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \
&& (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
Expand Down
2 changes: 1 addition & 1 deletion bin/intkey
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sys.path.insert(0, os.path.join(
'sdk', 'examples', 'intkey_python'))
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'sdk', 'python'))
))

from sawtooth_intkey.client_cli.intkey_cli import main_wrapper

Expand Down
2 changes: 1 addition & 1 deletion bin/intkey-tp-python
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sys.path.insert(0, os.path.join(
'sdk', 'examples', 'intkey_python'))
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'sdk', 'python'))
))
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'signing'))
Expand Down
2 changes: 1 addition & 1 deletion bin/noop
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sys.path.insert(0, os.path.join(
'sdk', 'examples', 'noop_python'))
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'sdk', 'python'))
))

from sawtooth_noop.client_cli.main import main_wrapper

Expand Down
2 changes: 1 addition & 1 deletion bin/protogen
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main(args=None):
# Generate and distribute top-level protos
proto_dir = JOIN(TOP_DIR, "protos")

protoc(proto_dir, "sdk/python", "sawtooth_sdk/protobuf")
protoc(proto_dir, TOP_DIR, "sawtooth_sdk/protobuf")


def protoc(src_dir, base_dir, pkg, language="python"):
Expand Down
4 changes: 2 additions & 2 deletions bin/run_bandit
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
top_dir=$(cd $(dirname $(dirname $0)) && pwd)

directories="
sdk/python/build
sdk/python/sawtooth_processor_test
build
sawtooth_processor_test
signing/build
signing/tests
"
Expand Down
4 changes: 2 additions & 2 deletions bin/run_lint
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ export PYTHONPATH
lint signing "$SINCE" || retval=1

# sdk, xo, intkey
PYTHONPATH=$top_dir/sdk/python
PYTHONPATH=$top_dir/
PYTHONPATH=$PYTHONPATH:$top_dir/sdk/examples/intkey_python
PYTHONPATH=$PYTHONPATH:$top_dir/sdk/examples/xo_python
PYTHONPATH=$PYTHONPATH:$top_dir/signing
export PYTHONPATH
lint sdk/python "$SINCE" || retval=1
lint . "$SINCE" || retval=1
lint sdk/examples/intkey_python "$SINCE" || retval=1
lint sdk/examples/xo_python "$SINCE" || retval=1

Expand Down
2 changes: 1 addition & 1 deletion bin/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ test_signing() {
}

test_python_sdk() {
run_docker_test ./sdk/python/tests/unit_python_sdk.yaml
run_docker_test ./tests/unit_python_sdk.yaml
copy_coverage .coverage.test_python_sdk
run_docker_test ./sdk/examples/intkey_python/tests/test_tp_intkey_python.yaml
copy_coverage .coverage.test_tp_intkey_python
Expand Down
2 changes: 1 addition & 1 deletion bin/xo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sys.path.insert(0, os.path.join(

sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'sdk', 'python'))
))

sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
Expand Down
2 changes: 1 addition & 1 deletion bin/xo-tp-python
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sys.path.insert(0, os.path.join(

sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'sdk', 'python'))
))

sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
Expand Down
2 changes: 1 addition & 1 deletion ci/sawtooth-publish-python-sdk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ password=@PASS@\n\

CMD sed -i'' -e "s/@USER@/$PYPI_USER/g" /root/.pypirc \
&& sed -i'' -e "s/@PASS@/$PYPI_PASS/g" /root/.pypirc \
&& cd /project/sawtooth-core/sdk/python \
&& cd /project/sawtooth-core/ \
&& python3 setup.py sdist upload -r pypi \
&& cd /project/sawtooth-core/signing \
&& python3 setup.py sdist upload -r pypi
2 changes: 1 addition & 1 deletion docker-compose-installed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
python-sdk:
build:
context: .
dockerfile: sdk/python/Dockerfile-installed-${DISTRO}
dockerfile: Dockerfile-installed-${DISTRO}
args:
- http_proxy
- https_proxy
Expand Down
2 changes: 1 addition & 1 deletion docker/compose/sawtooth-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
python-sdk:
build:
context: ../../
dockerfile: ./sdk/python/Dockerfile
dockerfile: ./Dockerfile
args:
- http_proxy
- https_proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ services:
test_intkey_smoke.TestIntkeySmoke
stop_signal: SIGKILL
environment:
PYTHONPATH: "/project/sawtooth-core/sdk/python:\
PYTHONPATH: "/project/sawtooth-core:\
/project/sawtooth-core/sdk/examples/intkey_python:\
/project/sawtooth-core/integration:\
/project/sawtooth-core/signing"
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ services:
test_two_families.TestTwoFamilies
stop_signal: SIGKILL
environment:
PYTHONPATH: "/project/sawtooth-core/sdk/python:\
PYTHONPATH: "/project/sawtooth-core:\
/project/sawtooth-core/sdk/examples/intkey_python:\
/project/sawtooth-core/integration:\
/project/sawtooth-core/signing"
2 changes: 1 addition & 1 deletion integration/sawtooth_integration/docker/test_workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ services:
test_workload
stop_signal: SIGKILL
environment:
PYTHONPATH: "/project/sawtooth-core/sdk/python:\
PYTHONPATH: "/project/sawtooth-core:\
/project/sawtooth-core/sdk/examples/intkey_python:\
/project/sawtooth-core/integration:\
/project/sawtooth-core/signing:\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ services:
stop_signal: SIGKILL
environment:
TP_LANG: "python"
PYTHONPATH: "/project/sawtooth-core/sdk/python:\
PYTHONPATH: "/project/sawtooth-core:\
/project/sawtooth-core/integration:\
/project/sawtooth-core/signing"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions sdk/examples/intkey_python/Dockerfile-installed-bionic
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci bionic universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -131,7 +131,7 @@ RUN apt-get update \
systemd

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-intkey-tp-builder /project/sdk/examples/python3-sawtooth-intkey*.deb /tmp

Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/intkey_python/Dockerfile-installed-xenial
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -117,7 +117,7 @@ RUN dpkg -i /tmp/python3-sawtooth-*.deb || true \
FROM ubuntu:xenial

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-intkey-tp-builder /project/sdk/examples/python3-sawtooth-intkey*.deb /tmp

Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/intkey_python/Dockerfile-tests-installed
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci bionic universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -130,7 +130,7 @@ RUN apt-get update \
&& apt-get install gnupg -y

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-intkey-tests-builder /project/sdk/examples/python3-sawtooth-intkey*.deb /tmp

Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/xo_python/Dockerfile-installed-bionic
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci bionic universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -130,7 +130,7 @@ RUN apt-get update \
systemd

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-xo-tp-builder /project/sdk/examples/python3-sawtooth-xo*.deb /tmp

Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/xo_python/Dockerfile-installed-xenial
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -116,7 +116,7 @@ RUN dpkg -i /tmp/python3-sawtooth-*.deb || true \
FROM ubuntu:xenial

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-xo-tp-builder /project/sdk/examples/python3-sawtooth-xo*.deb /tmp

Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/xo_python/Dockerfile-tests-installed
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN echo "deb http://repo.sawtooth.me/ubuntu/ci bionic universe" >> /etc/apt/sou
python3-stdeb

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY . /project

Expand All @@ -130,7 +130,7 @@ RUN apt-get update \
&& apt-get install gnupg -y

COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /project/sdk/python3-sawtooth-sdk*.deb /tmp
COPY --from=sawtooth-sdk-python-builder /python3-sawtooth-sdk*.deb /tmp

COPY --from=python-xo-tests-builder /project/sdk/examples/python3-sawtooth-xo*.deb /tmp

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/setup.py → setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
setup(
name='sawtooth-sdk',
version=subprocess.check_output(
['../../bin/get_version']).decode('utf-8').strip(),
['./bin/get_version']).decode('utf-8').strip(),
description='Sawtooth Python SDK',
author='Hyperledger Sawtooth',
url='https://github.com/hyperledger/sawtooth-core',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cf25d39

Please sign in to comment.