Skip to content

Commit

Permalink
Upload pythclient to pypi (#15)
Browse files Browse the repository at this point in the history
* Upload pythclient to pypi

* whitespace

Co-authored-by: Jayant Krishnamurthy <[email protected]>
  • Loading branch information
jayantk and Jayant Krishnamurthy authored Dec 7, 2021
1 parent bdd32b4 commit d15feb1
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Upload Python Package to PyPI

on:
push:
tags:
- "v*"

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- 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_PASSWORD }}
run: |
python3 -m build
python3 -m twine upload --repository pypi dist/*
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,27 @@ If html based test coverage is more your jam:
pytest --cov-report=html

The coverage webpages will be in the `htmlcov` directory.


Distribution
------------

To build the package for distribution to pypi, first install dependencies:

`python3 -m pip install --upgrade twine build`

Next, edit `setup.py` and bump the `version` field.
Then build the package by running:

```
python3 -m build
```

This command will produce packages in the `dist/` directory.
Upload these packages to pypi by running:

```
python3 -m twine upload --repository pypi dist/*
```

This command will require you to log in to a pypi account.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@

requirements = ['aiodns', 'aiohttp>=3.7.4', 'backoff', 'base58', 'dnspython', 'flake8', 'loguru']

with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()

setup(
name='pythclient',
version='0.0.2',
packages=['pythclient'],
author='Pyth Developers',
author_email='[email protected]',
description='A library to retrieve Pyth account structures off the Solana blockchain.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/pyth-network/pyth-client-py',
project_urls={
'Bug Tracker': 'https://github.com/pyth-network/pyth-client-py/issues',
},
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
],
install_requires=requirements,
extras_require={
'testing': requirements + ['mock', 'pytest', 'pytest-cov', 'pytest-socket',
Expand Down

0 comments on commit d15feb1

Please sign in to comment.