Skip to content

Commit d15feb1

Browse files
jayantkJayant Krishnamurthy
and
Jayant Krishnamurthy
authored
Upload pythclient to pypi (#15)
* Upload pythclient to pypi * whitespace Co-authored-by: Jayant Krishnamurthy <[email protected]>
1 parent bdd32b4 commit d15feb1

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

.github/workflows/pypi.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Upload Python Package to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install setuptools wheel twine
18+
- name: Build and publish
19+
env:
20+
TWINE_USERNAME: __token__
21+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
run: |
23+
python3 -m build
24+
python3 -m twine upload --repository pypi dist/*

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,27 @@ If html based test coverage is more your jam:
2929
pytest --cov-report=html
3030

3131
The coverage webpages will be in the `htmlcov` directory.
32+
33+
34+
Distribution
35+
------------
36+
37+
To build the package for distribution to pypi, first install dependencies:
38+
39+
`python3 -m pip install --upgrade twine build`
40+
41+
Next, edit `setup.py` and bump the `version` field.
42+
Then build the package by running:
43+
44+
```
45+
python3 -m build
46+
```
47+
48+
This command will produce packages in the `dist/` directory.
49+
Upload these packages to pypi by running:
50+
51+
```
52+
python3 -m twine upload --repository pypi dist/*
53+
```
54+
55+
This command will require you to log in to a pypi account.

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

setup.py

+15
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,27 @@
22

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

5+
with open('README.md', 'r', encoding='utf-8') as fh:
6+
long_description = fh.read()
7+
58
setup(
69
name='pythclient',
710
version='0.0.2',
811
packages=['pythclient'],
912
author='Pyth Developers',
1013
author_email='[email protected]',
14+
description='A library to retrieve Pyth account structures off the Solana blockchain.',
15+
long_description=long_description,
16+
long_description_content_type='text/markdown',
17+
url='https://github.com/pyth-network/pyth-client-py',
18+
project_urls={
19+
'Bug Tracker': 'https://github.com/pyth-network/pyth-client-py/issues',
20+
},
21+
classifiers=[
22+
'Programming Language :: Python :: 3',
23+
'License :: OSI Approved :: Apache Software License',
24+
'Operating System :: OS Independent',
25+
],
1126
install_requires=requirements,
1227
extras_require={
1328
'testing': requirements + ['mock', 'pytest', 'pytest-cov', 'pytest-socket',

0 commit comments

Comments
 (0)