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

Feat/replace pipenv with poetry #249

Merged
merged 34 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7754dd3
Merge pull request #240 from InjectiveLabs/dev
aarmoa Sep 6, 2023
de3f34a
(fix) Added web3 library as a project dependency because it is reqire…
Sep 6, 2023
a65f33f
(fix) Updated README changelog and setup.py version. Added web3 depen…
Sep 6, 2023
71ad540
chore: fix sendToCosmos
achilleas-kal Sep 7, 2023
2c9fc46
(fix) Updated web3 dependency in Pipenv and setup.py to include the v…
Sep 7, 2023
17237d1
Merge pull request #241 from InjectiveLabs/fix/web3_dependency
aarmoa Sep 7, 2023
ec08643
(fix) Fixed issue in setup.py dependencies(fix) Fixed issue in setup.…
Sep 7, 2023
2a0ede2
(fix) Update changelog and version number
Sep 7, 2023
b8be53c
Merge pull request #242 from InjectiveLabs/fix/fix_setup_py_dependencies
aarmoa Sep 7, 2023
04744d4
(feat) Added gRPC keepalive options to all gRPC channels
Sep 8, 2023
203500c
(fix) Updated CHANGELOG and version number
Sep 8, 2023
9370531
(feat) Added from chain price and value translation to all market cla…
Sep 12, 2023
40726ae
Merge pull request #245 from InjectiveLabs/feat/add_from_chain_value_…
aarmoa Sep 12, 2023
ceaf026
(feat) Added info to mainnet .ini file for NEOK/USDT and ORAI/USDT ma…
Sep 18, 2023
4f125f7
(fix) Fix issue in denoms_mainnet.ini
Sep 18, 2023
c247dbe
Merge pull request #248 from InjectiveLabs/feat/add_neok_and_orai
aarmoa Sep 18, 2023
8698291
(feat) Added Poetry to the proyect and the pyproject.toml configurati…
Sep 19, 2023
144fe3b
(feat) Added GitHub workflow to run pre-commit checks for pushes to m…
Sep 19, 2023
00b2d8e
(fix) Fix issue in pre-commit workflow
Sep 19, 2023
494869e
(fix) Fix error un pre-commit workflow
Sep 19, 2023
9b8421e
(fix) Update release GitHub workflow to use Poetry to publish the SDK…
Sep 19, 2023
870af10
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
Sep 19, 2023
71becbf
(feat) Removed file setup.py (not required now that we use Poetry)
Sep 19, 2023
fa7377d
(feat) Added Isort to the project and configure it to run in pre-commit
Sep 19, 2023
05f3bdf
(feat) Added Black to the project and as part of the pre-commit. Fixe…
Sep 19, 2023
a30481c
(feat) Added GitHub workflow to run tests and calculate coverage
Sep 19, 2023
2d1bb99
(fix) Fix reference to ubuntu OS in the run-test GitHub workflow
Sep 19, 2023
be1b05b
(fix) Consider Python version in the GitHub workflow cache for the en…
Sep 19, 2023
cee1e5d
(feat) Added CodeCov badge to README file
Sep 19, 2023
f5d2e1a
(fix) Fix minimum required coverage
Sep 19, 2023
9c3bff0
(fix) Fix minimum required coverage
Sep 19, 2023
189c498
(fix) Updated README file
Sep 19, 2023
088e3fd
(fix) Changed release workflow to try to solve the error publishing p…
Sep 19, 2023
c17aeb5
(fix) Fix release workflow configuration
Sep 19, 2023
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
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
Loading