Skip to content

Commit

Permalink
saw_042017_1 - First commit for fauxpython.
Browse files Browse the repository at this point in the history
  • Loading branch information
lannocc committed Apr 20, 2017
1 parent dd131a3 commit dd38060
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 27 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG
@@ -1,9 +1,5 @@
Copyright (C) 2017 Alpha Griffin
@%@~LICENSE~@%@

saw_041117_3 - Add Makefile.

saw_041117_2 - Updated README.

saw_041117_1 - Initial commit for fauxproject.
saw_042017_1 - First commit for fauxpython.

28 changes: 15 additions & 13 deletions Makefile
@@ -1,7 +1,7 @@
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@
#
# A most basic make file.
# A simple make file for any Python project.


.PHONY: default
Expand All @@ -14,32 +14,34 @@ help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " help display this help screen"
@echo ""
@echo " all to make all common tasks: example"
@echo " clean to clean all common tasks: example_clean"
@echo " all to make all common tasks: python"
@echo " clean to clean all common tasks: python_clean"
@echo ""
@echo " install to install what has been built to the system (first try make all)"
@echo ""
@echo " example to build this example"
@echo " example_clean to clean up after this example build"
@echo " python to build Python code"
@echo " python_clean to clean up after Python build"


all: example
all: python

clean: example_clean
clean: python_clean



example:
@echo Congratulations...example build does nothing!
python:
./setup.py build_py

example_clean:
@echo Congratulations...example build has nothing to clean up!
python_clean:
./setup.py clean
rm -rf build
rm -rf *.egg-info
find . -type d -name __pycache__ | xargs -r rm -r



install:
@echo Congratulations...faux project has nothing to install!

./setup.py install



17 changes: 8 additions & 9 deletions README.md → README.rst
@@ -1,33 +1,32 @@
faux project
============
===========
faux python
===========

Beginning project.

See the other branches on this repository for projects tailored to specific languages/platforms.
Beginning Python project.


Build Overview
--------------

An example `Makefile` is included in the master branch and that's about it.

The most common project build tasks are all provided in the Makefile. To see the full list of project targets:
The most common project build tasks are all provided in the Makefile. To see the full list of project targets::

make help

Build all the common tasks as follows:
Build all the common tasks as follows::

make all

To clean up all the common generated files from your project folder:
To clean up all the common generated files from your project folder::

make clean


Installing
----------

To install this project to the local system:
To install this project to the local system::

make install

Expand Down
17 changes: 17 additions & 0 deletions dummyscript/__init__.py
@@ -0,0 +1,17 @@
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@

"""DummyScript
This package-init script currently simply handles namespace sharing.
.. module:: dummyscript
:synopsis: DummyScript Namespace
"""
# (from http://github.com/google/protobuf)

try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

17 changes: 17 additions & 0 deletions dummyscript/fauxpython/__init__.py
@@ -0,0 +1,17 @@
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@
"""Python Starter Project
The sample DummyScript project allows you to easily get started
on a new Python project.
.. module:: dummyscript.fauxpython
:platform: Unix
:synopsis: Python Starter Project
.. moduleauthor:: Shawn Wilson <lannocc@alphagriffin.com>
"""

from dummyscript.fauxpython.__version__ import __version__

print ("Sample DummyScript Python project version %s successfully installed!" % (__version__))

2 changes: 2 additions & 0 deletions dummyscript/fauxpython/__version__.py
@@ -0,0 +1,2 @@
__version__ = '0.0.1'

11 changes: 11 additions & 0 deletions setup.cfg
@@ -0,0 +1,11 @@
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@
#
# Configuration script for setup.py

[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1

123 changes: 123 additions & 0 deletions setup.py
@@ -0,0 +1,123 @@
#!/usr/bin/env python
#
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@

"""Python setuptools build script.
@author lannocc
@see https://packaging.python.org/en/latest/distributing.html
@see https://github.com/pypa/sampleproject
Some of this script logic also taken from:
https://github.com/google/protobuf
"""

# FIXME / note to self:
# read more at https://caremad.io/posts/2013/07/setup-vs-requirement/
# -- to integrate fully pip



# -------------------------------------------------------------------------------------
#
# CUSTOMIZE THIS SECTION
# All the variables defined here should be customized for your project.
#

NS = 'dummyscript' # namespace / meta-package folder
NAME = 'fauxpython' # should match source package name in NS folder
REQUIRE = [ ] # package dependencies

DESC = 'DummyScript Starter Python Project'
TAGS = 'example utilities' # space-separated list of keywords

AUTHOR = 'DummyScript' # name or alias of author
EMAIL = 'lannocc@alphagriffin.com' # email of author

URL = 'http://dummyscript.com'
LICENSE = '' # type of license
COPY = '2017 Dummy Script' # copyright

CLASS = [
# @see https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python',
'Topic :: System :: Installation/Setup',
'Topic :: Utilities',
]


#
# END CUSTOMIZATION AREA
# -------------------------------------------------------------------------------------







#################
# !!! WARNING !!!
# !!! WARNING !!!
#################
# THINK CAREFULLY BEFORE CHANGING ANYTHING BELOW THIS LINE

from setuptools import setup, find_packages, Command
from codecs import open
from os.path import join, splitext, dirname
from os import walk
from distutils.dep_util import newer


def findversion(root, name):
'''versioning strategy taken from http://stackoverflow.com/a/7071358/7203060'''

import re
vfile = join(root, name, "__version__.py")
vmatch = re.search(r'^__version__ *= *["\']([^"\']*)["\']', open(vfile, "rt").read(), re.M)
if vmatch:
version = vmatch.group(1)
print ("Found %s version %s" % (name, version))
return version
else:
raise RuntimeError("Expecting a version string in %s." % (vfile))




if __name__ == '__main__':

setup(
name=NAME,
version=findversion(NS, NAME),
license=LICENSE,
namespace_packages=[NS], # home for our libraries
packages=find_packages(exclude=['tests']),
author=AUTHOR,
author_email=EMAIL,
description=DESC,
long_description=open('README.rst').read(),
url=URL,
classifiers=CLASS,
keywords=TAGS,

# run-time dependencies
install_requires=REQUIRE,

extras_require={
},

package_data={
},

data_files=[],

entry_points={
},
)

0 comments on commit dd38060

Please sign in to comment.