Welcome to bootstrap-py’s documentation!¶
Contents:
Bootstrap Python Package¶
The bootstrap-py
provides generating the Python packages.
Notes¶
Genateed package with v0.4.1 or less that has bugs Sphinx documentation. Modify the follows manually.
Fixes
docs/source/index.rst
:diff --git a/docs/source/index.rst b/docs/source/index.rst index b3404ac..d8bdc83 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,8 +16,8 @@ Contents: CHANGELOG - Indices and tables -=================== +Indices and tables +================== * :ref:`genindex` * :ref:`modindex`
Renames
docs/source/README
todocs/source/README.rst
.Fixes documentation
version
indocs/source/conf.py
.Fixes
auth_email
,url
insetup.py
.
Requirements¶
- Python 2.7 over or Python 3.3 over or PyPy 2.4.0 over
Features¶
Usage¶
Install bootstrap-py¶
Install bootstrap-py:
$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install bootstrap-py
Generate Python package¶
Generate your Python package.:
(venv)$ bootstrap-py create -a 'Your author name' -e 'your-author-email@example.org' \
-u 'https://your-package-website.example.org' -o '/path/to/package-dir' \
-l 'select-the-license' 'your-package-name'
(venv)$ deactivate
$ cd /path/to/package-dir
$ ls
MANIFEST.in docs pytest.ini setup.py utils
README.rst libneta setup.cfg tox.ini
List license choices¶
List license description choices.:
(venv)$ bootstrap-py list -l
GPL : GNU General Public License (GPL)
CPL : Common Public License
IOSL : Intel Open Source License
GPLv3+ : GNU General Public License v3 or later (GPLv3+)
(omit)
Using tox¶
Running test with tox:
$ pip install --user tox
$ tox
(omit)
_______________________________________ summary ______________________________________
py27: commands succeeded
py34: commands succeeded
py35: commands succeeded
pypy: commands succeeded
pep257: commands succeeded
docs: commands succeeded
pychecker: commands succeeded
congratulations :)
References¶
bootstrap_py.control.
-
bootstrap_py.control.
retreive_metadata
()[source]¶ retrieve metadata.
Return type: bootstrap_py.classifiers.Classifiers Returns: Classifiers()
-
bootstrap_py.control.
print_licences
(params, metadata)[source]¶ print licenses.
Parameters: - params (argparse.Namespace) – parameter
- metadata (bootstrap_py.classifier.Classifiers) – package metadata
-
bootstrap_py.control.
check_repository_existence
(params)[source]¶ check repository existence.
Parameters: params (argparse.Namespace) – parameters
-
bootstrap_py.control.
check_package_existence
(params)[source]¶ check package existence.
Parameters: params (argparse.Namespace) – parameters
-
bootstrap_py.control.
generate_package
(params)[source]¶ generate package repository.
Parameters: params (argparse.Namespace) – parameters
bootstrap_py.package.
-
class
bootstrap_py.package.
PackageData
(args)[source]¶ Bases:
object
Package meta data class.
-
default_version
= '0.1.0'¶ Configured the default “version” of setup.setup().
-
warning_message
= '##### ToDo: Rewrite me #####'¶ Users should rewrite parameters after they generate Python package.
-
-
class
bootstrap_py.package.
PackageTree
(pkg_data)[source]¶ Bases:
object
Package directory tree class.
-
template_name
= 'bootstrap_py'¶ Jinja2 template name
-
suffix
= '-bootstrap-py'¶ the suffix name of working directory for generating
-
init
= '__init__.py'¶ init filename
-
dir_perm
= 493¶ default permission
-
pkg_dirs
= ['{name}', '{name}/tests']¶ include directories to packages
-
bootstrap_py.classifiers.
-
class
bootstrap_py.classifiers.
Classifiers
[source]¶ Bases:
object
Classifiers.
-
url
= 'https://pypi.python.org/pypi?%3Aaction=list_classifiers'¶ list_classifiers url
-
prefix_status
= 'Development Status :: '¶ prefix status
-
prefix_lic
= 'License :: OSI Approved :: '¶ prefix licences
-
bootstrap_py.docs.
-
bootstrap_py.docs.
build_sphinx
(pkg_data, projectdir)[source]¶ Building sphinx documentation.
Return type: int
Returns: subprocess.call return code
Parameters: - pkg_data (bootstrap_py.control.PackageData) – package meta data
- projectdir (str) – project root directory
bootstrap_py.pypi.
-
bootstrap_py.pypi.
PYPI_URL
= 'https://pypi.python.org/pypi'¶ PyPI XML-RPC API url
-
bootstrap_py.pypi.
package_existent
(name)[source]¶ search package.
bootstrap_py.exceptions.Conflict
exception occurs when user specified name has already existed.bootstrap_py.exceptions.BackendFailure
exception occurs when PyPI service is down.
Parameters: name (str) – package name
-
bootstrap_py.pypi.
search_package
(name)[source]¶ search package.
Parameters: name (str) – package name Return type: list Returns: package name list
bootstrap_py.vcs.
bootstrap_py.exceptions.
-
exception
bootstrap_py.exceptions.
Error
(message=None)[source]¶ Bases:
Exception
Base error class.
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
bootstrap_py.exceptions.
NotFound
(message=None)[source]¶ Bases:
bootstrap_py.exceptions.Error
Not Found.
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
bootstrap_py.exceptions.
Conflict
(message=None)[source]¶ Bases:
bootstrap_py.exceptions.Error
Confilict.
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
bootstrap_py.exceptions.
BackendFailure
(message=None)[source]¶ Bases:
bootstrap_py.exceptions.Error
PyPI service down.
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
ChangeLog¶
0.4.2 (2016-03-08)¶
- Fixes configiratuon version, release.
- Fixes url, author_email in setup.py.
0.4.1 (2016-03-07)¶
- Adds exception handler package update.
- Fixes some docstring.
0.4.0 (2016-03-07)¶
- Adds checking latest version.
- Fixes Sphinx template bugs.
- Does some refactoring.
0.3.0 (2016-02-21)¶
- git init and initial commit.
- Adds –no-check option.
- Fixes list subcommand.
0.2.1 (2016-02-16)¶
- Fixes failing create sub-command.
0.2.0 (2016-02-15)¶
- Adds create, list sub-command.
- “create”: generating Python package.
- “list”: Print license description for choices.
- Changes mutually exclusive group; username, url options.
- Add checking package name in PyPI.
- Adds some exception handling.
0.1.1 (2016-02-02)¶
- Fixes README template
0.1.0 (2016-02-02)¶
- First release