diff --git a/README.md b/README.md index 4962971..7cafd28 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,33 @@ Modify the Procfile which declares which command Heroku should run to serve the `web: panel serve --address="0.0.0.0" --port=$PORT model/app.py --allow-websocket-origin=app-name.herokuapp.com` +### To distribute as package + +1. Install setuptools and twine +``` +pip install setuptools twine +``` + +2. Check if any metadata are missing + +``` +python setup.py check +``` + +3. Create a source distribution + +``` +python setup.py sdist +``` + +4. Upload it to PyPI. You will need an registered account at https://pypi.python.org +``` +twine upload dist/* +``` + ### Credits: > https://panel.holoviz.org/user_guide/Server_Deployment.html > https://github.com/holoviz-demos/minimal-heroku-demo/blob/master/README.md + +> https://betterscientificsoftware.github.io/python-for-hpc/tutorials/python-pypi-packaging/ diff --git a/augmentedbondingcurve/__init__.py b/augmentedbondingcurve/__init__.py index 8b13789..524e23c 100644 --- a/augmentedbondingcurve/__init__.py +++ b/augmentedbondingcurve/__init__.py @@ -1 +1,3 @@ - +__version__ = "0.1.0" +__author__ = '' +__credits__ = '' diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f8edf0c --- /dev/null +++ b/setup.py @@ -0,0 +1,50 @@ +from setuptools import setup +import codecs +import os.path + +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + +setup( + name='augmentedbondingcurve', + version=get_version("augmentedbondingcurve/__init__.py"), + description='Python implementation of the Bancor automated Market Maker', + url='https://github.com/CommonsBuild/augmented-bonding-curve-model', + author='YGG Anderson', + author_email='example@example.com', + license='', + packages=['augmentedbondingcurve'], + install_requires=['numpy', + 'bokeh', + 'cadCAD', + 'holoviews', + 'hvplot', + 'matplotlib', + 'panel', + 'param', + 'pandas', + ], + + classifiers=[ + 'Development Status :: 1 - Planning', + 'Intended Audience :: Science/Research', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + ], +)