From d06f6ecefc6627a62ee90a4da4a3f0748ca50aeb Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 10 Jan 2018 23:16:29 +0300 Subject: [PATCH 1/1] Broytman Library for Python - full namespace package This is full namespace meta-package that installs all parts of m_lib library. --- .gitignore | 9 +++++ INSTALL.txt | 35 +++++++++++++++++++ MANIFEST.in | 2 ++ Makefile | 8 +++++ README.txt | 7 ++++ devscripts/prerelease-tag | 4 +++ devscripts/release | 25 ++++++++++++++ devscripts/requirements/requirements.txt | 4 +++ m_lib/__init__.py | 5 +++ mk-distr | 10 ++++++ requirements.txt | 4 +++ setup.cfg | 8 +++++ setup.py | 43 ++++++++++++++++++++++++ 13 files changed, 164 insertions(+) create mode 100644 .gitignore create mode 100644 INSTALL.txt create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 README.txt create mode 100755 devscripts/prerelease-tag create mode 100755 devscripts/release create mode 100644 devscripts/requirements/requirements.txt create mode 100644 m_lib/__init__.py create mode 100755 mk-distr create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100755 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9303ae4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/.cache/ +/.tox/ +/m_lib.full.egg-info/ +/build/ +/dist/ +/MANIFEST +*.py[co] +*.tmp +*~ diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 0000000..e09b67a --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,35 @@ +m_lib.full requires Python 2.6, 2.7 or 3.4+. + +Installation script setup.py requires setuptools. + +Installation using pip: + + System-wide: + + sudo pip install m_lib.full + + User mode: + + pip install --user m_lib.full + + Virtual environments: + + pip install m_lib.full + + For Python 2.6 the command is easy_install. + +Installation from sources: + + To install the library from sources system-wide run run the following + command: + + sudo python setup.py install + + If you don't want to install it system-wide you can install it in your + home directory; run run the following command: + + python setup.py install --user + +Option '--user' installs m_lib.full into +$HOME/.local/lib/python$MAJOR.$MINOR/site-packages/ where python finds it +automatically. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..858f5e2 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +global-include *.py *.txt +include MANIFEST.in Makefile mk-distr diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89ab254 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ + +.PHONY: distr +distr: + ./mk-distr + +.PHONY: clean +clean: + find . -name '*.py[co]' -type f -delete diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..b736eeb --- /dev/null +++ b/README.txt @@ -0,0 +1,7 @@ +Broytman Library for Python. +Author: Oleg Broytman . +Copyright (C) 1996-2018 PhiloSoft Design. +License: GPL. + +This a full namespace meta-package that installs all parts of m_lib library +(currently m_lib and m_lib.defenc). diff --git a/devscripts/prerelease-tag b/devscripts/prerelease-tag new file mode 100755 index 0000000..19531f2 --- /dev/null +++ b/devscripts/prerelease-tag @@ -0,0 +1,4 @@ +#! /bin/sh + +tag="`python setup.py --version`" && +exec git tag --message="Release $tag" --sign $tag diff --git a/devscripts/release b/devscripts/release new file mode 100755 index 0000000..683b650 --- /dev/null +++ b/devscripts/release @@ -0,0 +1,25 @@ +#! /bin/sh + +cd "`dirname \"$0\"`"/.. && +umask 022 && +chmod -R a+rX . && +set-commit-date.py && + +python setup.py build_py && +python setup.py build && +python setup.py sdist && + +for py in 2.6 2.7 3.4 3.5 3.6; do + find build -name '*.py[co]' -delete && + python$py setup.py build_py && + python$py setup.py build && + python$py -m compileall build && + python$py -O -m compileall build && + python$py setup.py bdist_egg || exit 1 +done + +find build -name '*.py[co]' -delete && +python setup.py bdist_wheel --universal && + +twine upload --sign dist/* && +exec rm -rf build dist m_lib.full.egg-info diff --git a/devscripts/requirements/requirements.txt b/devscripts/requirements/requirements.txt new file mode 100644 index 0000000..731a639 --- /dev/null +++ b/devscripts/requirements/requirements.txt @@ -0,0 +1,4 @@ +--install-option=-O2 + +m_lib>=3.1 +m_lib.defenc>=1.0 diff --git a/m_lib/__init__.py b/m_lib/__init__.py new file mode 100644 index 0000000..943eda8 --- /dev/null +++ b/m_lib/__init__.py @@ -0,0 +1,5 @@ +"""Broytman Library for Python, Copyright (C) 1996-2018 PhiloSoft Design""" + +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/mk-distr b/mk-distr new file mode 100755 index 0000000..4dfc4b3 --- /dev/null +++ b/mk-distr @@ -0,0 +1,10 @@ +#! /bin/sh + +umask 022 && + +git archive --format=tar --prefix=m_lib.full/ "${1:-HEAD}" | + (cd "$HOME/tmp" && exec tar xf -) && + +cd "$HOME/tmp/m_lib.full" && +python setup.py sdist --formats=bztar && +cd dist && mv m_lib.full-*.tar.bz2 ../.. && cd ../.. && exec rm -rf m_lib.full diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d9de3b6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +--install-option=-O2 + +m_lib +m_lib.defenc diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d4199d8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,8 @@ +[easy_install] +optimize = 2 + +[egg_info] +tag_build = +tag_date = 0 +tag_svn_revision = 0 + diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..05c1be2 --- /dev/null +++ b/setup.py @@ -0,0 +1,43 @@ +#! /usr/bin/env python + +try: + from setuptools import setup + is_setuptools = True +except ImportError: + from distutils.core import setup + is_setuptools = False + +kw = {} +if is_setuptools: + kw['python_requires'] = '>=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*' + kw['install_requires'] = ['m_lib>=3.1', 'm_lib.defenc>=1.0'] + +setup(name = "m_lib.full", + version = "1.0.0", + description = "m_lib full meta-package", + long_description = "Broytman Library for Python, Copyright (C) 1996-2018 PhiloSoft Design", + author = "Oleg Broytman", + author_email = "phd@phdru.name", + url = "http://phdru.name/Software/Python/#m_lib", + license = "GPL", + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + '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 :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + platforms = "Any", + packages = ["m_lib"], + requires=['m_lib', 'm_lib.defenc'], + namespace_packages = ["m_lib"], + **kw +) -- 2.39.5