Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/InjectiveLabs/sdk-python int…
Browse files Browse the repository at this point in the history
…o feat/add_chain_streams_support
  • Loading branch information
abel committed Sep 20, 2023
2 parents 364d78c + 7078a76 commit afac173
Show file tree
Hide file tree
Showing 162 changed files with 5,268 additions and 2,202 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pre-commit
on:
pull_request:
push:
branches: [master, dev]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4

- name: Install poetry
run: python -m pip install poetry
- name: Cache the virtualenv
id: cache-venv
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: python -m poetry install

- name: Run pre-commit
run: |
python -m poetry run pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
32 changes: 14 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@ name: Publish Python 🐍 distribution 📦 to PyPI

on:
release:
types: [created]
types: [published]

jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
- name: Install poetry
run: python -m pip install poetry
- name: Publish package
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
45 changes: 45 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: run-tests
on:
pull_request:
push:
branches: [master, dev]

jobs:
run-tests:
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install poetry
run: python -m pip install poetry
- name: Cache the virtualenv
id: cache-venv
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: python -m poetry install

- name: Run tests and Generate coverage
run: |
poetry run pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ cython_debug/

.chain_cookie
.exchange_cookie

.flakeheaven_cache
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
exclude: '^pyinjective/proto/.*'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/flakeheaven/flakeheaven
rev: 3.3.0
hooks:
- id: flakeheaven
name: flakeheaven
description: '`flakeheaven` is a `flake8` wrapper.'
entry: flakeheaven lint
language: python
types_or: [ python, jupyter, markdown, rst, yaml ]
require_serial: true
minimum_pre_commit_version: 2.9.0
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ copy-proto:
done

tests:
pytest -v
poetry run pytest -v

.PHONY: all gen gen-client copy-proto tests
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)
Originally released by Injective Labs Inc. under: <br />
Apache License <br />
Version 2.0, January 2004 <br />
http://www.apache.org/licenses/
http://www.apache.org/licenses/
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protobuf = "*"
requests = "*"
safe-pysha3 = "*"
urllib3 = "<2"
web3 = ">=6.0.0"
websockets = "*"

[dev-packages]
Expand Down
Loading

0 comments on commit afac173

Please sign in to comment.