From bc96c71487f0cc14f4a8f9e92fe7f83d15f7403b Mon Sep 17 00:00:00 2001 From: Graham Rowlands Date: Tue, 23 Jul 2019 09:42:14 -0400 Subject: [PATCH 1/5] PyPI distribution WIP --- setup.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 07db1d0b..f09e9ce4 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,31 @@ from setuptools import setup, find_packages setup(name='QGL', - version='2.1', - url='https://github.com/BBN-Q/QGL', + version='2019.1.1', packages=find_packages(exclude=["tests"]), + url='https://github.com/BBN-Q/QGL', + download_url='https://github.com/BBN-Q/QGL', + license="Apache 2.0 License", install_requires=[ - "bbndb >= 0.1", + "bbndb >= 2019.1.1", "numpy >= 1.11.1", "scipy >= 0.17.1", "networkx >= 1.11", "bqplot >= 0.11.5", "sqlalchemy >= 1.2.15" - ]) + ], + description="Quantum Gate Language (QGL) is a domain specific language embedded in python for specifying pulse sequences.", + long_description_content_type='text/markdown', + long_description=open('README.md').read(), + python_requires='>=3.6', + keywords="quantum qubit experiment configuration gate language" +) + +# python setup.py sdist +# python setup.py bdist_wheel +# For testing: +# twine upload --repository-url https://test.pypi.org/legacy/ dist/* +# For distribution: +# twine upload dist/* +# Test with: +# pip install --extra-index-url https://test.pypi.org/simple/ qgl \ No newline at end of file From f657afe83e12872edf3a42143da67976088a5a38 Mon Sep 17 00:00:00 2001 From: Graham Rowlands Date: Tue, 23 Jul 2019 11:48:15 -0400 Subject: [PATCH 2/5] Working PyPi and conda build (using skeleton) --- dist_pypi_test.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 dist_pypi_test.sh diff --git a/dist_pypi_test.sh b/dist_pypi_test.sh new file mode 100755 index 00000000..06913a33 --- /dev/null +++ b/dist_pypi_test.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +pkg_name=$(python setup.py --name) #"bbndb" +version=$(python setup.py --version) # "2019.1.2" +echo "DISTRIBUTING $pkg_name VERSION $version" + +echo "** Removing dist directory **" +rm -rf dist + +echo "** Creating source distribution **" +python setup.py sdist + +echo "** Creating wheel distribution **" +python setup.py bdist_wheel + +echo "** Uploading to test pypi **" +twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +# For distribution: +# twine upload dist/* +# Test with: +# pip install --extra-index-url https://test.pypi.org/simple/ bbndb + + +# channels=$(conda config --show channels) + +# echo "** Adding conda-forge to channels" +# conda config --add channels conda-forge + +echo "** Creating conda skeleton **" +rm -rf skeleton +mkdir skeleton && pushd skeleton +conda skeleton pypi --version=$version --pypi-url https://test.pypi.io/pypi/ $pkg_name +pushd $pkg_name + +echo "** Please modify the meta.yaml in skeleton/$pkg_name to include \"noarch: python\" in the build section." +read -n 1 -s -r -p "Press any key to continue" + +anaconda login +conda config --set anaconda_upload yes +conda build -c conda-forge . +conda config --set anaconda_upload no + +popd && popd \ No newline at end of file diff --git a/setup.py b/setup.py index f09e9ce4..e923e256 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='QGL', - version='2019.1.1', + version='2019.1.2', packages=find_packages(exclude=["tests"]), url='https://github.com/BBN-Q/QGL', download_url='https://github.com/BBN-Q/QGL', From 2dcc40afcc906c7170b0c1a9bb062a3352ffa616 Mon Sep 17 00:00:00 2001 From: Graham Rowlands Date: Tue, 23 Jul 2019 14:16:25 -0400 Subject: [PATCH 3/5] PyPi dist --- dist_pypi_test.sh | 44 ------------------------------------------ publish.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 44 deletions(-) delete mode 100755 dist_pypi_test.sh create mode 100755 publish.sh diff --git a/dist_pypi_test.sh b/dist_pypi_test.sh deleted file mode 100755 index 06913a33..00000000 --- a/dist_pypi_test.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -pkg_name=$(python setup.py --name) #"bbndb" -version=$(python setup.py --version) # "2019.1.2" -echo "DISTRIBUTING $pkg_name VERSION $version" - -echo "** Removing dist directory **" -rm -rf dist - -echo "** Creating source distribution **" -python setup.py sdist - -echo "** Creating wheel distribution **" -python setup.py bdist_wheel - -echo "** Uploading to test pypi **" -twine upload --repository-url https://test.pypi.org/legacy/ dist/* - -# For distribution: -# twine upload dist/* -# Test with: -# pip install --extra-index-url https://test.pypi.org/simple/ bbndb - - -# channels=$(conda config --show channels) - -# echo "** Adding conda-forge to channels" -# conda config --add channels conda-forge - -echo "** Creating conda skeleton **" -rm -rf skeleton -mkdir skeleton && pushd skeleton -conda skeleton pypi --version=$version --pypi-url https://test.pypi.io/pypi/ $pkg_name -pushd $pkg_name - -echo "** Please modify the meta.yaml in skeleton/$pkg_name to include \"noarch: python\" in the build section." -read -n 1 -s -r -p "Press any key to continue" - -anaconda login -conda config --set anaconda_upload yes -conda build -c conda-forge . -conda config --set anaconda_upload no - -popd && popd \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100755 index 00000000..6edf4df7 --- /dev/null +++ b/publish.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Usage: dist_pypi [production] +# Uses pypi test unless "production is supplied" + +pkg_name=$(python setup.py --name) +version=$(python setup.py --version) +echo "DISTRIBUTING $pkg_name VERSION $version" + +[[ $1 == "production" ]] && echo "*** PRODUCTION UPLOAD ***" || echo "*** TEST UPLOAD ***" +read -n 1 -s -r -p "Press any key to continue" + +echo "** Removing dist directory **" +rm -rf dist + +echo "** Creating source distribution **" +python setup.py sdist + +echo "** Creating wheel distribution **" +python setup.py bdist_wheel + +echo "** Uploading to test pypi **" +if [[ $1 == "production" ]]; then + twine upload dist/* +else + twine upload --repository-url https://test.pypi.org/legacy/ dist/* +fi + +# Test with: pip install --extra-index-url https://test.pypi.org/simple/ bbndb + +echo "** Creating conda skeleton **" +rm -rf skeleton +mkdir skeleton && pushd skeleton +if [[ $1 == "production" ]]; then + conda skeleton pypi --version=$version $pkg_name +else + conda skeleton pypi --version=$version --pypi-url https://test.pypi.io/pypi/ $pkg_name +fi +pushd $pkg_name + +echo "** Please modify the meta.yaml in skeleton/$pkg_name to include \"noarch: python\" in the build section." +read -n 1 -s -r -p "Press any key to continue" + +anaconda login +conda config --set anaconda_upload yes +conda build -c conda-forge . +conda config --set anaconda_upload no + +popd && popd \ No newline at end of file From 6bf574370bd323938cc4fc5be7d2f0d5761c9267 Mon Sep 17 00:00:00 2001 From: Graham Rowlands Date: Tue, 23 Jul 2019 14:19:13 -0400 Subject: [PATCH 4/5] Version tweak --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e923e256..4daf3e40 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='QGL', - version='2019.1.2', + version='2019.1', packages=find_packages(exclude=["tests"]), url='https://github.com/BBN-Q/QGL', download_url='https://github.com/BBN-Q/QGL', From 0bb95b58c21b78ebf3bf1f3d904cab0eb300b7c1 Mon Sep 17 00:00:00 2001 From: Graham Rowlands Date: Tue, 23 Jul 2019 14:35:16 -0400 Subject: [PATCH 5/5] Dependency tweak --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4daf3e40..8f8829dc 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ download_url='https://github.com/BBN-Q/QGL', license="Apache 2.0 License", install_requires=[ - "bbndb >= 2019.1.1", + "bbndb >= 2019.1", "numpy >= 1.11.1", "scipy >= 0.17.1", "networkx >= 1.11",