Skip to content

Commit

Permalink
Merge branch 'soroban'
Browse files Browse the repository at this point in the history
# Conflicts:
#	poetry.lock
#	pyproject.toml
  • Loading branch information
overcat committed Sep 19, 2023
2 parents dcaa6bb + b444030 commit eb3555e
Show file tree
Hide file tree
Showing 637 changed files with 25,840 additions and 4,605 deletions.
17 changes: 4 additions & 13 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:jammy

# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
# this user's GID/UID must match your local user UID/GID to avoid permission issues
Expand All @@ -20,20 +20,11 @@ RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \
make \
python-is-python3 \
python3 \
python3-pip \
ruby \
fish && \
python3-pip && \
apt-get autoclean -y && \
apt-get autoremove -y && \
apt-get clean

# Install xdrgen
RUN cd /opt && \
git clone --branch python-sdk https://github.com/overcat/xdrgen && \
cd xdrgen && \
gem build xdrgen.gemspec && \
gem install xdrgen-*.gem

# Install poetry
RUN pip install poetry

Expand All @@ -46,7 +37,7 @@ ENV LC_ALL en_US.UTF-8

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/fish --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support for the non-root user
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
Expand All @@ -57,4 +48,4 @@ ENV DEBIAN_FRONTEND=

USER $USERNAME

CMD ["/bin/fish"]
CMD ["/bin/bash"]
41 changes: 9 additions & 32 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/ubuntu-18.04-git
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "Stellar Python SDK Dev",
"name": "python dev",
"dockerFile": "Dockerfile",
"build": {
"args": {}
Expand All @@ -10,37 +9,15 @@
"remoteEnv": {
// "PIP_INDEX_URL": "https://mirrors.ustc.edu.cn/pypi/web/simple"
},
// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [],
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
},
"fish": {
"path": "/bin/fish"
}
},
"terminal.integrated.defaultProfile.linux": "fish"
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [3000],
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference.
// "portsAttributes": {
// },
// Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'.
// "otherPortsAttributes": {
// "onAutoForward": "silent"
// },
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "poetry install",
"postCreateCommand": "poetry install --all-extras",
"postAttachCommand": "poetry shell",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": ["donjayamanne.python-extension-pack"],
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// On Linux, this will prevent new files getting created as root, but you may need to update the USER_UID
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
"remoteUser": "vscode"
}
62 changes: 38 additions & 24 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
name: GitHub Action
name: Test and Deploy

on:
push:
pull_request:
branches-ignore:
- 'temp*'
- 'tmp*'
release:
types: [ created ]
types:
- created

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: pre-commit/[email protected]

test:
runs-on: ubuntu-latest
needs: pre-commit
strategy:
fail-fast: false
matrix:
Expand All @@ -21,6 +29,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Start httpbin server
run: |
docker run -d -p 9876:80 kennethreitz/httpbin
- name: Install poetry
run: pipx install poetry

Expand All @@ -32,17 +44,19 @@ jobs:

- name: Install dependencies
run: |
poetry install
poetry install --extras 'aiohttp'
- name: Ensure httpbin server is running
run: |
while true; do response=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9876/get); if [ "$response" = "200" ]; then echo "HTTP 200 OK received"; break; else echo "Retrying..."; sleep 1; fi; done
- name: Echo installed packages
run: |
poetry show
- name: Test with pytest
run: poetry run pytest -v -rs tests --runslow --cov=./ --cov-report=xml

- name: Test with pytest (runtime type checking disabled)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7'
run: poetry run pytest -v -rs tests --runslow
env:
STELLAR_SDK_RUNTIME_TYPE_CHECKING: 0

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7'
uses: codecov/codecov-action@v3
Expand All @@ -55,6 +69,7 @@ jobs:

mypy-check:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- uses: actions/checkout@v3

Expand All @@ -69,7 +84,7 @@ jobs:

- name: Install dependencies
run: |
poetry install
poetry install --extras 'aiohttp'
- name: Run mypy check
run: |
Expand All @@ -78,25 +93,24 @@ jobs:
poetry run mypy examples
deploy:
needs: test
needs: [ test, mypy-check ]
runs-on: ubuntu-latest
if: github.event_name == 'release'
if: github.event_name == 'release' && github.event.action == 'created'
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install poetry
run: pipx install poetry

- name: Build Packages
run: poetry build

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_api_token }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/PyCQA/autoflake
rev: "v2.1.1"
hooks:
- id: autoflake
args: [--in-place, --ignore-init-module-imports, --remove-all-unused-imports]

- repo: https://github.com/pycqa/isort
rev: "5.11.5"
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.4.1'
hooks:
- id: mypy
additional_dependencies: [types-requests==2.31.0.2, types-toml==0.10.8.7, types-urllib3==1.26.25.14]
exclude: ^docs/
31 changes: 31 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/en/conf.py
builder: html
fail_on_warning: false

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt

# Build PDF & ePub
formats:
- epub
- pdf
25 changes: 0 additions & 25 deletions .xdr/update_xdr.py

This file was deleted.

32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
Release History
==============

### Version 9.0.0-alpha2

Released on September 16, 2023

#### Update
- feat: add support for Soroban Preview 11 ([#777](https://github.com/StellarCN/py-stellar-base/pull/777))

### Version 9.0.0-alpha1

Released on Aug 28, 2023

#### Update
- fix: fix the issue where soroban data is not correctly set when building a transaction through TransactionBuilder. ([#770](https://github.com/StellarCN/py-stellar-base/pull/770))

### Version 9.0.0-alpha0

Released on Aug 27, 2023

#### Add
- feat: add support for Soroban Preview 10. Please check the examples in the `examples` folder to learn how to use it.

#### Update
- Runtime type checking has now been removed. Please use tools like mypy for type checking. ([#706](https://github.com/StellarCN/py-stellar-base/pull/706))
- Add `__hash__` to the xdr classes. ([#757](https://github.com/StellarCN/py-stellar-base/pull/757))
- Make `aiohttp` and `aiohttp-sse-client` as optional dependencies. ([#765](https://github.com/StellarCN/py-stellar-base/pull/765))
- Publishing to PyPI with a Trusted Publisher. ([#767](https://github.com/StellarCN/py-stellar-base/pull/767))
- Update dependencies.

#### Breaking changes
- Remove `ValueError`, `TypeError` and `AttributeError` from `stellar_sdk.exceptions`. ([#763](https://github.com/StellarCN/py-stellar-base/pull/763))


### Version 8.2.1

Released on June 22, 2023
Expand Down
Loading

0 comments on commit eb3555e

Please sign in to comment.