Skip to content

Commit

Permalink
Add boilerplate module structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Nov 22, 2015
0 parents commit 8c24bb9
Show file tree
Hide file tree
Showing 9 changed files with 680 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
@@ -0,0 +1,9 @@
# http://nedbatchelder.com/code/coverage/config.html#config

[run]
source = mdx_titlecase
branch = True
omit = */tests/*

[report]
omit = */tests/*
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
*~
*#
.#*
*.py[cod]
*.sw[op]
.coverage
*.egg-info/
*.egg
build/
doc/_build/
dist/
venv/
18 changes: 18 additions & 0 deletions .travis.yml
@@ -0,0 +1,18 @@
# After changing this file, check it on:
# http://lint.travis-ci.org/
language: python
sudo: false

python:
- "2.7"

install:
- pip install -e .
- pip install coveralls

script:
- coverage run setup.py test
- coverage report -m

after_script:
coveralls --verbose
14 changes: 14 additions & 0 deletions CHANGES.rst
@@ -0,0 +1,14 @@
ChangeLog
=========


0.0.1 (unreleased)
------------------

* First public release.


0.0.0 (2015-11-22)
------------------

* First commit.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,5 @@
include .coveragerc
include CHANGES.rst
include LICENSE
include MANIFEST.in
include setup.cfg
175 changes: 175 additions & 0 deletions README.rst
@@ -0,0 +1,175 @@
mdx_titlecase
=============

Proper title-casing for `Python's Markdown
<https://pythonhosted.org/Markdown/>`_ library.

Use `titlecase <https://pypi.python.org/pypi/titlecase>`_ module under the
hood.

Stable release: |release| |license| |dependencies| |popularity|

Development: |build| |coverage| |quality|

.. |release| image:: https://img.shields.io/pypi/v/mdx_titlecase.svg?style=flat
:target: https://pypi.python.org/pypi/mdx_titlecase
:alt: Last release
.. |license| image:: https://img.shields.io/pypi/l/mdx_titlecase.svg?style=flat
:target: https://www.gnu.org/licenses/gpl-2.0.html
:alt: Software license
.. |popularity| image:: https://img.shields.io/pypi/dm/mdx_titlecase.svg?style=flat
:target: https://pypi.python.org/pypi/mdx_titlecase#downloads
:alt: Popularity
.. |dependencies| image:: https://img.shields.io/requires/github/kdeldycke/mdx_titlecase/master.svg?style=flat
:target: https://requires.io/github/kdeldycke/mdx_titlecase/requirements/?branch=master
:alt: Requirements freshness
.. |build| image:: https://img.shields.io/travis/kdeldycke/mdx_titlecase/develop.svg?style=flat
:target: https://travis-ci.org/kdeldycke/mdx_titlecase
:alt: Unit-tests status
.. |coverage| image:: https://coveralls.io/repos/kdeldycke/mdx_titlecase/badge.svg?branch=develop&service=github
:target: https://coveralls.io/r/kdeldycke/mdx_titlecase?branch=develop
:alt: Coverage Status
.. |quality| image:: https://img.shields.io/scrutinizer/g/kdeldycke/mdx_titlecase.svg?style=flat
:target: https://scrutinizer-ci.com/g/kdeldycke/mdx_titlecase/?branch=develop
:alt: Code Quality


Install
-------

This package is `available on PyPi
<https://pypi.python.org/pypi/mdx_titlecase>`_, so you can install the
latest stable release and its dependencies with a simple `pip` call:

.. code-block:: bash
$ pip install mdx_titlecase
See also `pip installation instructions
<https://pip.pypa.io/en/stable/installing/>`_.


Development
-----------

Check out latest development branch:

.. code-block:: bash
$ git clone git@github.com:kdeldycke/mdx_titlecase.git
$ cd ./mdx_titlecase
$ python ./setup.py develop
Run unit-tests:

.. code-block:: bash
$ python ./setup.py nosetests
Run `PEP8 <https://pep8.readthedocs.org>`_ and `Pylint
<http://docs.pylint.org>`_ code style checks:

.. code-block:: bash
$ pip install pep8 pylint
$ pep8 mdx_titlecase
$ pylint --rcfile=setup.cfg mdx_titlecase
Stability policy
----------------

Here is a bunch of rules we're trying to follow regarding stability:

* Patch releases (``0.x.n`` → ``0.x.(n+1)`` upgrades) are bug-fix only. These
releases must not break anything and keeps backward-compatibility with
``0.x.*`` and ``0.(x-1).*`` series.

* Minor releases (``0.n.*`` → ``0.(n+1).0`` upgrades) includes any non-bugfix
changes. These releases must be backward-compatible with any ``0.n.*``
version but are allowed to drop compatibility with the ``0.(n-1).*`` series
and below.

* Major releases (``n.*.*`` → ``(n+1).0.0`` upgrades) are not planned yet:
we're still in beta and the final feature set of the ``1.0.0`` release is not
decided yet.


Release process
---------------

Start from the ``develop`` branch:

.. code-block:: bash
$ git clone git@github.com:kdeldycke/mdx_titlecase.git
$ git checkout develop
Revision should already be set to the next version, so we just need to set the
released date in the changelog:

.. code-block:: bash
$ vi ./CHANGES.rst
Create a release commit, tag it and merge it back to ``master`` branch:

.. code-block:: bash
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
$ git commit -m "Release vX.Y.Z"
$ git tag "vX.Y.Z"
$ git push
$ git push --tags
$ git checkout master
$ git pull
$ git merge "vX.Y.Z"
$ git push
Push packaging to the `test cheeseshop
<https://wiki.python.org/moin/TestPyPI>`_:

.. code-block:: bash
$ pip install wheel
$ python ./setup.py register -r testpypi
$ python ./setup.py clean
$ rm -rf ./build ./dist
$ python ./setup.py sdist bdist_egg bdist_wheel upload -r testpypi
Publish packaging to `PyPi <https://pypi.python.org>`_:

.. code-block:: bash
$ python ./setup.py register -r pypi
$ python ./setup.py clean
$ rm -rf ./build ./dist
$ python ./setup.py sdist bdist_egg bdist_wheel upload -r pypi
Bump revision back to its development state:

.. code-block:: bash
$ pip install bumpversion
$ git checkout develop
$ bumpversion --verbose patch
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
$ git commit -m "Post release version bump."
$ git push
Now if the next revision is no longer bug-fix only:

.. code-block:: bash
$ bumpversion --verbose minor
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
$ git commit -m "Next release no longer bug-fix only. Bump revision."
$ git push
License
-------

This software is licensed under the `GNU General Public License v2 or later
(GPLv2+)
<https://github.com/kdeldycke/mdx_titlecase/blob/master/LICENSE>`_.
29 changes: 29 additions & 0 deletions setup.cfg
@@ -0,0 +1,29 @@
[bumpversion]
current_version = 0.01
files = mdx_titlecase/__init__.py CHANGES.rst README.rst
allow_dirty = True
commit = False
tag = False
tag_name = v{new_version}

[nosetests]
match = ^test
cover-package = mdx_titlecase
with-coverage = 1
cover-erase = 1
cover-branches = 1
cover-min-percentage = 30

[pep8]
ignore =
show-source = True
statistics = True

[pylint]
# C0103: Invalid name
# C0111: Missing docstring
# W0142: Used * or ** magic
# W0511: Warning notes in code comments
disable = C0103,C0111,W0141,W0142,W0511
ignore-docstrings = yes
output-format = colorized
79 changes: 79 additions & 0 deletions setup.py
@@ -0,0 +1,79 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Kevin Deldycke <kevin@deldycke.com>
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

import codecs
import os
import re

from setuptools import setup, find_packages


MODULE_NAME = 'mdx_titlecase'


def get_version():

with open(os.path.join(
os.path.dirname(__file__), MODULE_NAME, '__init__.py')
) as init:

for line in init.readlines():
res = re.match(r'__version__ *= *[\'"]([0-9a-z\.]*)[\'"]$', line)
if res:
return res.group(1)


def get_long_description():
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
changes = os.path.join(os.path.dirname(__file__), 'CHANGES.rst')
return codecs.open(readme, encoding='utf-8').read() + '\n' + \
codecs.open(changes, encoding='utf-8').read()


setup(
name='mdx_titlecase',
version=get_version(),
description="Proper title-casing for Python's Markdown.",
long_description=get_long_description(),

author='Kevin Deldycke',
author_email='kevin@deldycke.com',
url='https://github.com/kdeldycke/mdx_titlecase',
license='GPLv2+',

install_requires=[
],

packages=find_packages(),

tests_require=[],
test_suite=MODULE_NAME + '.tests',

classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: '
'GNU General Public License v2 or later (GPLv2+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
)

0 comments on commit 8c24bb9

Please sign in to comment.