Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Rename aleph-client -> aleph-sdk-python #8

Merged
merged 3 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ jobs:

- name: Install the Python wheel
run: |
python3 -m pip install dist/aleph_client-*.whl
python3 -m pip install dist/aleph_sdk_python-*.whl

- name: Import and use the package
# macos tests fail this step because they use Python 3.11, which is not yet supported by our dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: |
python3 -c "import aleph.sdk"
python3 -c "from aleph.sdk.chains.ethereum import get_fallback_account; get_fallback_account()"
10 changes: 5 additions & 5 deletions .github/workflows/pytest-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:

# Use GitHub's Docker registry to cache intermediate layers
- run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
- run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client-build-cache || true
- run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python-build-cache || true

- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t aleph-client:${GITHUB_REF##*/} -f docker/${{matrix.image}}.dockerfile --cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client-build-cache
docker build . -t aleph-sdk-python:${GITHUB_REF##*/} -f docker/${{matrix.image}}.dockerfile --cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python-build-cache

- name: Push the image on GitHub's repository
run: docker tag aleph-client:${GITHUB_REF##*/} docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client:${GITHUB_REF##*/} && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client:${GITHUB_REF##*/} || true
run: docker tag aleph-sdk-python:${GITHUB_REF##*/} docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python:${GITHUB_REF##*/} && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python:${GITHUB_REF##*/} || true

- name: Cache the image on GitHub's repository
run: docker tag aleph-client:${GITHUB_REF##*/} docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client-build-cache && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-client-build-cache || true
run: docker tag aleph-sdk-python:${GITHUB_REF##*/} docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python-build-cache && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/aleph-sdk-python-build-cache || true

- name: Pytest in the Docker image
run: |
docker run --entrypoint /opt/venv/bin/pytest aleph-client:${GITHUB_REF##*/} /opt/aleph-client/
docker run --entrypoint /opt/venv/bin/pytest aleph-sdk-python:${GITHUB_REF##*/} /opt/aleph-sdk-python/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Python SDK for the Aleph.im network, next generation network of decentralized bi
Development follows the [Aleph Whitepaper](https://github.com/aleph-im/aleph-whitepaper).

## Documentation
Documentation (albeit still vastly incomplete as it is a work in progress) can be found at [http://aleph-client.readthedocs.io/](http://aleph-client.readthedocs.io/) or built from this repo with:
Documentation (albeit still vastly incomplete as it is a work in progress) can be found at [http://aleph-sdk-python.readthedocs.io/](http://aleph-sdk-python.readthedocs.io/) or built from this repo with:

```shell
$ python setup.py docs
Expand Down
8 changes: 4 additions & 4 deletions docker/python-3.10.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \

RUN useradd -s /bin/bash --create-home user
RUN mkdir /opt/venv
RUN mkdir /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
RUN chown user:user /opt/venv
RUN chown user:user /opt/aleph-client
RUN chown user:user /opt/aleph-sdk-python

USER user
RUN python3 -m venv /opt/venv
Expand All @@ -23,10 +23,10 @@ RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
RUN pip install --upgrade 'aleph-message~=0.3.0' eth_account pynacl base58
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests

WORKDIR /opt/aleph-client/
WORKDIR /opt/aleph-sdk-python/
COPY . .
USER root
RUN chown -R user:user /opt/aleph-client
RUN chown -R user:user /opt/aleph-sdk-python

RUN pip install -e .[testing,ethereum,solana,tezos]

Expand Down
8 changes: 4 additions & 4 deletions docker/python-3.11.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \

RUN useradd -s /bin/bash --create-home user
RUN mkdir /opt/venv
RUN mkdir /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
RUN chown user:user /opt/venv
RUN chown user:user /opt/aleph-client
RUN chown user:user /opt/aleph-sdk-python

USER user
RUN python3 -m venv /opt/venv
Expand All @@ -23,10 +23,10 @@ RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
RUN pip install --upgrade 'aleph-message~=0.3.0' eth_account pynacl base58
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests

WORKDIR /opt/aleph-client/
WORKDIR /opt/aleph-sdk-python/
COPY . .
USER root
RUN chown -R user:user /opt/aleph-client
RUN chown -R user:user /opt/aleph-sdk-python

RUN pip install -e .[testing,ethereum,solana,tezos]

Expand Down
8 changes: 4 additions & 4 deletions docker/python-3.9.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \

RUN useradd -s /bin/bash --create-home user
RUN mkdir /opt/venv
RUN mkdir /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
RUN chown user:user /opt/venv
RUN chown user:user /opt/aleph-client
RUN chown user:user /opt/aleph-sdk-python

USER user
RUN python3 -m venv /opt/venv
Expand All @@ -23,10 +23,10 @@ RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
RUN pip install --upgrade 'aleph-message~=0.3.0' eth_account pynacl base58
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests

WORKDIR /opt/aleph-client/
WORKDIR /opt/aleph-sdk-python/
COPY . .
USER root
RUN chown -R user:user /opt/aleph-client
RUN chown -R user:user /opt/aleph-sdk-python

RUN pip install -e .[testing,ethereum,solana,tezos]

Expand Down
10 changes: 5 additions & 5 deletions docker/ubuntu-20.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \

RUN useradd -s /bin/bash --create-home user
RUN mkdir /opt/venv
RUN mkdir /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
RUN chown user:user /opt/venv
RUN chown user:user /opt/aleph-client
RUN chown user:user /opt/aleph-sdk-python

USER user
RUN python3 -m venv /opt/venv
Expand All @@ -28,12 +28,12 @@ RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
RUN pip install --upgrade 'aleph-message~=0.3.0' eth_account pynacl base58
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests

WORKDIR /opt/aleph-client/
WORKDIR /opt/aleph-sdk-python/
COPY . .
USER root
RUN chown -R user:user /opt/aleph-client
RUN chown -R user:user /opt/aleph-sdk-python

RUN git config --global --add safe.directory /opt/aleph-client
RUN git config --global --add safe.directory /opt/aleph-sdk-python
RUN pip install -e .[testing,ethereum,solana,tezos]

RUN mkdir /data
Expand Down
10 changes: 5 additions & 5 deletions docker/ubuntu-22.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \

RUN useradd -s /bin/bash --create-home user
RUN mkdir /opt/venv
RUN mkdir /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
RUN chown user:user /opt/venv
RUN chown user:user /opt/aleph-client
RUN chown user:user /opt/aleph-sdk-python

USER user
RUN python3 -m venv /opt/venv
Expand All @@ -28,12 +28,12 @@ RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
RUN pip install --upgrade 'aleph-message~=0.3.0' eth_account pynacl base58
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests

WORKDIR /opt/aleph-client/
WORKDIR /opt/aleph-sdk-python/
COPY . .
USER root
RUN chown -R user:user /opt/aleph-client
RUN chown -R user:user /opt/aleph-sdk-python

RUN git config --global --add safe.directory /opt/aleph-client
RUN git config --global --add safe.directory /opt/aleph-sdk-python
RUN pip install -e .[testing,ethereum,solana,tezos]

RUN mkdir /data
Expand Down
4 changes: 2 additions & 2 deletions docker/with-ipfs.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
libsecp256k1-dev \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /opt/aleph-client/
WORKDIR /opt/aleph-client/
RUN mkdir /opt/aleph-sdk-python/
WORKDIR /opt/aleph-sdk-python/
COPY . .

RUN pip install -e .[testing,ethereum]
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PAPER =
BUILDDIR = ../build/sphinx/
AUTODOCDIR = api
AUTODOCBUILD = sphinx-apidoc
PROJECT = aleph-client
PROJECT = aleph-sdk-python
MODULEDIR = ../src/aleph_client

# User-friendly check for sphinx-build
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
master_doc = 'index'

# General information about the project.
project = u'aleph-client'
project = u'aleph-sdk-python'
copyright = u'2019, Aleph.im'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -148,7 +148,7 @@
'logo': 'logo.svg',
'description': 'Aleph Network Client',
'github_user': 'aleph-im',
'github_repo': 'aleph-client',
'github_repo': 'aleph-sdk-python',
'github_button': True,
'github_type': 'star',
'github_banner': True,
Expand Down Expand Up @@ -253,7 +253,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'user_guide.tex', u'aleph-client Documentation',
('index', 'user_guide.tex', u'aleph-sdk-python Documentation',
u'Aleph.im', 'manual'),
]

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
============
aleph-client
aleph-sdk-python
============

This is the documentation of **aleph-client**.
This is the documentation of **aleph-sdk-python**.

Contents
========
Expand Down
6 changes: 3 additions & 3 deletions examples/httpgateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import click
from aiohttp import web

from aleph_client.chains.common import get_fallback_private_key
from aleph_client.chains.ethereum import ETHAccount
from aleph_client.user_session import AuthenticatedUserSession
from aleph.sdk.chains.common import get_fallback_private_key
from aleph.sdk.chains.ethereum import ETHAccount
from aleph.sdk.user_session import AuthenticatedUserSession

app = web.Application()
routes = web.RouteTableDef()
Expand Down
12 changes: 7 additions & 5 deletions examples/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import psutil
from aleph_message.models import AlephMessage

from aleph_client import AuthenticatedUserSession
from aleph_client.chains.ethereum import get_fallback_account
from aleph_client.conf import settings
from aleph_client.types import MessageStatus
from aleph_client.user_session import AuthenticatedUserSessionSync
from aleph.sdk.chains.ethereum import get_fallback_account
from aleph.sdk.conf import settings
from aleph.sdk.types import MessageStatus
from aleph.sdk.user_session import (
AuthenticatedUserSession,
AuthenticatedUserSessionSync,
)


def get_sysinfo():
Expand Down
8 changes: 4 additions & 4 deletions examples/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import aiomqtt
import click

from aleph_client import AuthenticatedUserSession
from aleph_client.chains.common import get_fallback_private_key
from aleph_client.chains.ethereum import ETHAccount
from aleph_client.conf import settings
from aleph.sdk.chains.common import get_fallback_private_key
from aleph.sdk.chains.ethereum import ETHAccount
from aleph.sdk.conf import settings
from aleph.sdk.user_session import AuthenticatedUserSession


def get_input_data(value):
Expand Down
10 changes: 5 additions & 5 deletions examples/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import click
from aleph_message.models import StoreMessage

from aleph_client.chains.common import get_fallback_private_key
from aleph_client.chains.ethereum import ETHAccount
from aleph_client.conf import settings
from aleph_client.types import MessageStatus
from aleph_client.user_session import AuthenticatedUserSession
from aleph.sdk.chains.common import get_fallback_private_key
from aleph.sdk.chains.ethereum import ETHAccount
from aleph.sdk.conf import settings
from aleph.sdk.types import MessageStatus
from aleph.sdk.user_session import AuthenticatedUserSession

DEFAULT_SERVER = "https://api2.aleph.im"

Expand Down
4 changes: 2 additions & 2 deletions scripts/build-and-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ else
DOCKER_COMMAND=docker
fi

$DOCKER_COMMAND build -t aleph-client -f docker/Dockerfile .
$DOCKER_COMMAND run -ti --rm --entrypoint /bin/bash -v "$(pwd)":/opt/aleph-client aleph-client
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
$DOCKER_COMMAND run -ti --rm --entrypoint /bin/bash -v "$(pwd)":/opt/aleph-sdk-python aleph-sdk-python
6 changes: 3 additions & 3 deletions scripts/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ else
DOCKER_COMMAND=docker
fi

$DOCKER_COMMAND build -t aleph-client -f docker/Dockerfile .
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/pytest aleph-client /opt/aleph-client/ "$@"
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/mypy aleph-client /opt/aleph-client/src/ --ignore-missing-imports
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/pytest aleph-sdk-python /opt/aleph-sdk-python/ "$@"
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/mypy aleph-sdk-python /opt/aleph-sdk-python/src/ --ignore-missing-imports
8 changes: 4 additions & 4 deletions scripts/build-to-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ fi
mkdir -p ./dist
chmod 0777 ./dist

$DOCKER_COMMAND build -t aleph-client -f docker/Dockerfile .
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
$DOCKER_COMMAND run -ti --rm \
-w /opt/aleph-client \
-v "$(pwd)/dist":/opt/aleph-client/dist \
-w /opt/aleph-sdk-python \
-v "$(pwd)/dist":/opt/aleph-sdk-python/dist \
--entrypoint /bin/bash \
aleph-client
aleph-sdk-python
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files

[metadata]
name = aleph-client
name = aleph-sdk-python
description = Lightweight Python Client library for the Aleph.im network
author = Aleph.im Team
author_email = hello@aleph.im
license = mit
long_description = file: README.rst
long_description_content_type = text/x-rst; charset=UTF-8
url = https://github.com/aleph-im/aleph-client
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
url = https://github.com/aleph-im/aleph-sdk-python
project_urls =
Documentation = https://aleph.im/
# Change if running only on Windows, Mac or Linux (comma-separated)
Expand Down Expand Up @@ -51,7 +51,7 @@ exclude =

[options.extras_require]
# Add here additional requirements for extra features, to install with:
# `pip install aleph-client[PDF]` like:
# `pip install aleph-sdk-python[PDF]` like:
# PDF = ReportLab; RXP
# Add here test requirements (semicolon/line-separated)
testing =
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/aleph_client/__init__.py → src/aleph/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from pkg_resources import DistributionNotFound, get_distribution

from .user_session import AuthenticatedUserSession, UserSession
from aleph.sdk.user_session import AuthenticatedUserSession, UserSession

try:
# Change here if project is renamed and does not equal the package name
dist_name = "aleph-client"
dist_name = "aleph-sdk-python"
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = "unknown"
Expand Down
10 changes: 5 additions & 5 deletions src/aleph_client/account.py → src/aleph/sdk/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from pathlib import Path
from typing import Optional, Type, TypeVar

from aleph_client.chains.common import get_fallback_private_key
from aleph_client.chains.ethereum import ETHAccount
from aleph_client.chains.remote import RemoteAccount
from aleph_client.conf import settings
from aleph_client.types import AccountFromPrivateKey
from aleph.sdk.chains.common import get_fallback_private_key
from aleph.sdk.chains.ethereum import ETHAccount
from aleph.sdk.chains.remote import RemoteAccount
from aleph.sdk.conf import settings
from aleph.sdk.types import AccountFromPrivateKey

logger = logging.getLogger(__name__)

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from coincurve.keys import PrivateKey
from ecies import decrypt, encrypt

from aleph_client.conf import settings
from aleph.sdk.conf import settings


def get_verification_buffer(message):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading