Skip to content

Commit 9ceb008

Browse files
authored
Merge pull request #249 from InjectiveLabs/feat/replace_pipenv_with_poetry
Feat/replace pipenv with poetry
2 parents 8e63e6e + c17aeb5 commit 9ceb008

File tree

162 files changed

+5241
-2194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+5241
-2194
lines changed

.github/workflows/pre-commit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: pre-commit
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master, dev]
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Install Python
14+
uses: actions/setup-python@v4
15+
16+
- name: Install poetry
17+
run: python -m pip install poetry
18+
- name: Cache the virtualenv
19+
id: cache-venv
20+
uses: actions/cache@v3
21+
with:
22+
path: ./.venv
23+
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
24+
25+
- name: Install dependencies
26+
if: steps.cache-venv.outputs.cache-hit != 'true'
27+
run: python -m poetry install
28+
29+
- name: Run pre-commit
30+
run: |
31+
python -m poetry run pre-commit run --show-diff-on-failure --color=always --all-files
32+
shell: bash

.github/workflows/release.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,22 @@ name: Publish Python 🐍 distribution 📦 to PyPI
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
66

77
jobs:
88
deploy:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@master
13-
- name: Set up Python 3.7
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: 3.7
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install setuptools wheel twine
21-
- name: Build and publish
22-
env:
23-
TWINE_USERNAME: __token__
24-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
25-
run: |
26-
python setup.py sdist bdist_wheel
27-
twine upload --skip-existing dist/*
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Install Python
15+
uses: actions/setup-python@v3
16+
- name: Install poetry
17+
run: python -m pip install poetry
18+
- name: Publish package
19+
env:
20+
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
21+
run: |
22+
poetry config pypi-token.pypi $PYPI_TOKEN
23+
poetry publish --build

.github/workflows/run-tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: run-tests
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master, dev]
6+
7+
jobs:
8+
run-tests:
9+
strategy:
10+
matrix:
11+
python: ["3.9", "3.10", "3.11"]
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
runs-on: ${{ matrix.os }}
14+
env:
15+
OS: ${{ matrix.os }}
16+
PYTHON: ${{ matrix.python }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: Install Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python }}
24+
25+
- name: Install poetry
26+
run: python -m pip install poetry
27+
- name: Cache the virtualenv
28+
id: cache-venv
29+
uses: actions/cache@v3
30+
with:
31+
path: ./.venv
32+
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('**/poetry.lock') }}
33+
34+
- name: Install dependencies
35+
if: steps.cache-venv.outputs.cache-hit != 'true'
36+
run: python -m poetry install
37+
38+
- name: Run tests and Generate coverage
39+
run: |
40+
poetry run pytest --cov --cov-report=xml
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v3
44+
with:
45+
env_vars: OS,PYTHON

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,5 @@ cython_debug/
143143

144144
.chain_cookie
145145
.exchange_cookie
146+
147+
.flakeheaven_cache

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
exclude: '^pyinjective/proto/.*'
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v3.2.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- repo: https://github.com/flakeheaven/flakeheaven
10+
rev: 3.3.0
11+
hooks:
12+
- id: flakeheaven
13+
name: flakeheaven
14+
description: '`flakeheaven` is a `flake8` wrapper.'
15+
entry: flakeheaven lint
16+
language: python
17+
types_or: [ python, jupyter, markdown, rst, yaml ]
18+
require_serial: true
19+
minimum_pre_commit_version: 2.9.0
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.12.0
22+
hooks:
23+
- id: isort
24+
name: isort (python)
25+
- repo: https://github.com/psf/black-pre-commit-mirror
26+
rev: 23.9.1
27+
hooks:
28+
- id: black

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)
200200
distributed under the License is distributed on an "AS IS" BASIS,
201201
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202202
See the License for the specific language governing permissions and
203-
limitations under the License.
203+
limitations under the License.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ copy-proto:
3535
done
3636

3737
tests:
38-
pytest -v
38+
poetry run pytest -v
3939

4040
.PHONY: all gen gen-client copy-proto tests

NOTICE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)
55
Originally released by Injective Labs Inc. under: <br />
66
Apache License <br />
77
Version 2.0, January 2004 <br />
8-
http://www.apache.org/licenses/
8+
http://www.apache.org/licenses/

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ protobuf = "*"
2020
requests = "*"
2121
safe-pysha3 = "*"
2222
urllib3 = "<2"
23+
web3 = ">=6.0.0"
2324
websockets = "*"
2425

2526
[dev-packages]

0 commit comments

Comments
 (0)