Skip to content

Commit

Permalink
changed out the pyproject starter data for the dummyos info.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruckusist committed Mar 19, 2017
1 parent d8c08c0 commit 907cc2c
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 145 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# DUmmyScript.com
*.swp

/build/
Expand Down
29 changes: 1 addition & 28 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
Copyright (C) 2017 Alpha Griffin
@%@~LICENSE~@%@

saw_031517_3 - Add logo.

saw_031517_2 - Fix theme_options for sphinx_rtd_theme 0.1.9 which is the version currently in
portage. Add favicon.ico.

saw_031517_1 - Use sphinx_rtd_theme.

saw_031417_7 - Add to the docstrings.

saw_031417_6 - Updates to README about the Makefile.

saw_031417_5 - Bumping to beta status.

saw_031417_4 - Will just have to do without the friendly error check.

saw_031417_3 - Fix the conditional Sphinx check.

saw_031417_2 - Fix over-broad Sphinx dependency check.

saw_031417_1 - Building up a Makefile; utilizing Sphinx for documentation.

saw_030917_1 - Add instructions for making source/binary distributions.

saw_021817_3 - More README updates.

saw_021817_2 - Updates to README and .gitignore.

saw_021817_1 - Initial commit.
roc_031817_1 - Initial commit.

7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@

# echo "Starting The Docker Build Process"
FROM gentoo/stage3-amd64:latest

Expand Down Expand Up @@ -27,7 +30,9 @@ RUN cd /repos
RUN git clone http://git.alphagriffin.com/ruckusist/bash_utilities


# this a Hack to keep a non serving docker open for use
CMD tail -f /dev/null

# end our program
CMD fortune -a | cowsay
# CMD fortune -a | cowsay

96 changes: 4 additions & 92 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

====================================
Alpha Griffin Python Starter Project
DummyScript.com DummyOS
====================================

Starting point for a Python project.
Expand All @@ -13,101 +13,13 @@ Starting point for a Python project.
Starting a Project
------------------

You can use this repository as a starting point for any Alpha Griffin Python project. Here's an example of one way to accomplish this with GitHub:
Follow along with these DummyScript.com tutorials for starting all tutorials. This is your crash dummy. Crash it!

1. Start a new repository on GitHub but **do not initialize** as you will be pushing an existing repository (a clone of pyproject). For this example we'll name it *my_new_thing*.
2. ``git clone http://github.com/AlphaGriffin/pyproject my_new_thing``
3. ``cd my_new_thing``
4. ``git remote remove origin``
5. ``git remote add origin http://github.com/AlphaGriffin/my_new_thing``
6. ``git push -u origin master``

Now your clone of pyproject lives at the new GitHub address and pushes will go there by default.

**Recommended**

With this extra step you can easily pull and merge again in the future from this master *pyproject* repository:

7. ``git remote add pyproject http://github.com/AlphaGriffin/pyproject``

Using ``git pull pyproject master`` you can pull and merge the latest from *pyproject* at any time.


First Commit
Guide 1
------------
.. link to the asciicinema.com tutorials for this setup.
There's a few things you'll want to do for first commit:

1. Rename the default project source folder: ``git mv ag/pyproject ag/my_new_thing``. It's important you have a similar ``__version__.py`` file in your source folder.
2. Update variables in ``setup.py``, most importantly NAME must match the name of your new ``ag/my_new_thing`` source folder
3. Remove the pyproject API rst docs from ``api/`` folder. You can use ``make apidoc`` to have new ones automatically generated once you have some code to document.


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

Both a Makefile and setup.py are provided and used. The setup.py uses Python's standard setuptools package and you can call this script directly to do the basic Python tasks such as creating a wheel, etc.

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

make help

Sphinx is used to generate html documentation and man pages. All documentation (html as well as man pages) may be regenerated at any time with::

make docs

Every so often, when new source class files are created or moved, you will want to regenerate the API documentation templates. These templates may be modified by hand so this task does not overwrite existing files; you'll need to remove any existing files from ``api/`` that you want recreated. Then generate the API templates and re-build all documentation as follows::

make apidoc
make docs

There's not much to do for a simple Python project but your build may want to do more. In any case you can call ``make python`` if you need to (in pyproject this target simply delegates to ``./setup.py build``).

Build all the common tasks (including documentation) as follows::

make all

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

make clean


Installing
----------

To install this project to the local system::

make install

Note that you may need superuser permissions to perform the above step.


Distributing
------------

To make a *binary* distribution::

make bdist

(in pyproject, the above step simply delegates to ``./setup.py bdist_wheel``)

The distributions will collect in the ``dist/`` directory.


Using
-----

The **pyproject** module does nothing useful and is for example purposes only, but you can import it to verify correct installation.

If you have already installed the project to the system then it's as simple as::
import ag.pyproject

If you have not installed the project system-wide or you have some changes to try, you must add the project folder to Python's search path first::

import sys, os
sys.path.insert(0, os.path.abspath('/path/to/pyproject'))
import ag.pyproject
.. notes
.. https://sonarqube.com/about for possible ideas
2 changes: 0 additions & 2 deletions ag/pyproject/__version__.py

This file was deleted.

4 changes: 2 additions & 2 deletions api/ag.pyproject.rst → api/dummy.os.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ag.pyproject package
dummy.os package
====================

Module contents
---------------

.. automodule:: ag.pyproject
.. automodule:: dummy.os
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions api/ag.rst → api/dummy.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ag package
dummy package
==========

Subpackages
-----------

.. toctree::

ag.pyproject
dummy.os

Module contents
---------------
Expand Down
4 changes: 2 additions & 2 deletions api/modules.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ag
dummy
==

.. toctree::
:maxdepth: 4

ag
dummy
File renamed without changes.
4 changes: 2 additions & 2 deletions ag/pyproject/__init__.py → dummy/os/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.. moduleauthor:: Shawn Wilson <lannocc@alphagriffin.com>
"""

from ag.pyproject.__version__ import __version__
from dummy.os.__version__ import __version__

print ("Sample Alpha Griffin project version %s successfully installed!" % (__version__))
print ("DummyScript.com Basic Operating System : {}".format(__version__))

1 change: 1 addition & 0 deletions dummy/os/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# dummyscript.com
2 changes: 2 additions & 0 deletions dummy/os/__second__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dummyscript.com
# second entry point from the CLI
1 change: 1 addition & 0 deletions dummy/os/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.0.1'
File renamed without changes.
33 changes: 19 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

"""AlphaGriffin setuptools build script.
@author lannocc
@author ruckusist
@see https://packaging.python.org/en/latest/distributing.html
@see https://github.com/pypa/sampleproject
@see https://docs.docker.com/engine/api/getting-started/#running-a-container
@see https://docs.docker.com/engine/reference/commandline/build/#tarball-contexts
Some of this script logic also taken from:
https://github.com/google/protobuf
Expand All @@ -26,19 +26,19 @@
# All the variables defined here should be customized for your project.
#

NS = 'ag' # namespace / meta-package folder
NAME = 'pyproject' # should match source package name in NS folder
REQUIRE = ['sphinx_rtd_theme'] # package dependencies
NS = 'dummy' # namespace / meta-package folder
NAME = 'os' # should match source package name in NS folder
REQUIRE = ['sphinx_rtd_theme'] # package dependencies

DESC = 'Alpha Griffin Starter Python Project'
TAGS = 'example utilities' # space-separated list of keywords
DESC = 'Dummyscript.com DummyOS'
TAGS = 'gentoo tutorial dummyscript ' # space-separated list of keywords

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

URL = 'http://alphagriffin.com'
LICENSE = 'AG' # type of license
COPY = '2017 Alpha Griffin' # copyright
LICENSE = 'AG' # type of license
COPY = '2017 Alpha Griffin' # copyright

CLASS = [
# @see https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down Expand Up @@ -93,7 +93,7 @@ def findversion(root, name):
name=NAME,
version=findversion(NS, NAME),
license=LICENSE,
namespace_packages=[NS], # home for our libraries
namespace_packages=[NS], # home for our libraries
packages=find_packages(exclude=['tests']),
author=AUTHOR,
author_email=EMAIL,
Expand All @@ -104,7 +104,8 @@ def findversion(root, name):
keywords=TAGS,

# run-time dependencies
install_requires=REQUIRE,
install_requires=['docker'
],

extras_require={
},
Expand All @@ -115,6 +116,10 @@ def findversion(root, name):
data_files=[],

entry_points={
'console_scripts': [
'dummyos = dummy.os.__main__',
'dummy.os = dumm.os.__second__'
]
},
)

0 comments on commit 907cc2c

Please sign in to comment.