Skip to content

Upload pythclient to pypi #15

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

Merged
merged 3 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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