From 5ff3d7feb2e7405d407fde480a6573d0c5c2b9db Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 15 Apr 2017 21:02:24 +0300 Subject: [PATCH] Initial commit - created the project --- .gitignore | 12 +++ MANIFEST.in | 3 + Makefile | 30 ++++++ README.txt | 5 + TODO | 0 docs/.gitignore | 4 + docs/Makefile | 20 ++++ docs/conf.py | 157 ++++++++++++++++++++++++++++++++ docs/genapidocs | 5 + docs/index.rst | 20 ++++ docs/news.rst | 5 + get-commit-message.vim | 9 ++ mk-distr | 14 +++ mk-git-aliases | 9 ++ publish-docs | 8 ++ remove-old-files/__init__.py | 1 + remove-old-files/__version__.py | 1 + requirements.txt | 4 + requirements_dev.txt | 3 + requirements_docs.txt | 3 + setup.cfg | 15 +++ setup.py | 44 +++++++++ tests/Makefile | 4 + tests/test.py | 4 + tox.ini | 40 ++++++++ update | 2 + 26 files changed, 422 insertions(+) create mode 100644 .gitignore create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 README.txt create mode 100644 TODO create mode 100644 docs/.gitignore create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100755 docs/genapidocs create mode 100644 docs/index.rst create mode 100644 docs/news.rst create mode 100644 get-commit-message.vim create mode 100755 mk-distr create mode 100755 mk-git-aliases create mode 100755 publish-docs create mode 100644 remove-old-files/__init__.py create mode 100644 remove-old-files/__version__.py create mode 100644 requirements.txt create mode 100644 requirements_dev.txt create mode 100644 requirements_docs.txt create mode 100644 setup.cfg create mode 100755 setup.py create mode 100644 tests/Makefile create mode 100755 tests/test.py create mode 100644 tox.ini create mode 100755 update diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dbc528 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/.cache/ +/.tox/ +/remove-old-files.egg-info/ +/build/ +/data/ +/dist/ +/htmlcov/ +/.coverage +/MANIFEST +*.py[co] +*.tmp +*~ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..1d3d94f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +global-include Makefile *.py *.rst *.txt +include docs/genapidocs COPYING ChangeLog MANIFEST.in TODO mk-distr +recursive-include docs *.css *.js *.html *.gif *.png diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fc9c35e --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ + +.PHONY: all +all: + @echo "Nothing to be done for 'all'" + +.PHONY: release +release: tests flake8 html distr + +.PHONY: distr +distr: + ./mk-distr + +.PHONY: flake8 +flake8: + flake8 + +.PHONY: html +html: + $(MAKE) -C docs html + +.PHONY: test +test: + $(MAKE) -C tests + +.PHONY: tests +tests: test + +.PHONY: clean +clean: + find . -name '*.py[co]' -type f -delete diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..0bb241d --- /dev/null +++ b/README.txt @@ -0,0 +1,5 @@ +Broytman remove-old-files, Copyright (C) 2017 PhiloSoft Design +Author: Oleg Broytman +License: GPL + +Remove old files. diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..2be7eb5 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,4 @@ +/_build/ +/_static/ +/_templates/ +/api/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..10de652 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = remove-old-files +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..acc253c --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# remove-old-files documentation build configuration file, created by +# sphinx-quickstart on Sat Apr 15 20:37:34 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# 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('.')) + + +# -- 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'] + +# 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' + +# General information about the project. +project = 'remove-old-files' +copyright = '2017, Oleg Broytman' +author = 'Oleg Broytman' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.0' +# The full version, including alpha/beta/rc tags. +release = '0.0.1' + +# 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 = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- 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'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'remove-old-filesdoc' + + +# -- 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, 'remove-old-files.tex', 'remove-old-files Documentation', + 'Oleg Broytman', '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, 'remove-old-files', 'remove-old-files 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, 'remove-old-files', 'remove-old-files Documentation', + author, 'remove-old-files', 'One line description of project.', + 'Miscellaneous'), +] + + + diff --git a/docs/genapidocs b/docs/genapidocs new file mode 100755 index 0000000..a2425fe --- /dev/null +++ b/docs/genapidocs @@ -0,0 +1,5 @@ +#! /bin/sh + +cd "`dirname $0`"/.. && +exec sphinx-apidoc --separate --module-first --suffix=rst --force \ + --output-dir=docs/api remove-old-files diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..17c64cb --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. remove-old-files documentation master file, created by + sphinx-quickstart on Sat Apr 15 20:37:34 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to remove-old-files's documentation! +============================================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/news.rst b/docs/news.rst new file mode 100644 index 0000000..a38f68d --- /dev/null +++ b/docs/news.rst @@ -0,0 +1,5 @@ +News +==== + +0.0.1 (2017-04-??) +------------------ diff --git a/get-commit-message.vim b/get-commit-message.vim new file mode 100644 index 0000000..0ee615b --- /dev/null +++ b/get-commit-message.vim @@ -0,0 +1,9 @@ +set fileencoding=utf-8 +edit ChangeLog +normal 1G3yy +buffer 1 +normal 1GPf ;Da: +. +normal JJ +s/\.$// +update diff --git a/mk-distr b/mk-distr new file mode 100755 index 0000000..32d57c8 --- /dev/null +++ b/mk-distr @@ -0,0 +1,14 @@ +#! /bin/sh + +umask 022 && + +git archive --format=tar --prefix=remove-old-files/ "${1:-HEAD}" | + (cd "$HOME/tmp" && exec tar xf -) && + +cp -ap docs "$HOME/tmp/remove-old-files" && + +cd "$HOME/tmp/remove-old-files" && +chmod -R u=rwX,go=rX docs && + +python setup.py sdist --formats=bztar && +cd dist && mv remove-old-files-*.tar.bz2 ../.. && cd ../.. && exec rm -rf remove-old-files diff --git a/mk-git-aliases b/mk-git-aliases new file mode 100755 index 0000000..83cfbe8 --- /dev/null +++ b/mk-git-aliases @@ -0,0 +1,9 @@ +#!/bin/sh + +git config --local alias.commit-with-message \ + "!GIT_EDITOR='vim -c \"source get-commit-message.vim\"' \ + exec git commit -v" + +exec git config --local alias.tag-with-message \ + "!GIT_EDITOR='vim -c \"source get-commit-message.vim\"' \ + exec git tag -s \`python setup.py --version\`" diff --git a/publish-docs b/publish-docs new file mode 100755 index 0000000..d6aba1f --- /dev/null +++ b/publish-docs @@ -0,0 +1,8 @@ +#! /bin/sh + +web="$HOME"/Internet/WWW/htdocs/phdru.name/Software/Python/remove-old-files/docs + +cd "`dirname \"$0\"`"/docs/_build/html && +rsync -ahP --del * --exclude=objects.inv "$web" && + +exec chmod -R u=rwX,go=rX "$web" diff --git a/remove-old-files/__init__.py b/remove-old-files/__init__.py new file mode 100644 index 0000000..792d600 --- /dev/null +++ b/remove-old-files/__init__.py @@ -0,0 +1 @@ +# diff --git a/remove-old-files/__version__.py b/remove-old-files/__version__.py new file mode 100644 index 0000000..b8023d8 --- /dev/null +++ b/remove-old-files/__version__.py @@ -0,0 +1 @@ +__version__ = '0.0.1' diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7afd248 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +--trusted-host phdru.name +--find-links=http://phdru.name/Software/Python/ +--install-option=-O2 + diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 0000000..73c8ac6 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,3 @@ +-r requirements.txt + +pytest diff --git a/requirements_docs.txt b/requirements_docs.txt new file mode 100644 index 0000000..94d38eb --- /dev/null +++ b/requirements_docs.txt @@ -0,0 +1,3 @@ +-r requirements.txt + +Sphinx diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d84280f --- /dev/null +++ b/setup.cfg @@ -0,0 +1,15 @@ +[bdist_wheel] +universal = 1 + +[easy_install] +find_links = http://phdru.name/Software/Python/ +optimize = 2 + +[egg_info] +tag_build = +tag_date = 0 +tag_svn_revision = 0 + +[flake8] +exclude = .git,.tox,docs/conf.py + diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..2103a68 --- /dev/null +++ b/setup.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +from imp import load_source +from os.path import abspath, dirname, join + +try: + from setuptools import setup + is_setuptools = True +except ImportError: + from distutils.core import setup + is_setuptools = False + +versionpath = join(abspath(dirname(__file__)), '{remove-old-files}', '__version__.py') +load_source('remove-old-files_version', versionpath) +# Ignore: E402 module level import not at top of file +from remove-old-files_version import __version__ # noqa + +setup(name='{remove-old-files}', + version=__version__, + description='Broytman {remove-old-files}', + long_description=open('README.txt', 'rtU').read(), + author='Oleg Broytman', + author_email='phd@phdru.name', + url='http://phdru.name/Software/Python/', + license='GPL', + platforms=['any'], + keywords=[''], + classifiers=[ + 'Development Status :: 1 - Planning', + 'Environment :: Console', + 'Environment :: Web Environment', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 2 :: Only', + ], + packages=['{remove-old-files}'], + package_data={'{remove-old-files}': []}, + scripts=[], + requires=[], + ) diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..4374f05 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,4 @@ + +.PHONY: all +all: + PYTHONPATH=.. pytest diff --git a/tests/test.py b/tests/test.py new file mode 100755 index 0000000..dcbf6ff --- /dev/null +++ b/tests/test.py @@ -0,0 +1,4 @@ +#! /usr/bin/env python + +def test(): + assert True diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..a69b545 --- /dev/null +++ b/tox.ini @@ -0,0 +1,40 @@ +[tox] +minversion = 1.8 +toxworkdir={homedir}/.tox/remove-old-files +envlist = {py26,py27,py34},{py27,py34}-flake8 + +# Base test environment settings +[testenv] +deps = + pytest + pytest-cov + py26: argparse + py26,py27: m_lib>=2.0 + py34: m_lib>=3.0 +sitepackages = True +# Don't fail or warn on uninstalled commands +whitelist_externals = + flake8 + +[general] +commands = + python -m pytest --cov=remove-old-files + +[testenv:py26] +commands = {[general]commands} + +[testenv:py27] +commands = {[general]commands} + +[testenv:py34] +commands = {[general]commands} + +[testenv:py27-flake8] +deps = + flake8 +commands = flake8 + +[testenv:py34-flake8] +deps = + flake8 +commands = flake8 diff --git a/update b/update new file mode 100755 index 0000000..690ecaa --- /dev/null +++ b/update @@ -0,0 +1,2 @@ +#! /bin/sh +exec "$HOME"/admin/prog/git-scripts/update -- 2.39.5