From 3f087dfa32e5acc67b4b030d995b024156e74a04 Mon Sep 17 00:00:00 2001 From: PabloCGL <50929773+PabloCGL@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:09:15 +0200 Subject: [PATCH 1/4] init --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index c7a7867..56c8594 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: panel serve --address="0.0.0.0" --port=$PORT app.py --allow-websocket-origin=bondingcurve.herokuapp.com +web: panel serve --address="0.0.0.0" --port=$PORT augmentedbondingcurve/app.py --allow-websocket-origin=abc-test1234.herokuapp.com From bbd5a4d4fd363d961b133526af12445801bb87c5 Mon Sep 17 00:00:00 2001 From: PabloCGL <50929773+PabloCGL@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:27:43 +0200 Subject: [PATCH 2/4] Update Procfile --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 56c8594..c7a7867 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: panel serve --address="0.0.0.0" --port=$PORT augmentedbondingcurve/app.py --allow-websocket-origin=abc-test1234.herokuapp.com +web: panel serve --address="0.0.0.0" --port=$PORT app.py --allow-websocket-origin=bondingcurve.herokuapp.com From 7b5a98198d6b6036b105223038ebc3e778b2fbf3 Mon Sep 17 00:00:00 2001 From: PabloCGL <50929773+PabloCGL@users.noreply.github.com> Date: Wed, 9 Jun 2021 18:29:43 +0200 Subject: [PATCH 3/4] include data for packaging --- README.md | 24 +++++++++++++++ augmentedbondingcurve/__init__.py | 4 ++- setup.py | 50 +++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 setup.py diff --git a/README.md b/README.md index 4962971..68f8b2a 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,30 @@ 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 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', + ], +) From 405db61a201d30f114be1db8ec9436c9e094645f Mon Sep 17 00:00:00 2001 From: PabloCGL <50929773+PabloCGL@users.noreply.github.com> Date: Wed, 9 Jun 2021 18:30:34 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 68f8b2a..7cafd28 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,5 @@ twine upload dist/* > 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/