Update description and classifier, add version specification and long desc. Publish to PyPI script.

This commit is contained in:
Sunil Shah 2015-04-29 21:18:48 -07:00
parent e59db8a39d
commit ede52666cc
15 changed files with 98 additions and 12 deletions

11
DESCRIPTION.rst Normal file
View File

@ -0,0 +1,11 @@
DCOS Command Line Interface
===========================
The DCOS Command Line Interface (CLI) is a command line utility that
provides a user-friendly yet powerful way to manage DCOS installations.
This project is open source. Please see GitHub_ to access source code and to contribute.
Full documentation is available for the DCOS CLI on the `Mesosphere docs website`_.
.. _GitHub: https://github.com/mesosphere/dcos-cli
.. _Mesosphere docs website: http://docs.mesosphere.com/using/cli/

1
MANIFEST.in Normal file
View File

@ -0,0 +1 @@
include DESCRIPTION.rst

View File

@ -84,7 +84,7 @@ configure your environment to point to the packaged `dcos-helloworld` account.
wheel package: :code:`export DCOS_TEST_WHEEL=$(pwd)/dist/dcos_helloworld-0.1.0-py2.py3-none-any.whl`
Running
#######
https://github.com/mesosphere/dcos-cli/blob/master/bin/publish_to_pypi.sh#######
Tox will run unit and integration tests in both Python environments using a
temporarily created virtualenv.
@ -121,6 +121,21 @@ Other Useful Commands
tox -e py27-integration /cli/test_config.py
Releasing
#########
Releasing a new version of the DCOS CLI is only possible through an `automated TeamCity build`_ which is triggered automatically when a new tag is added.
The tag is used as the version number and must adhere to the conventional `PEP-440 version scheme`_.
Once all tests pass successfully, the automated build publishes two packages to PyPI using the `publish_to_pypi.sh script`_:
#. dcos_
#. dcoscli_
These packages are now available to be installed by the DCOS CLI installation script in the `mesosphere/install-scripts`_ repository.
Using the CLI
-------------
@ -137,3 +152,9 @@ Full documentation is available for the DCOS CLI on the `Mesosphere docs website
.. _dcos-helloworld: https://github.com/mesosphere/dcos-helloworld
.. _setup: https://github.com/mesosphere/dcos-helloworld#setup
.. _Mesosphere docs website: http://docs-staging.mesosphere.com.s3-website-us-west-2.amazonaws.com/using/cli/
.. _automated TeamCity build: https://teamcity.mesosphere.io/viewType.html?buildTypeId=ClosedSource_DcosCli_PushToPyPI
.. _PEP-440 version scheme: https://www.python.org/dev/peps/pep-0440/
.. _dcos: https://pypi.python.org/pypi/dcos
.. _dcoscli: https://pypi.python.org/pypi/dcoscli
.. _publish_to_pypi.sh script: https://github.com/mesosphere/dcos-cli/blob/master/bin/publish_to_pypi.sh
.. _mesosphere/install-scripts: https://github.com/mesosphere/install-scripts

31
bin/publish_to_pypi.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash -x
set -o errexit -o pipefail
# move the dcos package
cd /dcos-cli
# copy generated pypirc configuration to correct location
cp .pypirc ~/.pypirc
TAG_VERSION=`cat tag-version`
# replace SNAPSHOT with tagged version
sed -i "s/version = 'SNAPSHOT'/version = '$TAG_VERSION'/g" dcos/__init__.py
make clean env
source env/bin/activate
env/bin/python setup.py bdist_wheel upload
echo "Wheel should now be online at: https://pypi.python.org/pypi/dcos"
deactivate
# Move down to the dcoscli package
cd cli
# replace SNAPSHOT with tagged version
sed -i "s/version = 'SNAPSHOT'/version = '$TAG_VERSION'/g" dcoscli/__init__.py
make clean env
source env/bin/activate
env/bin/python setup.py bdist_wheel upload
echo "Wheel should now be online at: https://pypi.python.org/pypi/dcoscli"
deactivate

11
cli/DESCRIPTION.rst Normal file
View File

@ -0,0 +1,11 @@
DCOS Command Line Interface
===========================
The DCOS Command Line Interface (CLI) is a command line utility that
provides a user-friendly yet powerful way to manage DCOS installations.
This project is open source. Please see GitHub_ to access source code and to contribute.
Full documentation is available for the DCOS CLI on the `Mesosphere docs website`_.
.. _GitHub: https://github.com/mesosphere/dcos-cli
.. _Mesosphere docs website: http://docs.mesosphere.com/using/cli/

1
cli/MANIFEST.in Normal file
View File

@ -0,0 +1 @@
include DESCRIPTION.rst

View File

@ -1,2 +1,4 @@
version = '0.1.0'
# Version is set for releases by our build system.
# Be extremely careful when modifying.
version = 'SNAPSHOT'
"""DCOS CLI version"""

View File

@ -1,3 +1,4 @@
from codecs import open
from os import path
import dcoscli
@ -5,6 +6,10 @@ from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='dcoscli',
@ -14,6 +19,7 @@ setup(
version=dcoscli.version,
description='DCOS Command Line Interface',
long_description=long_description,
# The project's main homepage.
url='https://github.com/mesosphere/dcos-cli',
@ -29,7 +35,7 @@ setup(
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Developers',
@ -62,7 +68,7 @@ setup(
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
'dcos',
'dcos=={}'.format(dcoscli.version),
'docopt>=0.6, <1.0',
'pkginfo>=1.2, <2.0',
'toml>=0.9, <1.0',

View File

@ -61,7 +61,7 @@ def test_info():
def test_version():
stdout = b'dcos-config version 0.1.0\n'
stdout = b'dcos-config version SNAPSHOT\n'
assert_command(['dcos', 'config', '--version'],
stdout=stdout)

View File

@ -65,7 +65,7 @@ Environment Variables:
def test_version():
assert_command(['dcos', '--version'],
stdout=b'dcos version 0.1.0\n')
stdout=b'dcos version SNAPSHOT\n')
def test_missing_dcos_config():

View File

@ -24,7 +24,7 @@ def test_info():
def test_version():
assert_command(['dcos', 'help', '--version'],
stdout=b'dcos-help version 0.1.0\n')
stdout=b'dcos-help version SNAPSHOT\n')
def test_list():

View File

@ -65,7 +65,7 @@ Positional arguments:
def test_version():
assert_command(['dcos', 'marathon', '--version'],
stdout=b'dcos-marathon version 0.1.0\n')
stdout=b'dcos-marathon version SNAPSHOT\n')
def test_info():

View File

@ -65,7 +65,7 @@ def test_info():
def test_version():
assert_command(['dcos', 'package', '--version'],
stdout=b'dcos-package version 0.1.0\n')
stdout=b'dcos-package version SNAPSHOT\n')
def test_sources_list():

View File

@ -1,2 +1,4 @@
version = '0.1.0'
# Version is set for releases by our build system.
# Be extremely careful when modifying.
version = 'SNAPSHOT'
"""DCOS version"""

View File

@ -7,7 +7,7 @@ from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
@ -35,7 +35,7 @@ setup(
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Developers',