Skip to content

Commit 8c24bb9

Browse files
committed
Add boilerplate module structure
0 parents  commit 8c24bb9

File tree

9 files changed

+680
-0
lines changed

9 files changed

+680
-0
lines changed

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# http://nedbatchelder.com/code/coverage/config.html#config
2+
3+
[run]
4+
source = mdx_titlecase
5+
branch = True
6+
omit = */tests/*
7+
8+
[report]
9+
omit = */tests/*

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*~
2+
*#
3+
.#*
4+
*.py[cod]
5+
*.sw[op]
6+
.coverage
7+
*.egg-info/
8+
*.egg
9+
build/
10+
doc/_build/
11+
dist/
12+
venv/

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# After changing this file, check it on:
2+
# http://lint.travis-ci.org/
3+
language: python
4+
sudo: false
5+
6+
python:
7+
- "2.7"
8+
9+
install:
10+
- pip install -e .
11+
- pip install coveralls
12+
13+
script:
14+
- coverage run setup.py test
15+
- coverage report -m
16+
17+
after_script:
18+
coveralls --verbose

CHANGES.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ChangeLog
2+
=========
3+
4+
5+
0.0.1 (unreleased)
6+
------------------
7+
8+
* First public release.
9+
10+
11+
0.0.0 (2015-11-22)
12+
------------------
13+
14+
* First commit.

LICENSE

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include .coveragerc
2+
include CHANGES.rst
3+
include LICENSE
4+
include MANIFEST.in
5+
include setup.cfg

README.rst

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
mdx_titlecase
2+
=============
3+
4+
Proper title-casing for `Python's Markdown
5+
<https://pythonhosted.org/Markdown/>`_ library.
6+
7+
Use `titlecase <https://pypi.python.org/pypi/titlecase>`_ module under the
8+
hood.
9+
10+
Stable release: |release| |license| |dependencies| |popularity|
11+
12+
Development: |build| |coverage| |quality|
13+
14+
.. |release| image:: https://img.shields.io/pypi/v/mdx_titlecase.svg?style=flat
15+
:target: https://pypi.python.org/pypi/mdx_titlecase
16+
:alt: Last release
17+
.. |license| image:: https://img.shields.io/pypi/l/mdx_titlecase.svg?style=flat
18+
:target: https://www.gnu.org/licenses/gpl-2.0.html
19+
:alt: Software license
20+
.. |popularity| image:: https://img.shields.io/pypi/dm/mdx_titlecase.svg?style=flat
21+
:target: https://pypi.python.org/pypi/mdx_titlecase#downloads
22+
:alt: Popularity
23+
.. |dependencies| image:: https://img.shields.io/requires/github/kdeldycke/mdx_titlecase/master.svg?style=flat
24+
:target: https://requires.io/github/kdeldycke/mdx_titlecase/requirements/?branch=master
25+
:alt: Requirements freshness
26+
.. |build| image:: https://img.shields.io/travis/kdeldycke/mdx_titlecase/develop.svg?style=flat
27+
:target: https://travis-ci.org/kdeldycke/mdx_titlecase
28+
:alt: Unit-tests status
29+
.. |coverage| image:: https://coveralls.io/repos/kdeldycke/mdx_titlecase/badge.svg?branch=develop&service=github
30+
:target: https://coveralls.io/r/kdeldycke/mdx_titlecase?branch=develop
31+
:alt: Coverage Status
32+
.. |quality| image:: https://img.shields.io/scrutinizer/g/kdeldycke/mdx_titlecase.svg?style=flat
33+
:target: https://scrutinizer-ci.com/g/kdeldycke/mdx_titlecase/?branch=develop
34+
:alt: Code Quality
35+
36+
37+
Install
38+
-------
39+
40+
This package is `available on PyPi
41+
<https://pypi.python.org/pypi/mdx_titlecase>`_, so you can install the
42+
latest stable release and its dependencies with a simple `pip` call:
43+
44+
.. code-block:: bash
45+
46+
$ pip install mdx_titlecase
47+
48+
See also `pip installation instructions
49+
<https://pip.pypa.io/en/stable/installing/>`_.
50+
51+
52+
Development
53+
-----------
54+
55+
Check out latest development branch:
56+
57+
.. code-block:: bash
58+
59+
$ git clone git@github.com:kdeldycke/mdx_titlecase.git
60+
$ cd ./mdx_titlecase
61+
$ python ./setup.py develop
62+
63+
Run unit-tests:
64+
65+
.. code-block:: bash
66+
67+
$ python ./setup.py nosetests
68+
69+
Run `PEP8 <https://pep8.readthedocs.org>`_ and `Pylint
70+
<http://docs.pylint.org>`_ code style checks:
71+
72+
.. code-block:: bash
73+
74+
$ pip install pep8 pylint
75+
$ pep8 mdx_titlecase
76+
$ pylint --rcfile=setup.cfg mdx_titlecase
77+
78+
79+
Stability policy
80+
----------------
81+
82+
Here is a bunch of rules we're trying to follow regarding stability:
83+
84+
* Patch releases (``0.x.n`` → ``0.x.(n+1)`` upgrades) are bug-fix only. These
85+
releases must not break anything and keeps backward-compatibility with
86+
``0.x.*`` and ``0.(x-1).*`` series.
87+
88+
* Minor releases (``0.n.*`` → ``0.(n+1).0`` upgrades) includes any non-bugfix
89+
changes. These releases must be backward-compatible with any ``0.n.*``
90+
version but are allowed to drop compatibility with the ``0.(n-1).*`` series
91+
and below.
92+
93+
* Major releases (``n.*.*`` → ``(n+1).0.0`` upgrades) are not planned yet:
94+
we're still in beta and the final feature set of the ``1.0.0`` release is not
95+
decided yet.
96+
97+
98+
Release process
99+
---------------
100+
101+
Start from the ``develop`` branch:
102+
103+
.. code-block:: bash
104+
105+
$ git clone git@github.com:kdeldycke/mdx_titlecase.git
106+
$ git checkout develop
107+
108+
Revision should already be set to the next version, so we just need to set the
109+
released date in the changelog:
110+
111+
.. code-block:: bash
112+
113+
$ vi ./CHANGES.rst
114+
115+
Create a release commit, tag it and merge it back to ``master`` branch:
116+
117+
.. code-block:: bash
118+
119+
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
120+
$ git commit -m "Release vX.Y.Z"
121+
$ git tag "vX.Y.Z"
122+
$ git push
123+
$ git push --tags
124+
$ git checkout master
125+
$ git pull
126+
$ git merge "vX.Y.Z"
127+
$ git push
128+
129+
Push packaging to the `test cheeseshop
130+
<https://wiki.python.org/moin/TestPyPI>`_:
131+
132+
.. code-block:: bash
133+
134+
$ pip install wheel
135+
$ python ./setup.py register -r testpypi
136+
$ python ./setup.py clean
137+
$ rm -rf ./build ./dist
138+
$ python ./setup.py sdist bdist_egg bdist_wheel upload -r testpypi
139+
140+
Publish packaging to `PyPi <https://pypi.python.org>`_:
141+
142+
.. code-block:: bash
143+
144+
$ python ./setup.py register -r pypi
145+
$ python ./setup.py clean
146+
$ rm -rf ./build ./dist
147+
$ python ./setup.py sdist bdist_egg bdist_wheel upload -r pypi
148+
149+
Bump revision back to its development state:
150+
151+
.. code-block:: bash
152+
153+
$ pip install bumpversion
154+
$ git checkout develop
155+
$ bumpversion --verbose patch
156+
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
157+
$ git commit -m "Post release version bump."
158+
$ git push
159+
160+
Now if the next revision is no longer bug-fix only:
161+
162+
.. code-block:: bash
163+
164+
$ bumpversion --verbose minor
165+
$ git add ./mdx_titlecase/__init__.py ./CHANGES.rst
166+
$ git commit -m "Next release no longer bug-fix only. Bump revision."
167+
$ git push
168+
169+
170+
License
171+
-------
172+
173+
This software is licensed under the `GNU General Public License v2 or later
174+
(GPLv2+)
175+
<https://github.com/kdeldycke/mdx_titlecase/blob/master/LICENSE>`_.

setup.cfg

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[bumpversion]
2+
current_version = 0.01
3+
files = mdx_titlecase/__init__.py CHANGES.rst README.rst
4+
allow_dirty = True
5+
commit = False
6+
tag = False
7+
tag_name = v{new_version}
8+
9+
[nosetests]
10+
match = ^test
11+
cover-package = mdx_titlecase
12+
with-coverage = 1
13+
cover-erase = 1
14+
cover-branches = 1
15+
cover-min-percentage = 30
16+
17+
[pep8]
18+
ignore =
19+
show-source = True
20+
statistics = True
21+
22+
[pylint]
23+
# C0103: Invalid name
24+
# C0111: Missing docstring
25+
# W0142: Used * or ** magic
26+
# W0511: Warning notes in code comments
27+
disable = C0103,C0111,W0141,W0142,W0511
28+
ignore-docstrings = yes
29+
output-format = colorized

setup.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (C) 2015 Kevin Deldycke <kevin@deldycke.com>
5+
#
6+
# This program is Free Software; you can redistribute it and/or
7+
# modify it under the terms of the GNU General Public License
8+
# as published by the Free Software Foundation; either version 2
9+
# of the License, or (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+
20+
import codecs
21+
import os
22+
import re
23+
24+
from setuptools import setup, find_packages
25+
26+
27+
MODULE_NAME = 'mdx_titlecase'
28+
29+
30+
def get_version():
31+
32+
with open(os.path.join(
33+
os.path.dirname(__file__), MODULE_NAME, '__init__.py')
34+
) as init:
35+
36+
for line in init.readlines():
37+
res = re.match(r'__version__ *= *[\'"]([0-9a-z\.]*)[\'"]$', line)
38+
if res:
39+
return res.group(1)
40+
41+
42+
def get_long_description():
43+
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
44+
changes = os.path.join(os.path.dirname(__file__), 'CHANGES.rst')
45+
return codecs.open(readme, encoding='utf-8').read() + '\n' + \
46+
codecs.open(changes, encoding='utf-8').read()
47+
48+
49+
setup(
50+
name='mdx_titlecase',
51+
version=get_version(),
52+
description="Proper title-casing for Python's Markdown.",
53+
long_description=get_long_description(),
54+
55+
author='Kevin Deldycke',
56+
author_email='kevin@deldycke.com',
57+
url='https://github.com/kdeldycke/mdx_titlecase',
58+
license='GPLv2+',
59+
60+
install_requires=[
61+
],
62+
63+
packages=find_packages(),
64+
65+
tests_require=[],
66+
test_suite=MODULE_NAME + '.tests',
67+
68+
classifiers=[
69+
'Development Status :: 4 - Beta',
70+
'Intended Audience :: Developers',
71+
'Intended Audience :: Information Technology',
72+
'License :: OSI Approved :: '
73+
'GNU General Public License v2 or later (GPLv2+)',
74+
'Operating System :: OS Independent',
75+
'Programming Language :: Python',
76+
'Programming Language :: Python :: 2',
77+
'Programming Language :: Python :: 2.7',
78+
],
79+
)

0 commit comments

Comments
 (0)