From 4b0342a9998f8567d6c3b5915ca5b060005afa68 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 16 Jul 2018 18:13:47 +0100 Subject: [PATCH 01/34] :tada: initial files to convert a repo to a python package --- .moban.d/CUSTOM_README.rst.jj2 | 1 + .moban.d/custom_setup.py.jj2 | 1 + .moban.d/tests/custom_requirements.txt.jj2 | 4 + CHANGELOG.rst | 2 + MANIFEST.in | 2 + Makefile | 7 + docs/source/conf.py | 182 +++++++++++++++++++++ pypi-mobans.yml | 12 ++ pypi_mobans/__init__.py | 3 + pypi_mobans/_version.py | 2 + requirements.txt | 0 setup.cfg | 2 + setup.py | 178 ++++++++++++++++++++ test.sh | 2 + tests/requirements.txt | 5 + 15 files changed, 403 insertions(+) create mode 100644 .moban.d/CUSTOM_README.rst.jj2 create mode 100644 .moban.d/custom_setup.py.jj2 create mode 100644 .moban.d/tests/custom_requirements.txt.jj2 create mode 100644 CHANGELOG.rst create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 docs/source/conf.py create mode 100644 pypi-mobans.yml create mode 100644 pypi_mobans/__init__.py create mode 100644 pypi_mobans/_version.py create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test.sh create mode 100644 tests/requirements.txt diff --git a/.moban.d/CUSTOM_README.rst.jj2 b/.moban.d/CUSTOM_README.rst.jj2 new file mode 100644 index 0000000..411b9d7 --- /dev/null +++ b/.moban.d/CUSTOM_README.rst.jj2 @@ -0,0 +1 @@ +{% extends 'README.rst.jj2' %} diff --git a/.moban.d/custom_setup.py.jj2 b/.moban.d/custom_setup.py.jj2 new file mode 100644 index 0000000..2f700ec --- /dev/null +++ b/.moban.d/custom_setup.py.jj2 @@ -0,0 +1 @@ +{% extends "setup.py.jj2" %} diff --git a/.moban.d/tests/custom_requirements.txt.jj2 b/.moban.d/tests/custom_requirements.txt.jj2 new file mode 100644 index 0000000..a22fe7e --- /dev/null +++ b/.moban.d/tests/custom_requirements.txt.jj2 @@ -0,0 +1,4 @@ +{% extends "tests/requirements.txt.jj2" %} + +{%block extras %} +{%endblock%} diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..7398c8c --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,2 @@ +Change log +=========== diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5f13ef0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include README.rst +include CHANGELOG.rst diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..26d9b68 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +all: test + +test: + bash test.sh + +document: + bash document.sh diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..ddc9215 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,182 @@ +# -*- coding: utf-8 -*- +DESCRIPTION = ( + 'general python package templates using moban' + + '' +) +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + +# -- Project information ----------------------------------------------------- + +project = u'pypi-mobans' +copyright = u'2018 Onni Software Ltd.' +author = u'C.W.' + +# The short X.Y version +version = u'0.0.0' +# The full version, including alpha/beta/rc tags +release = u'0.0.1' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.viewcode', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'pypi-mobansdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'pypi-mobans.tex', u'pypi-mobans Documentation', + u'Onni Software Ltd.', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'pypi-mobans', u'pypi-mobans Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'pypi-mobans', u'pypi-mobans Documentation', + author, 'pypi-mobans', 'One line description of project.', + 'Miscellaneous'), +] + +# -- Extension configuration ------------------------------------------------- +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} +# TODO: html_theme not configurable upstream +html_theme = 'default' + +# TODO: DESCRIPTION not configurable upstream +texinfo_documents = [ + ('index', 'pypi-mobans', + 'pypi-mobans Documentation', + 'Onni Software Ltd.', 'pypi-mobans', + DESCRIPTION, + 'Miscellaneous'), +] +intersphinx_mapping.update({ +}) diff --git a/pypi-mobans.yml b/pypi-mobans.yml new file mode 100644 index 0000000..f215bb1 --- /dev/null +++ b/pypi-mobans.yml @@ -0,0 +1,12 @@ +name: "pypi-mobans" +organisation: "moremoban" +author: "C.W." +contact: "wangc_2011@hotmail.com" +company: "Onni Software Ltd." +version: "0.0.1" +current_version: "0.0.1" +release: "0.0.0" +copyright_year: 2018 +license: public license +dependencies: [] +description: "general python package templates using moban" diff --git a/pypi_mobans/__init__.py b/pypi_mobans/__init__.py new file mode 100644 index 0000000..dbd7c46 --- /dev/null +++ b/pypi_mobans/__init__.py @@ -0,0 +1,3 @@ +# flake8: noqa +from pypi_mobans._version import __version__ +from pypi_mobans._version import __author__ diff --git a/pypi_mobans/_version.py b/pypi_mobans/_version.py new file mode 100644 index 0000000..bade78b --- /dev/null +++ b/pypi_mobans/_version.py @@ -0,0 +1,2 @@ +__version__ = "0.0.1" +__author__ = "C.W." diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2a9acf1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..463688a --- /dev/null +++ b/setup.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 + +# Template by pypi-mobans +import os +import sys +import codecs +from shutil import rmtree +from setuptools import setup, find_packages, Command +from platform import python_implementation +PY2 = sys.version_info[0] == 2 +PY26 = PY2 and sys.version_info[1] < 7 + +NAME = 'pypi-mobans' +AUTHOR = 'C.W.' +VERSION = '0.0.1' +EMAIL = 'wangc_2011@hotmail.com' +LICENSE = 'public license' +DESCRIPTION = ( + 'general python package templates using moban' +) +URL = 'https://github.com/moremoban/pypi-mobans' +DOWNLOAD_URL = '%s/archive/0.0.0.tar.gz' % URL +FILES = ['README.rst', 'CHANGELOG.rst'] +KEYWORDS = [ + 'python' +] + +CLASSIFIERS = [ + 'Topic :: Software Development :: Libraries', + 'Programming Language :: Python', + 'Intended Audience :: Developers', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', +] + +INSTALL_REQUIRES = [ +] +SETUP_COMMANDS = {} + + +PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +EXTRAS_REQUIRE = {} +# You do not need to read beyond this line +PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( + sys.executable) +GS_COMMAND = ('gs pypi-mobans v0.0.0 ' + + "Find 0.0.0 in changelog for more details") +NO_GS_MESSAGE = ('Automatic github release is disabled. ' + + 'Please install gease to enable it.') +UPLOAD_FAILED_MSG = ( + 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND) +HERE = os.path.abspath(os.path.dirname(__file__)) + + +class PublishCommand(Command): + """Support setup.py upload.""" + + description = 'Build and publish the package on github and pypi' + user_options = [] + + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds...') + rmtree(os.path.join(HERE, 'dist')) + rmtree(os.path.join(HERE, 'build')) + rmtree(os.path.join(HERE, 'pypi_mobans.egg-info')) + except OSError: + pass + + self.status('Building Source and Wheel (universal) distribution...') + run_status = True + if has_gease(): + run_status = os.system(GS_COMMAND) == 0 + else: + self.status(NO_GS_MESSAGE) + if run_status: + if os.system(PUBLISH_COMMAND) != 0: + self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND) + + sys.exit() + + +SETUP_COMMANDS.update({ + 'publish': PublishCommand +}) + + +def has_gease(): + """ + test if github release command is installed + + visit http://github.com/moremoban/gease for more info + """ + try: + import gease # noqa + return True + except ImportError: + return False + + +def read_files(*files): + """Read files into setup""" + text = "" + for single_file in files: + content = read(single_file) + text = text + content + "\n" + return text + + +def read(afile): + """Read a file into setup""" + the_relative_file = os.path.join(HERE, afile) + with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file: + content = filter_out_test_code(opened_file) + content = "".join(list(content)) + return content + + +def filter_out_test_code(file_handle): + found_test_code = False + for line in file_handle.readlines(): + if line.startswith('.. testcode:'): + found_test_code = True + continue + if found_test_code is True: + if line.startswith(' '): + continue + else: + empty_line = line.strip() + if len(empty_line) == 0: + continue + else: + found_test_code = False + yield line + else: + for keyword in ['|version|', '|today|']: + if keyword in line: + break + else: + yield line + + +if __name__ == '__main__': + setup( + name=NAME, + author=AUTHOR, + version=VERSION, + author_email=EMAIL, + description=DESCRIPTION, + url=URL, + download_url=DOWNLOAD_URL, + long_description=read_files(*FILES), + license=LICENSE, + keywords=KEYWORDS, + extras_require=EXTRAS_REQUIRE, + tests_require=['nose'], + install_requires=INSTALL_REQUIRES, + packages=PACKAGES, + include_package_data=True, + zip_safe=False, + classifiers=CLASSIFIERS, + cmdclass=SETUP_COMMANDS + ) diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..bfb24c1 --- /dev/null +++ b/test.sh @@ -0,0 +1,2 @@ +pip freeze +nosetests --with-coverage --cover-package pypi_mobans --cover-package tests tests docs/source pypi_mobans && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..c445df5 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,5 @@ +nose +mock +codecov +coverage +flake8 From 730935d4b5b9e71a0d5177934e0e4068e75f0157 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 16 Jul 2018 18:19:33 +0100 Subject: [PATCH 02/34] :sparkles: integrated with readme --- .moban.d/CUSTOM_README.rst.jj2 | 48 +++++++++++++++++++++++++++++++++ .moban.dt/local-README.rst.jj2 | 49 ---------------------------------- .moban.yml | 14 ++++++++++ README.rst | 5 ++-- docs/source/conf.py | 2 +- pypi-mobans.yml | 2 +- setup.py | 2 +- 7 files changed, 67 insertions(+), 55 deletions(-) delete mode 100644 .moban.dt/local-README.rst.jj2 create mode 100644 .moban.yml diff --git a/.moban.d/CUSTOM_README.rst.jj2 b/.moban.d/CUSTOM_README.rst.jj2 index 411b9d7..5f9f034 100644 --- a/.moban.d/CUSTOM_README.rst.jj2 +++ b/.moban.d/CUSTOM_README.rst.jj2 @@ -1 +1,49 @@ {% extends 'README.rst.jj2' %} + +{% block documentation_link %} +{% endblock %} + +{% block features %} +{{description}} +It is used with `yehua `_. +Organisations using it: + +- `pyexcel `_. +- `coala `_. + +Features +================================================================================ + +setup.py +---------- + +1. flake8 compliant setup.py + +2. feature parity with `kennethreitz/setup.py `_ + + - automatically upload to pypi without using twine + + - automatically do git release while uploading to pypi + +3. configured to build universial wheels by default +{% endblock %} + +{% block bottom_block %} +Notes +================================================================================ + + +In order to run, `python setup.py publish`, you will have setup `.pypirc` in +your home folder as:: + + [distutils] + index-servers = + pypi + + [pypi] + username=your_name + password=your_password + + +And you need to configure `gease`. +{% endblock %} diff --git a/.moban.dt/local-README.rst.jj2 b/.moban.dt/local-README.rst.jj2 deleted file mode 100644 index 5f9f034..0000000 --- a/.moban.dt/local-README.rst.jj2 +++ /dev/null @@ -1,49 +0,0 @@ -{% extends 'README.rst.jj2' %} - -{% block documentation_link %} -{% endblock %} - -{% block features %} -{{description}} -It is used with `yehua `_. -Organisations using it: - -- `pyexcel `_. -- `coala `_. - -Features -================================================================================ - -setup.py ----------- - -1. flake8 compliant setup.py - -2. feature parity with `kennethreitz/setup.py `_ - - - automatically upload to pypi without using twine - - - automatically do git release while uploading to pypi - -3. configured to build universial wheels by default -{% endblock %} - -{% block bottom_block %} -Notes -================================================================================ - - -In order to run, `python setup.py publish`, you will have setup `.pypirc` in -your home folder as:: - - [distutils] - index-servers = - pypi - - [pypi] - username=your_name - password=your_password - - -And you need to configure `gease`. -{% endblock %} diff --git a/.moban.yml b/.moban.yml new file mode 100644 index 0000000..d9c71c3 --- /dev/null +++ b/.moban.yml @@ -0,0 +1,14 @@ +configuration: + template_dir: + - "mobans/templates" + - ".moban.d" + configuration: pypi-mobans.yml +targets: + - README.rst: CUSTOM_README.rst.jj2 + - setup.py: custom_setup.py.jj2 + - requirements.txt: requirements.txt.jj2 + - "tests/requirements.txt": "tests/custom_requirements.txt.jj2" + - "docs/source/conf.py": "docs/source/conf.py.jj2" + - test.sh: test.script.jj2 + - "pypi_mobans/_version.py": "_version.py.jj2" + - .gitignore: gitignore.jj2 diff --git a/README.rst b/README.rst index be1ded8..0f0630a 100644 --- a/README.rst +++ b/README.rst @@ -8,11 +8,9 @@ pypi-mobans .. image:: https://codecov.io/github/moremoban/pypi-mobans/coverage.png :target: https://codecov.io/github/moremoban/pypi-mobans -.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg - :target: https://gitter.im/chfw_moban/Lobby -Scaffolding templates for your Python project. +Scaffolding mobans for your Python project. It is used with `yehua `_. Organisations using it: @@ -44,6 +42,7 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans + $ python setup.py install Notes ================================================================================ diff --git a/docs/source/conf.py b/docs/source/conf.py index ddc9215..4515b50 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- DESCRIPTION = ( - 'general python package templates using moban' + + 'Scaffolding mobans for your Python project.' + '' ) # -*- coding: utf-8 -*- diff --git a/pypi-mobans.yml b/pypi-mobans.yml index f215bb1..7048397 100644 --- a/pypi-mobans.yml +++ b/pypi-mobans.yml @@ -9,4 +9,4 @@ release: "0.0.0" copyright_year: 2018 license: public license dependencies: [] -description: "general python package templates using moban" +description: "Scaffolding mobans for your Python project." diff --git a/setup.py b/setup.py index 463688a..afd15bb 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'public license' DESCRIPTION = ( - 'general python package templates using moban' + 'Scaffolding mobans for your Python project.' ) URL = 'https://github.com/moremoban/pypi-mobans' DOWNLOAD_URL = '%s/archive/0.0.0.tar.gz' % URL From 18fa6e41df9f1ce1d174c2e2be195513f5358651 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 16 Jul 2018 18:23:34 +0100 Subject: [PATCH 03/34] :tractor: relocate files so that they can be transported by python package system --- .gitmodules | 2 +- {config => pypi_mobans/resources/config}/data.yml | 0 .../resources/templates}/CHANGELOG.rst.jj2 | 0 {templates => pypi_mobans/resources/templates}/MANIFEST.in.jj2 | 0 .../resources/templates}/NEW_BSD_LICENSE.jj2 | 0 {templates => pypi_mobans/resources/templates}/README.rst.jj2 | 0 {templates => pypi_mobans/resources/templates}/__init__.py.jj2 | 0 {templates => pypi_mobans/resources/templates}/_version.py.jj2 | 0 {templates => pypi_mobans/resources/templates}/badges.rst.jj2 | 0 {templates => pypi_mobans/resources/templates}/conf.py.jj2 | 0 .../resources/templates}/docs/Makefile.jj2 | 0 {templates => pypi_mobans/resources/templates}/docs/conf.py_t | 0 .../resources/templates}/docs/index.rst.jj2 | 0 .../resources/templates}/docs/make.bat.jj2 | 0 .../resources/templates}/docs/master_doc.rst_t | 0 .../resources/templates}/docs/source/conf.py.jj2 | 0 .../resources/templates}/docs/source/index.rst.jj2 | 0 {templates => pypi_mobans/resources/templates}/gitignore | 0 {templates => pypi_mobans/resources/templates}/gitignore.jj2 | 0 .../resources/templates}/installation.rst.jj2 | 0 .../resources/templates}/requirements.txt.jj2 | 0 {templates => pypi_mobans/resources/templates}/setup.py.jj2 | 0 {templates => pypi_mobans/resources/templates}/test.script.jj2 | 0 .../resources/templates}/tests/requirements.txt.jj2 | 0 {templates => pypi_mobans/resources/templates}/travis.yml.jj2 | 0 25 files changed, 1 insertion(+), 1 deletion(-) rename {config => pypi_mobans/resources/config}/data.yml (100%) rename {templates => pypi_mobans/resources/templates}/CHANGELOG.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/MANIFEST.in.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/NEW_BSD_LICENSE.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/README.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/__init__.py.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/_version.py.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/badges.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/conf.py.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/docs/Makefile.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/docs/conf.py_t (100%) rename {templates => pypi_mobans/resources/templates}/docs/index.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/docs/make.bat.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/docs/master_doc.rst_t (100%) rename {templates => pypi_mobans/resources/templates}/docs/source/conf.py.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/docs/source/index.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/gitignore (100%) rename {templates => pypi_mobans/resources/templates}/gitignore.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/installation.rst.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/requirements.txt.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/setup.py.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/test.script.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/tests/requirements.txt.jj2 (100%) rename {templates => pypi_mobans/resources/templates}/travis.yml.jj2 (100%) diff --git a/.gitmodules b/.gitmodules index b31cdf0..20cc7b1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "gitignore"] - path = templates/gitignore + path = pypi_mobans/resources/templates/gitignore url = https://github.com/github/gitignore diff --git a/config/data.yml b/pypi_mobans/resources/config/data.yml similarity index 100% rename from config/data.yml rename to pypi_mobans/resources/config/data.yml diff --git a/templates/CHANGELOG.rst.jj2 b/pypi_mobans/resources/templates/CHANGELOG.rst.jj2 similarity index 100% rename from templates/CHANGELOG.rst.jj2 rename to pypi_mobans/resources/templates/CHANGELOG.rst.jj2 diff --git a/templates/MANIFEST.in.jj2 b/pypi_mobans/resources/templates/MANIFEST.in.jj2 similarity index 100% rename from templates/MANIFEST.in.jj2 rename to pypi_mobans/resources/templates/MANIFEST.in.jj2 diff --git a/templates/NEW_BSD_LICENSE.jj2 b/pypi_mobans/resources/templates/NEW_BSD_LICENSE.jj2 similarity index 100% rename from templates/NEW_BSD_LICENSE.jj2 rename to pypi_mobans/resources/templates/NEW_BSD_LICENSE.jj2 diff --git a/templates/README.rst.jj2 b/pypi_mobans/resources/templates/README.rst.jj2 similarity index 100% rename from templates/README.rst.jj2 rename to pypi_mobans/resources/templates/README.rst.jj2 diff --git a/templates/__init__.py.jj2 b/pypi_mobans/resources/templates/__init__.py.jj2 similarity index 100% rename from templates/__init__.py.jj2 rename to pypi_mobans/resources/templates/__init__.py.jj2 diff --git a/templates/_version.py.jj2 b/pypi_mobans/resources/templates/_version.py.jj2 similarity index 100% rename from templates/_version.py.jj2 rename to pypi_mobans/resources/templates/_version.py.jj2 diff --git a/templates/badges.rst.jj2 b/pypi_mobans/resources/templates/badges.rst.jj2 similarity index 100% rename from templates/badges.rst.jj2 rename to pypi_mobans/resources/templates/badges.rst.jj2 diff --git a/templates/conf.py.jj2 b/pypi_mobans/resources/templates/conf.py.jj2 similarity index 100% rename from templates/conf.py.jj2 rename to pypi_mobans/resources/templates/conf.py.jj2 diff --git a/templates/docs/Makefile.jj2 b/pypi_mobans/resources/templates/docs/Makefile.jj2 similarity index 100% rename from templates/docs/Makefile.jj2 rename to pypi_mobans/resources/templates/docs/Makefile.jj2 diff --git a/templates/docs/conf.py_t b/pypi_mobans/resources/templates/docs/conf.py_t similarity index 100% rename from templates/docs/conf.py_t rename to pypi_mobans/resources/templates/docs/conf.py_t diff --git a/templates/docs/index.rst.jj2 b/pypi_mobans/resources/templates/docs/index.rst.jj2 similarity index 100% rename from templates/docs/index.rst.jj2 rename to pypi_mobans/resources/templates/docs/index.rst.jj2 diff --git a/templates/docs/make.bat.jj2 b/pypi_mobans/resources/templates/docs/make.bat.jj2 similarity index 100% rename from templates/docs/make.bat.jj2 rename to pypi_mobans/resources/templates/docs/make.bat.jj2 diff --git a/templates/docs/master_doc.rst_t b/pypi_mobans/resources/templates/docs/master_doc.rst_t similarity index 100% rename from templates/docs/master_doc.rst_t rename to pypi_mobans/resources/templates/docs/master_doc.rst_t diff --git a/templates/docs/source/conf.py.jj2 b/pypi_mobans/resources/templates/docs/source/conf.py.jj2 similarity index 100% rename from templates/docs/source/conf.py.jj2 rename to pypi_mobans/resources/templates/docs/source/conf.py.jj2 diff --git a/templates/docs/source/index.rst.jj2 b/pypi_mobans/resources/templates/docs/source/index.rst.jj2 similarity index 100% rename from templates/docs/source/index.rst.jj2 rename to pypi_mobans/resources/templates/docs/source/index.rst.jj2 diff --git a/templates/gitignore b/pypi_mobans/resources/templates/gitignore similarity index 100% rename from templates/gitignore rename to pypi_mobans/resources/templates/gitignore diff --git a/templates/gitignore.jj2 b/pypi_mobans/resources/templates/gitignore.jj2 similarity index 100% rename from templates/gitignore.jj2 rename to pypi_mobans/resources/templates/gitignore.jj2 diff --git a/templates/installation.rst.jj2 b/pypi_mobans/resources/templates/installation.rst.jj2 similarity index 100% rename from templates/installation.rst.jj2 rename to pypi_mobans/resources/templates/installation.rst.jj2 diff --git a/templates/requirements.txt.jj2 b/pypi_mobans/resources/templates/requirements.txt.jj2 similarity index 100% rename from templates/requirements.txt.jj2 rename to pypi_mobans/resources/templates/requirements.txt.jj2 diff --git a/templates/setup.py.jj2 b/pypi_mobans/resources/templates/setup.py.jj2 similarity index 100% rename from templates/setup.py.jj2 rename to pypi_mobans/resources/templates/setup.py.jj2 diff --git a/templates/test.script.jj2 b/pypi_mobans/resources/templates/test.script.jj2 similarity index 100% rename from templates/test.script.jj2 rename to pypi_mobans/resources/templates/test.script.jj2 diff --git a/templates/tests/requirements.txt.jj2 b/pypi_mobans/resources/templates/tests/requirements.txt.jj2 similarity index 100% rename from templates/tests/requirements.txt.jj2 rename to pypi_mobans/resources/templates/tests/requirements.txt.jj2 diff --git a/templates/travis.yml.jj2 b/pypi_mobans/resources/templates/travis.yml.jj2 similarity index 100% rename from templates/travis.yml.jj2 rename to pypi_mobans/resources/templates/travis.yml.jj2 From 619fb3e940b72a1fd0edd3c9f3239eefce1cabf9 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 16 Jul 2018 18:27:29 +0100 Subject: [PATCH 04/34] :sparkles: simple change to make it a loadable plugin for moban via lml --- pypi-mobans.yml | 3 ++- pypi_mobans/__init__.py | 9 +++++++++ requirements.txt | 1 + setup.py | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pypi-mobans.yml b/pypi-mobans.yml index 7048397..2c46ed2 100644 --- a/pypi-mobans.yml +++ b/pypi-mobans.yml @@ -8,5 +8,6 @@ current_version: "0.0.1" release: "0.0.0" copyright_year: 2018 license: public license -dependencies: [] +dependencies: + - lml description: "Scaffolding mobans for your Python project." diff --git a/pypi_mobans/__init__.py b/pypi_mobans/__init__.py index dbd7c46..310e518 100644 --- a/pypi_mobans/__init__.py +++ b/pypi_mobans/__init__.py @@ -1,3 +1,12 @@ # flake8: noqa from pypi_mobans._version import __version__ from pypi_mobans._version import __author__ +from lml.plugin import PluginInfo + + +@PluginInfo('pypi', tags=['setupmobans', 'pypi', 'pypimobans']) +class Pypkg(): + def __init__(self): + __package_path__ = os.path.dirname(__file__) + self.resources_path = os.path.join( + __package_path__, "resources") diff --git a/requirements.txt b/requirements.txt index e69de29..87bedb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +lml diff --git a/setup.py b/setup.py index afd15bb..c7c53d3 100644 --- a/setup.py +++ b/setup.py @@ -38,12 +38,14 @@ ] INSTALL_REQUIRES = [ + 'lml', ] SETUP_COMMANDS = {} PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) -EXTRAS_REQUIRE = {} +EXTRAS_REQUIRE = { +} # You do not need to read beyond this line PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( sys.executable) From 5a74313497ae83d5353d7cda97542b67c87aa5c9 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 16 Jul 2018 18:34:05 +0100 Subject: [PATCH 05/34] :art: include all files --- MANIFEST.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index 5f13ef0..4f929b2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,5 @@ include README.rst include CHANGELOG.rst +include pypi_mobans/resources/templates/* +include pypi_mobans/resources/templates/gitignore/* +include pypi_mobans/resources/config/* From 38ed56592a5e72a7eddf53ea68f5af73a59e7607 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 18 Jul 2018 10:30:49 +0100 Subject: [PATCH 06/34] :art: update plugin name --- pypi_mobans/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypi_mobans/__init__.py b/pypi_mobans/__init__.py index 310e518..6001420 100644 --- a/pypi_mobans/__init__.py +++ b/pypi_mobans/__init__.py @@ -4,7 +4,7 @@ from lml.plugin import PluginInfo -@PluginInfo('pypi', tags=['setupmobans', 'pypi', 'pypimobans']) +@PluginInfo('library', tags=['setupmobans', 'pypi', 'pypimobans']) class Pypkg(): def __init__(self): __package_path__ = os.path.dirname(__file__) From 2a2b467020d002d51d4983e94dd4e4139b0ef6ba Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 28 Jul 2018 01:27:04 +0100 Subject: [PATCH 07/34] :bug: minor fix --- pypi_mobans/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pypi_mobans/__init__.py b/pypi_mobans/__init__.py index 6001420..d1760f0 100644 --- a/pypi_mobans/__init__.py +++ b/pypi_mobans/__init__.py @@ -1,4 +1,5 @@ # flake8: noqa +import os from pypi_mobans._version import __version__ from pypi_mobans._version import __author__ from lml.plugin import PluginInfo From f250b7ce0db02300f8eb17307e2b484df6de7949 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 31 Jul 2018 23:32:07 +0100 Subject: [PATCH 08/34] :books: add more files --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index 4f929b2..2c636a4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,6 @@ include README.rst include CHANGELOG.rst include pypi_mobans/resources/templates/* include pypi_mobans/resources/templates/gitignore/* +include pypi_mobans/resources/templates/docs/* +include pypi_mobans/resources/templates/tests/* include pypi_mobans/resources/config/* From 343667864c575bc8fa1f90d6bfb38e161cae0627 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 31 Jul 2018 23:34:37 +0100 Subject: [PATCH 09/34] :bug: take all gitignore directory --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 2c636a4..6f4b487 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,7 @@ include README.rst include CHANGELOG.rst include pypi_mobans/resources/templates/* -include pypi_mobans/resources/templates/gitignore/* +recursive-include pypi_mobans/resources/templates/gitignore *.* include pypi_mobans/resources/templates/docs/* include pypi_mobans/resources/templates/tests/* include pypi_mobans/resources/config/* From 49f482d08099a83a2345eca2f32b562c9405f159 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 6 Aug 2018 23:01:44 +0100 Subject: [PATCH 10/34] :tractor: re-organising file structure --- .gitmodules | 2 +- {pypi_mobans/resources/config => config}/data.yml | 0 LICENSE => pypi-package/LICENSE | 0 MANIFEST.in => pypi-package/MANIFEST.in | 0 Makefile => pypi-package/Makefile | 0 {docs => pypi-package/docs}/source/conf.py | 0 {pypi_mobans => pypi-package/pypi_mobans}/__init__.py | 0 {pypi_mobans => pypi-package/pypi_mobans}/_version.py | 0 requirements.txt => pypi-package/requirements.txt | 0 setup.cfg => pypi-package/setup.cfg | 0 setup.py => pypi-package/setup.py | 0 .../resources/templates => templates}/CHANGELOG.rst.jj2 | 0 {pypi_mobans/resources/templates => templates}/MANIFEST.in.jj2 | 0 .../resources/templates => templates}/NEW_BSD_LICENSE.jj2 | 0 {pypi_mobans/resources/templates => templates}/README.rst.jj2 | 0 {pypi_mobans/resources/templates => templates}/__init__.py.jj2 | 0 {pypi_mobans/resources/templates => templates}/_version.py.jj2 | 0 {pypi_mobans/resources/templates => templates}/badges.rst.jj2 | 0 {pypi_mobans/resources/templates => templates}/conf.py.jj2 | 0 .../resources/templates => templates}/docs/Makefile.jj2 | 0 {pypi_mobans/resources/templates => templates}/docs/conf.py_t | 0 .../resources/templates => templates}/docs/index.rst.jj2 | 0 .../resources/templates => templates}/docs/make.bat.jj2 | 0 .../resources/templates => templates}/docs/master_doc.rst_t | 0 .../resources/templates => templates}/docs/source/conf.py.jj2 | 0 .../resources/templates => templates}/docs/source/index.rst.jj2 | 0 {pypi_mobans/resources/templates => templates}/gitignore | 0 {pypi_mobans/resources/templates => templates}/gitignore.jj2 | 0 .../resources/templates => templates}/installation.rst.jj2 | 0 .../resources/templates => templates}/requirements.txt.jj2 | 0 {pypi_mobans/resources/templates => templates}/setup.py.jj2 | 0 {pypi_mobans/resources/templates => templates}/test.script.jj2 | 0 .../templates => templates}/tests/requirements.txt.jj2 | 0 {pypi_mobans/resources/templates => templates}/travis.yml.jj2 | 0 34 files changed, 1 insertion(+), 1 deletion(-) rename {pypi_mobans/resources/config => config}/data.yml (100%) rename LICENSE => pypi-package/LICENSE (100%) rename MANIFEST.in => pypi-package/MANIFEST.in (100%) rename Makefile => pypi-package/Makefile (100%) rename {docs => pypi-package/docs}/source/conf.py (100%) rename {pypi_mobans => pypi-package/pypi_mobans}/__init__.py (100%) rename {pypi_mobans => pypi-package/pypi_mobans}/_version.py (100%) rename requirements.txt => pypi-package/requirements.txt (100%) rename setup.cfg => pypi-package/setup.cfg (100%) rename setup.py => pypi-package/setup.py (100%) rename {pypi_mobans/resources/templates => templates}/CHANGELOG.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/MANIFEST.in.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/NEW_BSD_LICENSE.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/README.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/__init__.py.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/_version.py.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/badges.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/conf.py.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/docs/Makefile.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/docs/conf.py_t (100%) rename {pypi_mobans/resources/templates => templates}/docs/index.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/docs/make.bat.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/docs/master_doc.rst_t (100%) rename {pypi_mobans/resources/templates => templates}/docs/source/conf.py.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/docs/source/index.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/gitignore (100%) rename {pypi_mobans/resources/templates => templates}/gitignore.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/installation.rst.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/requirements.txt.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/setup.py.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/test.script.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/tests/requirements.txt.jj2 (100%) rename {pypi_mobans/resources/templates => templates}/travis.yml.jj2 (100%) diff --git a/.gitmodules b/.gitmodules index 20cc7b1..b31cdf0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "gitignore"] - path = pypi_mobans/resources/templates/gitignore + path = templates/gitignore url = https://github.com/github/gitignore diff --git a/pypi_mobans/resources/config/data.yml b/config/data.yml similarity index 100% rename from pypi_mobans/resources/config/data.yml rename to config/data.yml diff --git a/LICENSE b/pypi-package/LICENSE similarity index 100% rename from LICENSE rename to pypi-package/LICENSE diff --git a/MANIFEST.in b/pypi-package/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to pypi-package/MANIFEST.in diff --git a/Makefile b/pypi-package/Makefile similarity index 100% rename from Makefile rename to pypi-package/Makefile diff --git a/docs/source/conf.py b/pypi-package/docs/source/conf.py similarity index 100% rename from docs/source/conf.py rename to pypi-package/docs/source/conf.py diff --git a/pypi_mobans/__init__.py b/pypi-package/pypi_mobans/__init__.py similarity index 100% rename from pypi_mobans/__init__.py rename to pypi-package/pypi_mobans/__init__.py diff --git a/pypi_mobans/_version.py b/pypi-package/pypi_mobans/_version.py similarity index 100% rename from pypi_mobans/_version.py rename to pypi-package/pypi_mobans/_version.py diff --git a/requirements.txt b/pypi-package/requirements.txt similarity index 100% rename from requirements.txt rename to pypi-package/requirements.txt diff --git a/setup.cfg b/pypi-package/setup.cfg similarity index 100% rename from setup.cfg rename to pypi-package/setup.cfg diff --git a/setup.py b/pypi-package/setup.py similarity index 100% rename from setup.py rename to pypi-package/setup.py diff --git a/pypi_mobans/resources/templates/CHANGELOG.rst.jj2 b/templates/CHANGELOG.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/CHANGELOG.rst.jj2 rename to templates/CHANGELOG.rst.jj2 diff --git a/pypi_mobans/resources/templates/MANIFEST.in.jj2 b/templates/MANIFEST.in.jj2 similarity index 100% rename from pypi_mobans/resources/templates/MANIFEST.in.jj2 rename to templates/MANIFEST.in.jj2 diff --git a/pypi_mobans/resources/templates/NEW_BSD_LICENSE.jj2 b/templates/NEW_BSD_LICENSE.jj2 similarity index 100% rename from pypi_mobans/resources/templates/NEW_BSD_LICENSE.jj2 rename to templates/NEW_BSD_LICENSE.jj2 diff --git a/pypi_mobans/resources/templates/README.rst.jj2 b/templates/README.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/README.rst.jj2 rename to templates/README.rst.jj2 diff --git a/pypi_mobans/resources/templates/__init__.py.jj2 b/templates/__init__.py.jj2 similarity index 100% rename from pypi_mobans/resources/templates/__init__.py.jj2 rename to templates/__init__.py.jj2 diff --git a/pypi_mobans/resources/templates/_version.py.jj2 b/templates/_version.py.jj2 similarity index 100% rename from pypi_mobans/resources/templates/_version.py.jj2 rename to templates/_version.py.jj2 diff --git a/pypi_mobans/resources/templates/badges.rst.jj2 b/templates/badges.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/badges.rst.jj2 rename to templates/badges.rst.jj2 diff --git a/pypi_mobans/resources/templates/conf.py.jj2 b/templates/conf.py.jj2 similarity index 100% rename from pypi_mobans/resources/templates/conf.py.jj2 rename to templates/conf.py.jj2 diff --git a/pypi_mobans/resources/templates/docs/Makefile.jj2 b/templates/docs/Makefile.jj2 similarity index 100% rename from pypi_mobans/resources/templates/docs/Makefile.jj2 rename to templates/docs/Makefile.jj2 diff --git a/pypi_mobans/resources/templates/docs/conf.py_t b/templates/docs/conf.py_t similarity index 100% rename from pypi_mobans/resources/templates/docs/conf.py_t rename to templates/docs/conf.py_t diff --git a/pypi_mobans/resources/templates/docs/index.rst.jj2 b/templates/docs/index.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/docs/index.rst.jj2 rename to templates/docs/index.rst.jj2 diff --git a/pypi_mobans/resources/templates/docs/make.bat.jj2 b/templates/docs/make.bat.jj2 similarity index 100% rename from pypi_mobans/resources/templates/docs/make.bat.jj2 rename to templates/docs/make.bat.jj2 diff --git a/pypi_mobans/resources/templates/docs/master_doc.rst_t b/templates/docs/master_doc.rst_t similarity index 100% rename from pypi_mobans/resources/templates/docs/master_doc.rst_t rename to templates/docs/master_doc.rst_t diff --git a/pypi_mobans/resources/templates/docs/source/conf.py.jj2 b/templates/docs/source/conf.py.jj2 similarity index 100% rename from pypi_mobans/resources/templates/docs/source/conf.py.jj2 rename to templates/docs/source/conf.py.jj2 diff --git a/pypi_mobans/resources/templates/docs/source/index.rst.jj2 b/templates/docs/source/index.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/docs/source/index.rst.jj2 rename to templates/docs/source/index.rst.jj2 diff --git a/pypi_mobans/resources/templates/gitignore b/templates/gitignore similarity index 100% rename from pypi_mobans/resources/templates/gitignore rename to templates/gitignore diff --git a/pypi_mobans/resources/templates/gitignore.jj2 b/templates/gitignore.jj2 similarity index 100% rename from pypi_mobans/resources/templates/gitignore.jj2 rename to templates/gitignore.jj2 diff --git a/pypi_mobans/resources/templates/installation.rst.jj2 b/templates/installation.rst.jj2 similarity index 100% rename from pypi_mobans/resources/templates/installation.rst.jj2 rename to templates/installation.rst.jj2 diff --git a/pypi_mobans/resources/templates/requirements.txt.jj2 b/templates/requirements.txt.jj2 similarity index 100% rename from pypi_mobans/resources/templates/requirements.txt.jj2 rename to templates/requirements.txt.jj2 diff --git a/pypi_mobans/resources/templates/setup.py.jj2 b/templates/setup.py.jj2 similarity index 100% rename from pypi_mobans/resources/templates/setup.py.jj2 rename to templates/setup.py.jj2 diff --git a/pypi_mobans/resources/templates/test.script.jj2 b/templates/test.script.jj2 similarity index 100% rename from pypi_mobans/resources/templates/test.script.jj2 rename to templates/test.script.jj2 diff --git a/pypi_mobans/resources/templates/tests/requirements.txt.jj2 b/templates/tests/requirements.txt.jj2 similarity index 100% rename from pypi_mobans/resources/templates/tests/requirements.txt.jj2 rename to templates/tests/requirements.txt.jj2 diff --git a/pypi_mobans/resources/templates/travis.yml.jj2 b/templates/travis.yml.jj2 similarity index 100% rename from pypi_mobans/resources/templates/travis.yml.jj2 rename to templates/travis.yml.jj2 From b4838dbbf942fd80fc43c8eb523b283b3b702c96 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 6 Aug 2018 23:20:15 +0100 Subject: [PATCH 11/34] :tractor: copying templates to pypi package --- local.yml | 2 +- .moban.yml => pypi-package/.moban.yml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) rename .moban.yml => pypi-package/.moban.yml (68%) diff --git a/local.yml b/local.yml index 9093a7e..f573463 100644 --- a/local.yml +++ b/local.yml @@ -1,7 +1,7 @@ configuration: configuration: config/data.yml template_dir: - - .moban.dt/ + - .moban.d/ - templates - ../sphinx-quickstart-templates targets: diff --git a/.moban.yml b/pypi-package/.moban.yml similarity index 68% rename from .moban.yml rename to pypi-package/.moban.yml index d9c71c3..0e409e4 100644 --- a/.moban.yml +++ b/pypi-package/.moban.yml @@ -1,8 +1,8 @@ configuration: template_dir: - - "mobans/templates" - - ".moban.d" - configuration: pypi-mobans.yml + - "../.moban.d" + - "../mobans/templates" + configuration: "../pypi-mobans.yml" targets: - README.rst: CUSTOM_README.rst.jj2 - setup.py: custom_setup.py.jj2 @@ -12,3 +12,6 @@ targets: - test.sh: test.script.jj2 - "pypi_mobans/_version.py": "_version.py.jj2" - .gitignore: gitignore.jj2 + - .travis.yml: travis.yml.jj2 +copy: + - "pypi_mobans/resources/templates": ../templates/** \ No newline at end of file From 03185a6ddc5418775157720ee8f61467164b58d3 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 6 Aug 2018 23:22:14 +0100 Subject: [PATCH 12/34] :art: minor update --- pypi-package/.moban.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pypi-package/.moban.yml b/pypi-package/.moban.yml index 0e409e4..a8fee9c 100644 --- a/pypi-package/.moban.yml +++ b/pypi-package/.moban.yml @@ -11,7 +11,5 @@ targets: - "docs/source/conf.py": "docs/source/conf.py.jj2" - test.sh: test.script.jj2 - "pypi_mobans/_version.py": "_version.py.jj2" - - .gitignore: gitignore.jj2 - - .travis.yml: travis.yml.jj2 copy: - - "pypi_mobans/resources/templates": ../templates/** \ No newline at end of file + - "pypi_mobans/resources/templates": ../templates/** From 8b8262f0a6c670eda518bdfa1b5c7f19bdc60002 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 6 Aug 2018 23:25:24 +0100 Subject: [PATCH 13/34] :bug: fix the reference --- local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local.yml b/local.yml index f573463..1454bd5 100644 --- a/local.yml +++ b/local.yml @@ -7,7 +7,7 @@ configuration: targets: - .gitignore: gitignore.jj2 - LICENSE: NEW_BSD_LICENSE.jj2 - - README.rst: local-README.rst.jj2 + - README.rst: CUSTOM_README.rst.jj2 copy: - templates/docs/Makefile.jj2: Makefile.new_t - templates/docs/make.bat.jj2: make.bat.new_t From 3425eebefcf9bda4ea6d89edd4d7fa41140531d1 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 11:49:10 +0100 Subject: [PATCH 14/34] :tractor: file reorgnisation --- .gitignore | 7 +++++++ {.moban.d => .moban.dt}/CUSTOM_README.rst.jj2 | 0 {.moban.d => .moban.dt}/custom_setup.py.jj2 | 0 {.moban.d => .moban.dt}/tests/custom_requirements.txt.jj2 | 0 README.rst | 3 ++- local.yml | 2 +- pypi-mobans.yml | 5 +++++ pypi-package/.moban.yml | 4 +++- {tests => pypi-package/tests}/requirements.txt | 0 9 files changed, 18 insertions(+), 3 deletions(-) rename {.moban.d => .moban.dt}/CUSTOM_README.rst.jj2 (100%) rename {.moban.d => .moban.dt}/custom_setup.py.jj2 (100%) rename {.moban.d => .moban.dt}/tests/custom_requirements.txt.jj2 (100%) rename {tests => pypi-package/tests}/requirements.txt (100%) diff --git a/.gitignore b/.gitignore index d09b336..d1c1f08 100644 --- a/.gitignore +++ b/.gitignore @@ -468,3 +468,10 @@ cscope.files cscope.out cscope.in.out cscope.po.out + +# pypi-mobans +mobans/ +pypi-package/README.rst +pypi-package/pypi_mobans/resources/ +pypi-package/test.sh + diff --git a/.moban.d/CUSTOM_README.rst.jj2 b/.moban.dt/CUSTOM_README.rst.jj2 similarity index 100% rename from .moban.d/CUSTOM_README.rst.jj2 rename to .moban.dt/CUSTOM_README.rst.jj2 diff --git a/.moban.d/custom_setup.py.jj2 b/.moban.dt/custom_setup.py.jj2 similarity index 100% rename from .moban.d/custom_setup.py.jj2 rename to .moban.dt/custom_setup.py.jj2 diff --git a/.moban.d/tests/custom_requirements.txt.jj2 b/.moban.dt/tests/custom_requirements.txt.jj2 similarity index 100% rename from .moban.d/tests/custom_requirements.txt.jj2 rename to .moban.dt/tests/custom_requirements.txt.jj2 diff --git a/README.rst b/README.rst index 0f0630a..1b9a87f 100644 --- a/README.rst +++ b/README.rst @@ -8,6 +8,8 @@ pypi-mobans .. image:: https://codecov.io/github/moremoban/pypi-mobans/coverage.png :target: https://codecov.io/github/moremoban/pypi-mobans +.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg + :target: https://gitter.im/chfw_moban/Lobby Scaffolding mobans for your Python project. @@ -42,7 +44,6 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans - $ python setup.py install Notes ================================================================================ diff --git a/local.yml b/local.yml index 1454bd5..c1ebd33 100644 --- a/local.yml +++ b/local.yml @@ -1,5 +1,5 @@ configuration: - configuration: config/data.yml + configuration: pypi-mobans.yml template_dir: - .moban.d/ - templates diff --git a/pypi-mobans.yml b/pypi-mobans.yml index 2c46ed2..b6e9202 100644 --- a/pypi-mobans.yml +++ b/pypi-mobans.yml @@ -11,3 +11,8 @@ license: public license dependencies: - lml description: "Scaffolding mobans for your Python project." +gitter_room: chfw_moban/Lobby +setup_py: false +rsrcdir: docs/source +rbuilddir: docs/_build +mastertocmaxdepth: 3 diff --git a/pypi-package/.moban.yml b/pypi-package/.moban.yml index a8fee9c..c927607 100644 --- a/pypi-package/.moban.yml +++ b/pypi-package/.moban.yml @@ -1,15 +1,17 @@ configuration: template_dir: - - "../.moban.d" + - "../.moban.dt" - "../mobans/templates" configuration: "../pypi-mobans.yml" targets: - README.rst: CUSTOM_README.rst.jj2 + - "../README.rst": CUSTOM_README.rst.jj2 - setup.py: custom_setup.py.jj2 - requirements.txt: requirements.txt.jj2 - "tests/requirements.txt": "tests/custom_requirements.txt.jj2" - "docs/source/conf.py": "docs/source/conf.py.jj2" - test.sh: test.script.jj2 - "pypi_mobans/_version.py": "_version.py.jj2" + copy: - "pypi_mobans/resources/templates": ../templates/** diff --git a/tests/requirements.txt b/pypi-package/tests/requirements.txt similarity index 100% rename from tests/requirements.txt rename to pypi-package/tests/requirements.txt From 084c325e1fdb3ae8f13574fd1fc56b5b8d7e9c2f Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 12:05:56 +0100 Subject: [PATCH 15/34] :hammer: further code refactoring --- .gitignore | 2 +- .moban.dt/CUSTOM_README.rst.jj2 | 4 ++++ .moban.dt/INDEX_README.rst.jj2 | 13 +++++++++++++ .moban.dt/pypi_gitignore.jj2 | 9 +++++++++ .moban.yml | 19 +++++++++++++++++++ LICENSE | 30 ++++++++++++++++++++++++++++++ README.rst | 11 +++++++++++ pypi-package/.moban.yml | 17 ----------------- local.yml => upstreaming.yml | 4 ---- 9 files changed, 87 insertions(+), 22 deletions(-) create mode 100644 .moban.dt/INDEX_README.rst.jj2 create mode 100644 .moban.dt/pypi_gitignore.jj2 create mode 100644 .moban.yml create mode 100644 LICENSE delete mode 100644 pypi-package/.moban.yml rename local.yml => upstreaming.yml (74%) diff --git a/.gitignore b/.gitignore index d1c1f08..78c43b0 100644 --- a/.gitignore +++ b/.gitignore @@ -469,9 +469,9 @@ cscope.out cscope.in.out cscope.po.out + # pypi-mobans mobans/ pypi-package/README.rst pypi-package/pypi_mobans/resources/ pypi-package/test.sh - diff --git a/.moban.dt/CUSTOM_README.rst.jj2 b/.moban.dt/CUSTOM_README.rst.jj2 index 5f9f034..cd1e8b3 100644 --- a/.moban.dt/CUSTOM_README.rst.jj2 +++ b/.moban.dt/CUSTOM_README.rst.jj2 @@ -10,6 +10,8 @@ Organisations using it: - `pyexcel `_. - `coala `_. +- `pyecharts `_. +- `echarts-maps `_. Features ================================================================================ @@ -29,6 +31,8 @@ setup.py {% endblock %} {% block bottom_block %} +{% block github_note %} +{% endblock %} Notes ================================================================================ diff --git a/.moban.dt/INDEX_README.rst.jj2 b/.moban.dt/INDEX_README.rst.jj2 new file mode 100644 index 0000000..11e18c3 --- /dev/null +++ b/.moban.dt/INDEX_README.rst.jj2 @@ -0,0 +1,13 @@ +{% extends "CUSTOM_README.rst.jj2" %} + +{% block github_note %} +File organisation +================================================================================ + +`mobans` lives in `templates` folder. python package lives in `pypi-package` +folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. + + +Everything else are meta data. + +{% endblock %} \ No newline at end of file diff --git a/.moban.dt/pypi_gitignore.jj2 b/.moban.dt/pypi_gitignore.jj2 new file mode 100644 index 0000000..8b9daf7 --- /dev/null +++ b/.moban.dt/pypi_gitignore.jj2 @@ -0,0 +1,9 @@ +{% extends "gitignore.jj2" %} + +{%block extra %} +# pypi-mobans +mobans/ +pypi-package/README.rst +pypi-package/pypi_mobans/resources/ +pypi-package/test.sh +{%endblock%} \ No newline at end of file diff --git a/.moban.yml b/.moban.yml new file mode 100644 index 0000000..5cd97a8 --- /dev/null +++ b/.moban.yml @@ -0,0 +1,19 @@ +configuration: + template_dir: + - ".moban.dt" + - "mobans/templates" + configuration: "pypi-mobans.yml" +targets: + - .gitignore: pypi_gitignore.jj2 + - LICENSE: NEW_BSD_LICENSE.jj2 + - README.rst: INDEX_README.rst.jj2 + - "pypi-package/README.rst": CUSTOM_README.rst.jj2 + - "pypi-package/LICENSE": NEW_BSD_LICENSE.jj2 + - "pypi-package/setup.py": custom_setup.py.jj2 + - "pypi-package/requirements.txt": requirements.txt.jj2 + - "pypi-package/tests/requirements.txt": "tests/custom_requirements.txt.jj2" + - "pypi-package/docs/source/conf.py": "docs/source/conf.py.jj2" + - "pypi-package/test.sh": test.script.jj2 + - "pypi-package/pypi_mobans/_version.py": "_version.py.jj2" +copy: + - "pypi-package/pypi_mobans/resources/templates": ../templates/** diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..917991b --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2018 by Onni Software Ltd. and its contributors +All rights reserved. + +Redistribution and use in source and binary forms of the software as well +as documentation, with or without modification, are permitted provided +that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of 'pypi-mobans' nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.rst b/README.rst index 1b9a87f..0fea657 100644 --- a/README.rst +++ b/README.rst @@ -18,6 +18,8 @@ Organisations using it: - `pyexcel `_. - `coala `_. +- `pyecharts `_. +- `echarts-maps `_. Features ================================================================================ @@ -45,6 +47,15 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans +File organisation +================================================================================ + +`mobans` lives in `templates` folder. python package lives in `pypi-package` +folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. + + +Everything else are meta data. + Notes ================================================================================ diff --git a/pypi-package/.moban.yml b/pypi-package/.moban.yml deleted file mode 100644 index c927607..0000000 --- a/pypi-package/.moban.yml +++ /dev/null @@ -1,17 +0,0 @@ -configuration: - template_dir: - - "../.moban.dt" - - "../mobans/templates" - configuration: "../pypi-mobans.yml" -targets: - - README.rst: CUSTOM_README.rst.jj2 - - "../README.rst": CUSTOM_README.rst.jj2 - - setup.py: custom_setup.py.jj2 - - requirements.txt: requirements.txt.jj2 - - "tests/requirements.txt": "tests/custom_requirements.txt.jj2" - - "docs/source/conf.py": "docs/source/conf.py.jj2" - - test.sh: test.script.jj2 - - "pypi_mobans/_version.py": "_version.py.jj2" - -copy: - - "pypi_mobans/resources/templates": ../templates/** diff --git a/local.yml b/upstreaming.yml similarity index 74% rename from local.yml rename to upstreaming.yml index c1ebd33..3102103 100644 --- a/local.yml +++ b/upstreaming.yml @@ -4,10 +4,6 @@ configuration: - .moban.d/ - templates - ../sphinx-quickstart-templates -targets: - - .gitignore: gitignore.jj2 - - LICENSE: NEW_BSD_LICENSE.jj2 - - README.rst: CUSTOM_README.rst.jj2 copy: - templates/docs/Makefile.jj2: Makefile.new_t - templates/docs/make.bat.jj2: make.bat.new_t From aad70e3e855840a95879e1a5fbafd075e5f175da Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 12:11:35 +0100 Subject: [PATCH 16/34] :tractor: relocate the moban file --- .moban.yml => mobanfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .moban.yml => mobanfile (100%) diff --git a/.moban.yml b/mobanfile similarity index 100% rename from .moban.yml rename to mobanfile From c6e714136b5a1325b26b31967c5086f467c04734 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 12:14:56 +0100 Subject: [PATCH 17/34] :art: minor update --- .moban.dt/INDEX_README.rst.jj2 | 7 ++++--- .travis.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.moban.dt/INDEX_README.rst.jj2 b/.moban.dt/INDEX_README.rst.jj2 index 11e18c3..e76edfd 100644 --- a/.moban.dt/INDEX_README.rst.jj2 +++ b/.moban.dt/INDEX_README.rst.jj2 @@ -1,13 +1,14 @@ {% extends "CUSTOM_README.rst.jj2" %} {% block github_note %} -File organisation +Maintenance ================================================================================ `mobans` lives in `templates` folder. python package lives in `pypi-package` folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. +Everything else are meta data. - -Everything else are meta data. +`moban -m mobanfile` will update all meta files including the files in +`pypi-package` {% endblock %} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 4f997c1..2cdcc3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ jobs: include: - stage: moban script: - - moban -m local.yml + - moban -m upstreaming.yml - git diff --exit-code stage: test From db2bbd668647f539736a1de27d0b6b3e95eee78e Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 18:56:10 +0100 Subject: [PATCH 18/34] :fire: make pypi-package an independent repo --- .gitignore | 1 + .moban.dt/CUSTOM_README.rst.jj2 | 53 ------ .moban.dt/pypi_gitignore.jj2 | 1 + .moban.dt/tests/custom_requirements.txt.jj2 | 4 - CHANGELOG.rst | 11 +- README.rst | 9 +- changelog.yml | 11 ++ mobanfile | 15 +- pypi-package/LICENSE | 30 ---- pypi-package/MANIFEST.in | 7 - pypi-package/Makefile | 7 - pypi-package/docs/source/conf.py | 182 -------------------- pypi-package/pypi_mobans/__init__.py | 13 -- pypi-package/pypi_mobans/_version.py | 2 - pypi-package/requirements.txt | 1 - pypi-package/setup.cfg | 2 - pypi-package/setup.py | 180 ------------------- pypi-package/tests/requirements.txt | 5 - upstreaming.yml | 2 +- 19 files changed, 33 insertions(+), 503 deletions(-) delete mode 100644 .moban.dt/CUSTOM_README.rst.jj2 delete mode 100644 .moban.dt/tests/custom_requirements.txt.jj2 create mode 100644 changelog.yml delete mode 100644 pypi-package/LICENSE delete mode 100644 pypi-package/MANIFEST.in delete mode 100644 pypi-package/Makefile delete mode 100644 pypi-package/docs/source/conf.py delete mode 100644 pypi-package/pypi_mobans/__init__.py delete mode 100644 pypi-package/pypi_mobans/_version.py delete mode 100644 pypi-package/requirements.txt delete mode 100644 pypi-package/setup.cfg delete mode 100644 pypi-package/setup.py delete mode 100644 pypi-package/tests/requirements.txt diff --git a/.gitignore b/.gitignore index 78c43b0..40da365 100644 --- a/.gitignore +++ b/.gitignore @@ -475,3 +475,4 @@ mobans/ pypi-package/README.rst pypi-package/pypi_mobans/resources/ pypi-package/test.sh +pypi-package/CHANGELOG.rst diff --git a/.moban.dt/CUSTOM_README.rst.jj2 b/.moban.dt/CUSTOM_README.rst.jj2 deleted file mode 100644 index cd1e8b3..0000000 --- a/.moban.dt/CUSTOM_README.rst.jj2 +++ /dev/null @@ -1,53 +0,0 @@ -{% extends 'README.rst.jj2' %} - -{% block documentation_link %} -{% endblock %} - -{% block features %} -{{description}} -It is used with `yehua `_. -Organisations using it: - -- `pyexcel `_. -- `coala `_. -- `pyecharts `_. -- `echarts-maps `_. - -Features -================================================================================ - -setup.py ----------- - -1. flake8 compliant setup.py - -2. feature parity with `kennethreitz/setup.py `_ - - - automatically upload to pypi without using twine - - - automatically do git release while uploading to pypi - -3. configured to build universial wheels by default -{% endblock %} - -{% block bottom_block %} -{% block github_note %} -{% endblock %} -Notes -================================================================================ - - -In order to run, `python setup.py publish`, you will have setup `.pypirc` in -your home folder as:: - - [distutils] - index-servers = - pypi - - [pypi] - username=your_name - password=your_password - - -And you need to configure `gease`. -{% endblock %} diff --git a/.moban.dt/pypi_gitignore.jj2 b/.moban.dt/pypi_gitignore.jj2 index 8b9daf7..4e83b71 100644 --- a/.moban.dt/pypi_gitignore.jj2 +++ b/.moban.dt/pypi_gitignore.jj2 @@ -6,4 +6,5 @@ mobans/ pypi-package/README.rst pypi-package/pypi_mobans/resources/ pypi-package/test.sh +pypi-package/CHANGELOG.rst {%endblock%} \ No newline at end of file diff --git a/.moban.dt/tests/custom_requirements.txt.jj2 b/.moban.dt/tests/custom_requirements.txt.jj2 deleted file mode 100644 index a22fe7e..0000000 --- a/.moban.dt/tests/custom_requirements.txt.jj2 +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "tests/requirements.txt.jj2" %} - -{%block extras %} -{%endblock%} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7398c8c..b4c0c69 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,2 +1,11 @@ Change log -=========== +================================================================================ + +0.0.1 - unreleased +-------------------------------------------------------------------------------- + +First release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. use pypi as pacakge distribution source +#. versioning is applied diff --git a/README.rst b/README.rst index 0fea657..3b25ea4 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ pypi-mobans :target: https://gitter.im/chfw_moban/Lobby -Scaffolding mobans for your Python project. +Scaffolding templates for your Python project. It is used with `yehua `_. Organisations using it: @@ -47,14 +47,15 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans -File organisation +Maintenance ================================================================================ `mobans` lives in `templates` folder. python package lives in `pypi-package` folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. +Everything else are meta data. - -Everything else are meta data. +`moban -m mobanfile` will update all meta files including the files in +`pypi-package` Notes ================================================================================ diff --git a/changelog.yml b/changelog.yml new file mode 100644 index 0000000..ff164ca --- /dev/null +++ b/changelog.yml @@ -0,0 +1,11 @@ +name: "pypi-mobans" +organisation: moremoban +releases: +- changes: + - action: First release + details: + - use pypi as pacakge distribution source + - versioning is applied + date: unreleased + version: 0.0.1 + diff --git a/mobanfile b/mobanfile index 5cd97a8..56a1378 100644 --- a/mobanfile +++ b/mobanfile @@ -2,18 +2,11 @@ configuration: template_dir: - ".moban.dt" - "mobans/templates" - configuration: "pypi-mobans.yml" + configuration: config/data.yml targets: - .gitignore: pypi_gitignore.jj2 - LICENSE: NEW_BSD_LICENSE.jj2 - README.rst: INDEX_README.rst.jj2 - - "pypi-package/README.rst": CUSTOM_README.rst.jj2 - - "pypi-package/LICENSE": NEW_BSD_LICENSE.jj2 - - "pypi-package/setup.py": custom_setup.py.jj2 - - "pypi-package/requirements.txt": requirements.txt.jj2 - - "pypi-package/tests/requirements.txt": "tests/custom_requirements.txt.jj2" - - "pypi-package/docs/source/conf.py": "docs/source/conf.py.jj2" - - "pypi-package/test.sh": test.script.jj2 - - "pypi-package/pypi_mobans/_version.py": "_version.py.jj2" -copy: - - "pypi-package/pypi_mobans/resources/templates": ../templates/** + - output: CHANGELOG.rst + configuration: changelog.yml + template: CHANGELOG.rst.jj2 diff --git a/pypi-package/LICENSE b/pypi-package/LICENSE deleted file mode 100644 index 917991b..0000000 --- a/pypi-package/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2018 by Onni Software Ltd. and its contributors -All rights reserved. - -Redistribution and use in source and binary forms of the software as well -as documentation, with or without modification, are permitted provided -that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of 'pypi-mobans' nor the names of the contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. diff --git a/pypi-package/MANIFEST.in b/pypi-package/MANIFEST.in deleted file mode 100644 index 6f4b487..0000000 --- a/pypi-package/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include README.rst -include CHANGELOG.rst -include pypi_mobans/resources/templates/* -recursive-include pypi_mobans/resources/templates/gitignore *.* -include pypi_mobans/resources/templates/docs/* -include pypi_mobans/resources/templates/tests/* -include pypi_mobans/resources/config/* diff --git a/pypi-package/Makefile b/pypi-package/Makefile deleted file mode 100644 index 26d9b68..0000000 --- a/pypi-package/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: test - -test: - bash test.sh - -document: - bash document.sh diff --git a/pypi-package/docs/source/conf.py b/pypi-package/docs/source/conf.py deleted file mode 100644 index 4515b50..0000000 --- a/pypi-package/docs/source/conf.py +++ /dev/null @@ -1,182 +0,0 @@ -# -*- coding: utf-8 -*- -DESCRIPTION = ( - 'Scaffolding mobans for your Python project.' + - '' -) -# -*- coding: utf-8 -*- -# -# Configuration file for the Sphinx documentation builder. -# -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - -# -- Project information ----------------------------------------------------- - -project = u'pypi-mobans' -copyright = u'2018 Onni Software Ltd.' -author = u'C.W.' - -# The short X.Y version -version = u'0.0.0' -# The full version, including alpha/beta/rc tags -release = u'0.0.1' - - -# -- General configuration --------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. -# -# html_sidebars = {} - - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'pypi-mobansdoc' - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'pypi-mobans.tex', u'pypi-mobans Documentation', - u'Onni Software Ltd.', 'manual'), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'pypi-mobans', u'pypi-mobans Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'pypi-mobans', u'pypi-mobans Documentation', - author, 'pypi-mobans', 'One line description of project.', - 'Miscellaneous'), -] - -# -- Extension configuration ------------------------------------------------- -# -- Options for intersphinx extension --------------------------------------- - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/': None} -# TODO: html_theme not configurable upstream -html_theme = 'default' - -# TODO: DESCRIPTION not configurable upstream -texinfo_documents = [ - ('index', 'pypi-mobans', - 'pypi-mobans Documentation', - 'Onni Software Ltd.', 'pypi-mobans', - DESCRIPTION, - 'Miscellaneous'), -] -intersphinx_mapping.update({ -}) diff --git a/pypi-package/pypi_mobans/__init__.py b/pypi-package/pypi_mobans/__init__.py deleted file mode 100644 index d1760f0..0000000 --- a/pypi-package/pypi_mobans/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# flake8: noqa -import os -from pypi_mobans._version import __version__ -from pypi_mobans._version import __author__ -from lml.plugin import PluginInfo - - -@PluginInfo('library', tags=['setupmobans', 'pypi', 'pypimobans']) -class Pypkg(): - def __init__(self): - __package_path__ = os.path.dirname(__file__) - self.resources_path = os.path.join( - __package_path__, "resources") diff --git a/pypi-package/pypi_mobans/_version.py b/pypi-package/pypi_mobans/_version.py deleted file mode 100644 index bade78b..0000000 --- a/pypi-package/pypi_mobans/_version.py +++ /dev/null @@ -1,2 +0,0 @@ -__version__ = "0.0.1" -__author__ = "C.W." diff --git a/pypi-package/requirements.txt b/pypi-package/requirements.txt deleted file mode 100644 index 87bedb6..0000000 --- a/pypi-package/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -lml diff --git a/pypi-package/setup.cfg b/pypi-package/setup.cfg deleted file mode 100644 index 2a9acf1..0000000 --- a/pypi-package/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 1 diff --git a/pypi-package/setup.py b/pypi-package/setup.py deleted file mode 100644 index c7c53d3..0000000 --- a/pypi-package/setup.py +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env python3 - -# Template by pypi-mobans -import os -import sys -import codecs -from shutil import rmtree -from setuptools import setup, find_packages, Command -from platform import python_implementation -PY2 = sys.version_info[0] == 2 -PY26 = PY2 and sys.version_info[1] < 7 - -NAME = 'pypi-mobans' -AUTHOR = 'C.W.' -VERSION = '0.0.1' -EMAIL = 'wangc_2011@hotmail.com' -LICENSE = 'public license' -DESCRIPTION = ( - 'Scaffolding mobans for your Python project.' -) -URL = 'https://github.com/moremoban/pypi-mobans' -DOWNLOAD_URL = '%s/archive/0.0.0.tar.gz' % URL -FILES = ['README.rst', 'CHANGELOG.rst'] -KEYWORDS = [ - 'python' -] - -CLASSIFIERS = [ - 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python', - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', -] - -INSTALL_REQUIRES = [ - 'lml', -] -SETUP_COMMANDS = {} - - -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) -EXTRAS_REQUIRE = { -} -# You do not need to read beyond this line -PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( - sys.executable) -GS_COMMAND = ('gs pypi-mobans v0.0.0 ' + - "Find 0.0.0 in changelog for more details") -NO_GS_MESSAGE = ('Automatic github release is disabled. ' + - 'Please install gease to enable it.') -UPLOAD_FAILED_MSG = ( - 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND) -HERE = os.path.abspath(os.path.dirname(__file__)) - - -class PublishCommand(Command): - """Support setup.py upload.""" - - description = 'Build and publish the package on github and pypi' - user_options = [] - - @staticmethod - def status(s): - """Prints things in bold.""" - print('\033[1m{0}\033[0m'.format(s)) - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - try: - self.status('Removing previous builds...') - rmtree(os.path.join(HERE, 'dist')) - rmtree(os.path.join(HERE, 'build')) - rmtree(os.path.join(HERE, 'pypi_mobans.egg-info')) - except OSError: - pass - - self.status('Building Source and Wheel (universal) distribution...') - run_status = True - if has_gease(): - run_status = os.system(GS_COMMAND) == 0 - else: - self.status(NO_GS_MESSAGE) - if run_status: - if os.system(PUBLISH_COMMAND) != 0: - self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND) - - sys.exit() - - -SETUP_COMMANDS.update({ - 'publish': PublishCommand -}) - - -def has_gease(): - """ - test if github release command is installed - - visit http://github.com/moremoban/gease for more info - """ - try: - import gease # noqa - return True - except ImportError: - return False - - -def read_files(*files): - """Read files into setup""" - text = "" - for single_file in files: - content = read(single_file) - text = text + content + "\n" - return text - - -def read(afile): - """Read a file into setup""" - the_relative_file = os.path.join(HERE, afile) - with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file: - content = filter_out_test_code(opened_file) - content = "".join(list(content)) - return content - - -def filter_out_test_code(file_handle): - found_test_code = False - for line in file_handle.readlines(): - if line.startswith('.. testcode:'): - found_test_code = True - continue - if found_test_code is True: - if line.startswith(' '): - continue - else: - empty_line = line.strip() - if len(empty_line) == 0: - continue - else: - found_test_code = False - yield line - else: - for keyword in ['|version|', '|today|']: - if keyword in line: - break - else: - yield line - - -if __name__ == '__main__': - setup( - name=NAME, - author=AUTHOR, - version=VERSION, - author_email=EMAIL, - description=DESCRIPTION, - url=URL, - download_url=DOWNLOAD_URL, - long_description=read_files(*FILES), - license=LICENSE, - keywords=KEYWORDS, - extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], - install_requires=INSTALL_REQUIRES, - packages=PACKAGES, - include_package_data=True, - zip_safe=False, - classifiers=CLASSIFIERS, - cmdclass=SETUP_COMMANDS - ) diff --git a/pypi-package/tests/requirements.txt b/pypi-package/tests/requirements.txt deleted file mode 100644 index c445df5..0000000 --- a/pypi-package/tests/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -nose -mock -codecov -coverage -flake8 diff --git a/upstreaming.yml b/upstreaming.yml index 3102103..918142e 100644 --- a/upstreaming.yml +++ b/upstreaming.yml @@ -1,7 +1,7 @@ configuration: configuration: pypi-mobans.yml template_dir: - - .moban.d/ + - .moban.dt/ - templates - ../sphinx-quickstart-templates copy: From 26b0871cc4f7e91f62e350be9f91a92d188eccc4 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 19:03:25 +0100 Subject: [PATCH 19/34] :art: custom update --- .moban.dt/INDEX_README.rst.jj2 | 56 +++++++++++++++++++++++++++++----- README.rst | 10 ------ 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/.moban.dt/INDEX_README.rst.jj2 b/.moban.dt/INDEX_README.rst.jj2 index e76edfd..fc90063 100644 --- a/.moban.dt/INDEX_README.rst.jj2 +++ b/.moban.dt/INDEX_README.rst.jj2 @@ -1,14 +1,54 @@ -{% extends "CUSTOM_README.rst.jj2" %} +{% extends 'README.rst.jj2' %} +{% block documentation_link %} +{% endblock %} + +{% block features %} +{{description}} +It is used with `yehua `_. +Organisations using it: + +- `pyexcel `_. +- `coala `_. +- `pyecharts `_. +- `echarts-maps `_. + +Features +================================================================================ + +setup.py +---------- + +1. flake8 compliant setup.py + +2. feature parity with `kennethreitz/setup.py `_ + + - automatically upload to pypi without using twine + + - automatically do git release while uploading to pypi + +3. configured to build universial wheels by default +{% endblock %} + +{% block bottom_block %} {% block github_note %} -Maintenance +{% endblock %} +Notes ================================================================================ -`mobans` lives in `templates` folder. python package lives in `pypi-package` -folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. -Everything else are meta data. -`moban -m mobanfile` will update all meta files including the files in -`pypi-package` +In order to run, `python setup.py publish`, you will have setup `.pypirc` in +your home folder as:: + + [distutils] + index-servers = + pypi + + [pypi] + username=your_name + password=your_password + + +And you need to configure `gease`. +{% endblock %} -{% endblock %} \ No newline at end of file diff --git a/README.rst b/README.rst index 3b25ea4..d026db9 100644 --- a/README.rst +++ b/README.rst @@ -47,16 +47,6 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans -Maintenance -================================================================================ - -`mobans` lives in `templates` folder. python package lives in `pypi-package` -folder. `upstreaming.yml` is used to upstream sphinx templates into pypi-mobans. -Everything else are meta data. - -`moban -m mobanfile` will update all meta files including the files in -`pypi-package` - Notes ================================================================================ From 3648e8f82e35c3ea95c1f7f9759bdff4c9c5bcf8 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 19:05:17 +0100 Subject: [PATCH 20/34] :hammer: revert the changes --- .moban.dt/{INDEX_README.rst.jj2 => local-README.rst.jj2} | 0 mobanfile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .moban.dt/{INDEX_README.rst.jj2 => local-README.rst.jj2} (100%) diff --git a/.moban.dt/INDEX_README.rst.jj2 b/.moban.dt/local-README.rst.jj2 similarity index 100% rename from .moban.dt/INDEX_README.rst.jj2 rename to .moban.dt/local-README.rst.jj2 diff --git a/mobanfile b/mobanfile index 56a1378..e9858b7 100644 --- a/mobanfile +++ b/mobanfile @@ -6,7 +6,7 @@ configuration: targets: - .gitignore: pypi_gitignore.jj2 - LICENSE: NEW_BSD_LICENSE.jj2 - - README.rst: INDEX_README.rst.jj2 + - README.rst: local-README.rst.jj2 - output: CHANGELOG.rst configuration: changelog.yml template: CHANGELOG.rst.jj2 From 90ec4088f81d68098ea7093f95ac38848b0a7158 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 20:08:11 +0100 Subject: [PATCH 21/34] :fire: getting rid the traces pypi-package --- .gitignore | 8 -------- .moban.dt/custom_setup.py.jj2 | 1 - .moban.dt/pypi_gitignore.jj2 | 10 ---------- mobanfile | 2 +- pypi-mobans.yml | 18 ------------------ test.sh | 2 -- 6 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 .moban.dt/custom_setup.py.jj2 delete mode 100644 .moban.dt/pypi_gitignore.jj2 delete mode 100644 pypi-mobans.yml delete mode 100644 test.sh diff --git a/.gitignore b/.gitignore index 40da365..d09b336 100644 --- a/.gitignore +++ b/.gitignore @@ -468,11 +468,3 @@ cscope.files cscope.out cscope.in.out cscope.po.out - - -# pypi-mobans -mobans/ -pypi-package/README.rst -pypi-package/pypi_mobans/resources/ -pypi-package/test.sh -pypi-package/CHANGELOG.rst diff --git a/.moban.dt/custom_setup.py.jj2 b/.moban.dt/custom_setup.py.jj2 deleted file mode 100644 index 2f700ec..0000000 --- a/.moban.dt/custom_setup.py.jj2 +++ /dev/null @@ -1 +0,0 @@ -{% extends "setup.py.jj2" %} diff --git a/.moban.dt/pypi_gitignore.jj2 b/.moban.dt/pypi_gitignore.jj2 deleted file mode 100644 index 4e83b71..0000000 --- a/.moban.dt/pypi_gitignore.jj2 +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "gitignore.jj2" %} - -{%block extra %} -# pypi-mobans -mobans/ -pypi-package/README.rst -pypi-package/pypi_mobans/resources/ -pypi-package/test.sh -pypi-package/CHANGELOG.rst -{%endblock%} \ No newline at end of file diff --git a/mobanfile b/mobanfile index e9858b7..5cd66bf 100644 --- a/mobanfile +++ b/mobanfile @@ -4,7 +4,7 @@ configuration: - "mobans/templates" configuration: config/data.yml targets: - - .gitignore: pypi_gitignore.jj2 + - .gitignore: gitignore.jj2 - LICENSE: NEW_BSD_LICENSE.jj2 - README.rst: local-README.rst.jj2 - output: CHANGELOG.rst diff --git a/pypi-mobans.yml b/pypi-mobans.yml deleted file mode 100644 index b6e9202..0000000 --- a/pypi-mobans.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "pypi-mobans" -organisation: "moremoban" -author: "C.W." -contact: "wangc_2011@hotmail.com" -company: "Onni Software Ltd." -version: "0.0.1" -current_version: "0.0.1" -release: "0.0.0" -copyright_year: 2018 -license: public license -dependencies: - - lml -description: "Scaffolding mobans for your Python project." -gitter_room: chfw_moban/Lobby -setup_py: false -rsrcdir: docs/source -rbuilddir: docs/_build -mastertocmaxdepth: 3 diff --git a/test.sh b/test.sh deleted file mode 100644 index bfb24c1..0000000 --- a/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -pip freeze -nosetests --with-coverage --cover-package pypi_mobans --cover-package tests tests docs/source pypi_mobans && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long From 856b7ad6f264fe10295929fd108886bf3151ec89 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 20:09:23 +0100 Subject: [PATCH 22/34] :fire: getting rid the traces pypi-package --- upstreaming.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstreaming.yml b/upstreaming.yml index 918142e..9993a36 100644 --- a/upstreaming.yml +++ b/upstreaming.yml @@ -1,5 +1,5 @@ configuration: - configuration: pypi-mobans.yml + configuration: config/data.yml template_dir: - .moban.dt/ - templates From c1751d3314f1bf6e66e014c4d4998431b6055d94 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 22:56:21 +0100 Subject: [PATCH 23/34] :green_heart: pass staging test --- templates/docs/conf.py_t | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/templates/docs/conf.py_t b/templates/docs/conf.py_t index b16fd08..79c78ae 100644 --- a/templates/docs/conf.py_t +++ b/templates/docs/conf.py_t @@ -48,9 +48,9 @@ release = u'{{ release_str }}' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ -{% for ext in extensions %} +{%- for ext in extensions %} '{{ ext }}', -{% endfor %} +{%- endfor %} ] # Add any paths that contain templates here, relative to this directory. @@ -70,7 +70,7 @@ master_doc = '{{ master_str }}' # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = '{{ language }}' +language = {{ language | repr }} # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -165,16 +165,12 @@ texinfo_documents = [ author, '{{ project_fn }}', 'One line description of project.', 'Miscellaneous'), ] -{%- if epub %} # -- Options for Epub output ------------------------------------------------- # Bibliographic Dublin Core info. epub_title = project -epub_author = author -epub_publisher = author -epub_copyright = copyright # The unique identifier of the text. This can be a ISBN number # or the project homepage. @@ -187,7 +183,6 @@ epub_copyright = copyright # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] -{%- endif %} {%- if extensions %} From 00ab31f7bd471204fdf7f154d34d86faf897c156 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 7 Aug 2018 22:56:46 +0100 Subject: [PATCH 24/34] :fire: remove useless additions --- .moban.dt/local-README.rst.jj2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.moban.dt/local-README.rst.jj2 b/.moban.dt/local-README.rst.jj2 index fc90063..f37540b 100644 --- a/.moban.dt/local-README.rst.jj2 +++ b/.moban.dt/local-README.rst.jj2 @@ -31,8 +31,6 @@ setup.py {% endblock %} {% block bottom_block %} -{% block github_note %} -{% endblock %} Notes ================================================================================ From e7e07efcc092fda7b909d17ce5b12edeeae3dfcb Mon Sep 17 00:00:00 2001 From: chfw Date: Thu, 16 Aug 2018 07:34:09 +0100 Subject: [PATCH 25/34] :bug: fix missing comma in keywords, fix #8 --- templates/setup.py.jj2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/setup.py.jj2 b/templates/setup.py.jj2 index a2233f9..9e23ed5 100644 --- a/templates/setup.py.jj2 +++ b/templates/setup.py.jj2 @@ -64,12 +64,12 @@ URL = 'https://{{scm_host}}/{{organisation}}/{{name}}' DOWNLOAD_URL = '%s/archive/{{release}}.tar.gz' % URL FILES = ['README.rst',{%block morefiles %}{%endblock%} 'CHANGELOG.rst'] KEYWORDS = [ + 'python', {% for keyword in keywords %} '{{keyword}}', {% endfor %} {%block additional_keywords%} {%endblock%} - 'python' ] CLASSIFIERS = [ From 3569fe062db0131699c9cf31f1b6774d079e9a0a Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 4 Nov 2018 10:22:18 +0000 Subject: [PATCH 26/34] :sparkles: update documentation. add make command for do local update --- .moban.dt/local-README.rst.jj2 | 16 ++++++++++++---- Makefile | 4 ++++ README.rst | 16 ++++++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/.moban.dt/local-README.rst.jj2 b/.moban.dt/local-README.rst.jj2 index f37540b..0e4f2f7 100644 --- a/.moban.dt/local-README.rst.jj2 +++ b/.moban.dt/local-README.rst.jj2 @@ -8,10 +8,10 @@ It is used with `yehua `_. Organisations using it: -- `pyexcel `_. -- `coala `_. -- `pyecharts `_. -- `echarts-maps `_. +- `pyexcel mobans `_. +- `coala mobans`_. +- `pyecharts pypkg mobans `. +- `echarts maps mobans `. Features ================================================================================ @@ -31,6 +31,14 @@ setup.py {% endblock %} {% block bottom_block %} +Development process +================================================================================ + +Please fork and make pull request to **dev** branch. Per each release, dev branch +will be merge into master branch. + +In order to make moban updates: please call `make`. + Notes ================================================================================ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8cd6648 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +all: upstreaming + +upstreaming: + moban -m upstreaming.yml diff --git a/README.rst b/README.rst index d026db9..0c4b662 100644 --- a/README.rst +++ b/README.rst @@ -16,10 +16,10 @@ Scaffolding templates for your Python project. It is used with `yehua `_. Organisations using it: -- `pyexcel `_. -- `coala `_. -- `pyecharts `_. -- `echarts-maps `_. +- `pyexcel mobans `_. +- `coala mobans`_. +- `pyecharts pypkg mobans `. +- `echarts maps mobans `. Features ================================================================================ @@ -47,6 +47,14 @@ You can get it: $ git clone https://github.com/moremoban/pypi-mobans.git $ cd pypi-mobans +Development process +================================================================================ + +Please fork and make pull request to **dev** branch. Per each release, dev branch +will be merge into master branch. + +In order to make moban updates: please call `make`. + Notes ================================================================================ From 32c78412c5799cfa49f0ccdcc25fc61f8a6c8da6 Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 4 Nov 2018 10:27:33 +0000 Subject: [PATCH 27/34] :fire: merging upstream.yml(previously known as loca.yml) into mobanfile --- .travis.yml | 2 +- Makefile | 2 +- mobanfile | 15 ++++++++++++--- upstreaming.yml | 17 ----------------- 4 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 upstreaming.yml diff --git a/.travis.yml b/.travis.yml index 6d06eb2..b43736a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ jobs: include: - stage: moban script: - - moban -m upstreaming.yml + - make - git diff --exit-code stage: test diff --git a/Makefile b/Makefile index 8cd6648..05e1375 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ all: upstreaming upstreaming: - moban -m upstreaming.yml + moban -m mobanfile diff --git a/mobanfile b/mobanfile index 5cd66bf..bcfa3d3 100644 --- a/mobanfile +++ b/mobanfile @@ -1,8 +1,12 @@ +requires: + - https://github.com/sphinx-doc/sphinx configuration: - template_dir: - - ".moban.dt" - - "mobans/templates" configuration: config/data.yml + template_dir: + - ".moban.dt" + - "mobans/templates" + - templates + - sphinx:sphinx/templates/quickstart targets: - .gitignore: gitignore.jj2 - LICENSE: NEW_BSD_LICENSE.jj2 @@ -10,3 +14,8 @@ targets: - output: CHANGELOG.rst configuration: changelog.yml template: CHANGELOG.rst.jj2 +copy: + - templates/docs/Makefile.jj2: Makefile.new_t + - templates/docs/make.bat.jj2: make.bat.new_t + - templates/docs/master_doc.rst_t: master_doc.rst_t + - templates/docs/conf.py_t: conf.py_t diff --git a/upstreaming.yml b/upstreaming.yml deleted file mode 100644 index 3f4dabd..0000000 --- a/upstreaming.yml +++ /dev/null @@ -1,17 +0,0 @@ -requires: - - https://github.com/sphinx-doc/sphinx -configuration: - configuration: config/data.yml - template_dir: - - .moban.dt/ - - templates - - sphinx:sphinx/templates/quickstart -targets: - - .gitignore: gitignore.jj2 - - LICENSE: NEW_BSD_LICENSE.jj2 - - README.rst: local-README.rst.jj2 -copy: - - templates/docs/Makefile.jj2: Makefile.new_t - - templates/docs/make.bat.jj2: make.bat.new_t - - templates/docs/master_doc.rst_t: master_doc.rst_t - - templates/docs/conf.py_t: conf.py_t From cec4e608156f1633f42fae903cf177443ccb81cc Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 4 Nov 2018 10:31:25 +0000 Subject: [PATCH 28/34] :green_heart: fix moban build --- mobanfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mobanfile b/mobanfile index bcfa3d3..d67b49f 100644 --- a/mobanfile +++ b/mobanfile @@ -3,8 +3,7 @@ requires: configuration: configuration: config/data.yml template_dir: - - ".moban.dt" - - "mobans/templates" + - .moban.dt - templates - sphinx:sphinx/templates/quickstart targets: From 6df92dc1911ec9c20a4511af9f3224f09c60803d Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 4 Nov 2018 21:52:17 +0000 Subject: [PATCH 29/34] :sparkles: sort the import list and add spaces --- templates/setup.py.jj2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/setup.py.jj2 b/templates/setup.py.jj2 index 6606aa7..bf944ba 100644 --- a/templates/setup.py.jj2 +++ b/templates/setup.py.jj2 @@ -15,7 +15,9 @@ from shutil import rmtree {% if external_module_library %} from distutils.core import setup, Extension {% else %} -from setuptools import setup, find_packages, Command + +from setuptools import Command, setup, find_packages + {%endif%} {%block platform_block%} from platform import python_implementation From 36373a1346e8da757a490aa2df04f4516854aecf Mon Sep 17 00:00:00 2001 From: chfw Date: Sun, 4 Nov 2018 21:56:42 +0000 Subject: [PATCH 30/34] :gem: 0.0.1 version release --- CHANGELOG.rst | 2 +- changelog.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b4c0c69..94b3fbe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,7 +1,7 @@ Change log ================================================================================ -0.0.1 - unreleased +0.0.1 - 04.11.2018 -------------------------------------------------------------------------------- First release diff --git a/changelog.yml b/changelog.yml index ff164ca..bb572cb 100644 --- a/changelog.yml +++ b/changelog.yml @@ -6,6 +6,6 @@ releases: details: - use pypi as pacakge distribution source - versioning is applied - date: unreleased + date: 04.11.2018 version: 0.0.1 From cfb60d50f9f38b7ffc69cb53f5112dafb50e6caa Mon Sep 17 00:00:00 2001 From: "ayanbn7@gmail.com" Date: Tue, 6 Nov 2018 01:51:34 +0530 Subject: [PATCH 31/34] setup.py.jj2: Allow comments in requirements.txt Closes https://github.com/moremoban/pypi-mobans/issues/37 --- templates/setup.py.jj2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/setup.py.jj2 b/templates/setup.py.jj2 index 87658e9..a3cf689 100644 --- a/templates/setup.py.jj2 +++ b/templates/setup.py.jj2 @@ -111,7 +111,7 @@ if python_implementation == "PyPy": {%- endmacro %} INSTALL_REQUIRES = [ {% for dependency in dependencies: %} - {% if ';' not in dependency: %} + {% if ';' not in dependency and not dependency.startswith('#'): %} '{{dependency}}', {% endif %} {% endfor %} From 825fc08af2c993673030163e901dccb1b26cfd01 Mon Sep 17 00:00:00 2001 From: chfw Date: Mon, 5 Nov 2018 21:42:14 +0000 Subject: [PATCH 32/34] :books: update change log --- CHANGELOG.rst | 4 ++-- changelog.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 94b3fbe..6c80a50 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,11 +1,11 @@ Change log ================================================================================ -0.0.1 - 04.11.2018 +0.0.1 - 05.11.2018 -------------------------------------------------------------------------------- First release ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -#. use pypi as pacakge distribution source #. versioning is applied +#. Pipfile included diff --git a/changelog.yml b/changelog.yml index bb572cb..c5f2dfe 100644 --- a/changelog.yml +++ b/changelog.yml @@ -4,8 +4,8 @@ releases: - changes: - action: First release details: - - use pypi as pacakge distribution source - versioning is applied - date: 04.11.2018 + - Pipfile included + date: 05.11.2018 version: 0.0.1 From 34266932008bf34dfb8b551f02e8271ff524110d Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 6 Nov 2018 07:23:13 +0000 Subject: [PATCH 33/34] :books: address review comments --- .moban.dt/local-README.rst.jj2 | 8 ++++---- README.rst | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.moban.dt/local-README.rst.jj2 b/.moban.dt/local-README.rst.jj2 index 0e4f2f7..8d6d33d 100644 --- a/.moban.dt/local-README.rst.jj2 +++ b/.moban.dt/local-README.rst.jj2 @@ -9,9 +9,9 @@ It is used with `yehua `_. Organisations using it: - `pyexcel mobans `_. -- `coala mobans`_. -- `pyecharts pypkg mobans `. -- `echarts maps mobans `. +- `coala mobans `_. +- `pyecharts pypkg mobans `_. +- `echarts maps mobans `_. Features ================================================================================ @@ -35,7 +35,7 @@ Development process ================================================================================ Please fork and make pull request to **dev** branch. Per each release, dev branch -will be merge into master branch. +will be merged into master branch. In order to make moban updates: please call `make`. diff --git a/README.rst b/README.rst index 0c4b662..8977d70 100644 --- a/README.rst +++ b/README.rst @@ -17,9 +17,9 @@ It is used with `yehua `_. Organisations using it: - `pyexcel mobans `_. -- `coala mobans`_. -- `pyecharts pypkg mobans `. -- `echarts maps mobans `. +- `coala mobans `_. +- `pyecharts pypkg mobans `_. +- `echarts maps mobans `_. Features ================================================================================ @@ -51,7 +51,7 @@ Development process ================================================================================ Please fork and make pull request to **dev** branch. Per each release, dev branch -will be merge into master branch. +will be merged into master branch. In order to make moban updates: please call `make`. From 9635dda441f4f601c35b31c8a18ddbd98385dfc5 Mon Sep 17 00:00:00 2001 From: "ayanbn7@gmail.com" Date: Thu, 8 Nov 2018 01:57:09 +0530 Subject: [PATCH 34/34] setup.py.jj2: Allow comments in requirements.txt Closes https://github.com/moremoban/pypi-mobans/issues/37 --- .moban.dt/local-README.rst.jj2 | 4 ++++ README.rst | 4 ++++ templates/setup.py.jj2 | 13 +++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.moban.dt/local-README.rst.jj2 b/.moban.dt/local-README.rst.jj2 index 8d6d33d..5c85e09 100644 --- a/.moban.dt/local-README.rst.jj2 +++ b/.moban.dt/local-README.rst.jj2 @@ -28,6 +28,10 @@ setup.py - automatically do git release while uploading to pypi 3. configured to build universial wheels by default + +4. comes with a feature of removing comments from requirements.txt while loading +into setup.py + {% endblock %} {% block bottom_block %} diff --git a/README.rst b/README.rst index 8977d70..eb38d27 100644 --- a/README.rst +++ b/README.rst @@ -37,6 +37,10 @@ setup.py 3. configured to build universial wheels by default +4. comes with a feature of removing comments from requirements.txt while loading +into setup.py + + Installation ================================================================================ diff --git a/templates/setup.py.jj2 b/templates/setup.py.jj2 index b50e77e..94c5d8a 100644 --- a/templates/setup.py.jj2 +++ b/templates/setup.py.jj2 @@ -113,7 +113,20 @@ if python_implementation == "PyPy": INSTALL_REQUIRES = [ {% for dependency in dependencies: %} {% if ';' not in dependency and not dependency.startswith('#'): %} + {% if '#egg=' in dependency: %} + {% set dependency = dependency.split('#egg=') %} + {% set repo_link, egg_name = dependency[0], dependency[1] %} + {% set repo_link = repo_link.strip() %} + {% if '#' in egg_name: %} + {% set egg_name = egg_name.split('#')[0].strip() %} + {% endif %} + '{{[repo_link, egg_name] | join('#egg=')}}', + {% elif '#' in dependency: %} + {% set dependency = dependency.split('#')[0].strip() %} + '{{dependency}}', + {% else %} '{{dependency}}', + {% endif %} {% endif %} {% endfor %} ]