From f2d3a1f1a0f988449e8ae878b1a275cf5a71801c Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sat, 27 Jul 2013 19:29:53 +0300 Subject: [PATCH 1/7] Rename Foreword to Introduction, add Development, modify License and Installation --- doc/development.rst | 107 +++++++++++++++++++++++++ doc/index.rst | 10 +-- doc/installation.rst | 79 +++++++++--------- doc/{foreword.rst => introduction.rst} | 10 ++- doc/license.rst | 55 +++++++------ 5 files changed, 190 insertions(+), 71 deletions(-) create mode 100644 doc/development.rst rename doc/{foreword.rst => introduction.rst} (96%) diff --git a/doc/development.rst b/doc/development.rst new file mode 100644 index 0000000..1449789 --- /dev/null +++ b/doc/development.rst @@ -0,0 +1,107 @@ +.. _development: + +Development +=========== + +Pythonect is under active development, and contributors are welcome. + +If you have a feature request, suggestion, or bug report, please open a new +issue on GitHub_. To submit patches, please send a pull request on GitHub_. + +If you'd like to contribute, there's plenty to do. Here's a short todo list. + +.. include:: ../TODO.rst + + +.. _GitHub: http://github.com/ikotler/pythonect/ + + +.. _scm: + +-------------- +Source Control +-------------- + +Pythonect source is controlled with Git_, the lean, mean, distributed source +control machine. + +The repository is publicly accessible. + + ``git clone git://github.com/ikotler/pythonect.git`` + +The project is hosted on **GitHub**: + + `http://github.com/ikotler/pythonect `_ + +.. _Git: http://git-scm.org + +Git Branch Structure +++++++++++++++++++++ + +Feature / Hotfix / Release branches follow a `Successful Git Branching Model `_. `Git-Flow `_ is a great tool for managing the repository. I highly recommend it. + +``develop`` + The "next release" branch. Likely unstable. +``master`` + Current production release (|version|) on PyPi. + +Each release is tagged. + +When submitting patches, please place your feature/change in its own branch prior to opening a pull request on GitHub_. + + +----------------- +Testing Pythonect +----------------- + +Testing is crucial to Pythonect's stability. When developing a new feature for Pythonect, be sure to write proper tests for it as well. + +The easiest way to test your changes for potential issues is to simply run the test suite directly: :: + + $ python setup.py nosetests + +Don't have nose_ installed? Installing nose is simple: :: + + $ pip install nose + +.. _nose: http://somethingaboutorange.com/mrl/projects/nose/ + + +---------------------- +Continuous Integration +---------------------- + +Every commit made to the **develop** branch is automatically tested and inspected upon receipt with `Travis CI `_. If you have access to the main repository and broke the build, you will receive an email accordingly. + +Anyone may view the build status and history at any time: + + https://travis-ci.org/ikotler/pythonect + +Additional reports will also be included here in the future, including :pep:`8` checks and stress reports for extremely large datasets. + + +.. _docs: + +----------------- +Building the Docs +----------------- + +Documentation is written in the powerful, flexible, and standard Python documentation format, `reStructured Text`_. +Documentation builds are powered by the powerful Pocoo project, Sphinx_. The :ref:`API Documentation ` is mostly documented inline throughout the module. + +The Docs live in ``pythonect/doc``. In order to build them, you will first need to install Sphinx: :: + + $ pip install sphinx + + +Then, to build an HTML version of the docs, simply run the following from the **doc** directory: :: + + $ make html + +Your ``doc/_build/html`` directory will then contain an HTML representation of the documentation, ready for publication on most web servers. + +You can also generate the documentation in **epub**, **latex**, and **json**. + + +.. _`reStructured Text`: http://docutils.sourceforge.net/rst.html +.. _Sphinx: http://sphinx.pocoo.org \ No newline at end of file diff --git a/doc/index.rst b/doc/index.rst index c197702..6e4c70f 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,11 +8,6 @@ different parts. I recommend that you get started with :ref:`installation` and then head over to the :ref:`tutorial`. If you'd rather dive into the internals of Pythonect, check out the :ref:`api` documentation. -Pythonect is dependent on one external library: the `NetworkX -`_ graph library. This library is not documented -here. If you want to dive into its documentation, check out the following -link: `NetworkX Documentation `_ - .. note:: This is the main documentation for the Pythonect project. The contents of this site are automatically generated via `Sphinx ` the bug tracker `here `__, or even better, submit a pull request! + User's Guide ------------ @@ -33,9 +29,10 @@ instructions for building applications with Pythonect. .. toctree:: :maxdepth: 2 - foreword + introduction installation tutorial/index + development .. _api: @@ -50,6 +47,7 @@ this part of the documentation is for you. api + Additional Notes ---------------- diff --git a/doc/installation.rst b/doc/installation.rst index 3a3f972..8b402fd 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -3,61 +3,66 @@ Installation ============ +This part of the documentation covers the installation of Pythonect. The first +step to using any software package is getting it properly installed. + +.. _installing: + +-------------------- +Installing Pythonect +-------------------- + Pythonect works with Python version 2.6 and greater, but it will not work (yet) with Python 3. Dependencies are listed in ``setup.py`` and will be installed automatically as part of any of the techniques listed below. -.. _installation-pip: - -Using pip or easy_install -------------------------- - -Easiest way to install Pythonect is to use ``pip``: +Distribute & Pip +---------------- -.. code-block:: bash +Installing Pythonect is simple with `pip `_:: - pip install Pythonect + $ pip install pythonect -And second to easiest is with ``easy_install``: +or, with `easy_install `_:: -.. code-block:: bash - - easy_install Pythonect + $ easy_install pythonect .. note:: Using easy_install is discouraged. Why? `Read here `_. -.. _installation-git: - -Using git repository --------------------- -Regular development happens at our `GitHub repository -`_. Grabbing the cutting edge version -might give you some extra features or fix some newly discovered bugs. We -recommend not installing from the git repo unless you are actively developing -*Pythonect*. To clone the git repository and install it locally: +------------------- +Download the Source +------------------- + +You can also install pythonect from source. The latest release (|version|) is available from GitHub. + +* tarball_ +* zipball_ + +Once you have a copy of the source, unzip or untar the package, change +directory into the extracted distribution and type:: + + $ python setup.py install + + +To download the full source history from Git, see :ref:`Source Control `. + +.. _tarball: http://github.com/ikotler/pythonect/tarball/master +.. _zipball: http://github.com/ikotler/pythonect/zipball/master -.. code-block:: bash - git clone git://github.com/ikotler/pythonect.git - cd pythonect - python setup.py install +.. _updates: -Alternatively, if you use pip, you can install directly from the git repository: +Staying Updated +--------------- -.. code-block:: bash +The latest version of Pythonect will always be available here: - pip install \ - git+git://github.com/ikotler/pythonect.git@master#egg=pythonect \ - -r https://github.com/ikotler/pythonect/raw/master/doc/requirements.txt +* PyPi: http://pypi.python.org/pypi/pythonect/ +* GitHub: http://github.com/ikotler/pythonect/ -.. _installation-archives: - -Using archives (tarball) ------------------------- +When a new version is available, upgrading is simple:: -Visit our `PyPI Page `_ to grab the -archives of both current and previous stable releases. After untarring, simply -run ``python setup.py install`` to install it. \ No newline at end of file + $ pip install pythonect --upgrade diff --git a/doc/foreword.rst b/doc/introduction.rst similarity index 96% rename from doc/foreword.rst rename to doc/introduction.rst index 7d34846..f84356f 100644 --- a/doc/foreword.rst +++ b/doc/introduction.rst @@ -1,10 +1,13 @@ -Foreword -======== +.. _introduction: + +Introduction +============ Read this before you get started with Pythonect. This hopefully answers some questions about the purpose and goals of the project, and when you should or should not be using it. + What is Pythonect? ------------------ @@ -17,7 +20,8 @@ Python. The visual programming language is based on the idea of a diagram with The Pythonect interpreter (and reference implementation) is a free and open source software written completely in Python, and is available under the BSD -license. +3-Clause license. + Why Pythonect? -------------- diff --git a/doc/license.rst b/doc/license.rst index 9b2fd54..b78ad99 100644 --- a/doc/license.rst +++ b/doc/license.rst @@ -1,34 +1,39 @@ -.. _license: - License ======= -Pythonect licensed under BSD 3-Clause:: +Pythonect is licensed under a three clause BSD License. It basically means: +do whatever you want with it as long as the copyright in Pythonect sticks +around, the conditions are not modified and the disclaimer is present. +Furthermore you must not use the names of the authors to promote derivatives +of the software without written consent. + +The full license text can be found below (:ref:`pythonect-license`). For the +documentation and artwork different licenses apply. + +.. _authors: + +Authors +------- + +.. include:: ../AUTHORS + +General License Definitions +--------------------------- + +The following section contains the full license texts for Pythonect and the +documentation. - Copyright (c) 2012-2013, Itzik Kotler - All rights reserved. +- "AUTHORS" hereby refers to all the authors listed in the + :ref:`authors` section. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: +- The ":ref:`pythonect-license`" applies to all the sourcecode shipped as + part of Pythonect (Pythonect itself as well as the examples and the unittests) + as well as documentation. - * 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. +.. _pythonect-license: - * Neither the name of the author nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. +Pythonect License +----------------- - THIS SOFTWARE 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, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +.. include:: ../LICENSE \ No newline at end of file From f5a9a4f217a9464b555ad2f9b6f99ab30013e18f Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sat, 27 Jul 2013 19:30:35 +0300 Subject: [PATCH 2/7] Add the Dream Team to the License --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index b3dc51f..6ff77ad 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2013, Itzik Kotler +Copyright (c) 2012-2013, Itzik Kotler and contributors. See AUTHORS for more details. All rights reserved. Redistribution and use in source and binary forms, with or without From 2055db08d42fa2f0b37a99cd7f67e9eba3b3347a Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sat, 27 Jul 2013 21:47:31 +0300 Subject: [PATCH 3/7] Minor text change --- doc/development.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/development.rst b/doc/development.rst index 1449789..525c54a 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -77,8 +77,6 @@ Anyone may view the build status and history at any time: https://travis-ci.org/ikotler/pythonect -Additional reports will also be included here in the future, including :pep:`8` checks and stress reports for extremely large datasets. - .. _docs: From 4595d97297646458b721a1324b7f5b35819062ea Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sun, 28 Jul 2013 17:52:54 +0300 Subject: [PATCH 4/7] Switch to static pythonect/_version.py --- .gitignore | 1 - pythonect/__init__.py | 13 +---- pythonect/_version.py | 1 + pythonect/internal/version.py | 69 -------------------------- setup.py | 92 ++--------------------------------- 5 files changed, 6 insertions(+), 170 deletions(-) create mode 100644 pythonect/_version.py delete mode 100644 pythonect/internal/version.py diff --git a/.gitignore b/.gitignore index 92c2ef6..6b7716e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ /dist/ /build/ *.egg-info -_version* .coverage .noseids .DS_Store diff --git a/pythonect/__init__.py b/pythonect/__init__.py index 2698f8c..9db38d3 100644 --- a/pythonect/__init__.py +++ b/pythonect/__init__.py @@ -28,18 +28,7 @@ """Parse and execute Pythonect code""" - -__version__ = '0.0.0dev0' - -try: - - from _version import __version__ - -except ImportError as e: - - from internal.version import get_version - - __version__ = get_version() +from _version import __version__ # API diff --git a/pythonect/_version.py b/pythonect/_version.py new file mode 100644 index 0000000..ef7eb44 --- /dev/null +++ b/pythonect/_version.py @@ -0,0 +1 @@ +__version__ = '0.6.0' diff --git a/pythonect/internal/version.py b/pythonect/internal/version.py deleted file mode 100644 index 2913098..0000000 --- a/pythonect/internal/version.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) 2012-2013, Itzik Kotler -# All rights reserved. -# -# Redistribution and use in source and binary forms, 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 the author nor the names of its contributors may -# be used to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE 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, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import subprocess -import re - - -def get_version(): - - version = "0.0.0.dev0" - - try: - - git = subprocess.Popen(['git', 'describe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - git.stderr.close() - - git_output = git.stdout.readlines()[0] - - git_ver = re.match('^\w+(?P\d+)\.(?P\d+)(\.(?P\d+)(\-(?P\d+))?)?', git_output) - - if git_ver is not None: - - # MAJOR.MINOR - - version = git_ver.group('MAJOR') + '.' + git_ver.group('MINOR') - - if git_ver.groupdict('MICRO') is not None: - - # MAJOR.MINOR.MICRO - - version = version + '.' + git_ver.group('MICRO') - - if git_ver.groupdict('DEV') is not None: - - # MAJOR.MINOR.MICRO-DEV - - version = version + '.dev' + git_ver.group('DEV') - - except Exception as e: - - pass - - return version diff --git a/setup.py b/setup.py index 83e0e67..6988971 100644 --- a/setup.py +++ b/setup.py @@ -41,105 +41,23 @@ import sys -import distutils.core -import distutils.command.build -import subprocess -import re # Functions -def _mk_versiondotpy(): - - with open('pythonect/_version.py', 'wt') as f: - - f.write('# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN.\n__version__ = \'' + _safe_get_version() + '\'\n') - - -def __get_git_version(): - - version = "0.0.0.dev0" - - try: - - git = subprocess.Popen(['git', 'describe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - git.stderr.close() - - git_output = git.stdout.readlines()[0] - - git_ver = re.match('^\w+(?P\d+)\.(?P\d+)(\.(?P\d+)(\-(?P\d+))?)?', git_output) - - if git_ver is not None: - - # MAJOR.MINOR - - version = git_ver.group('MAJOR') + '.' + git_ver.group('MINOR') - - if git_ver.groupdict('MICRO') is not None: - - # MAJOR.MINOR.MICRO - - version = version + '.' + git_ver.group('MICRO') - - if git_ver.groupdict('DEV') is not None: - - # MAJOR.MINOR.MICRO-DEV - - version = version + '.dev' + git_ver.group('DEV') - - except Exception as e: - - pass - - return version - - def _safe_get_version(): - version = '0.0.0dev0' - - try: + tmp_globals = {} - tmp_globals = {} + # Importing _version.py may raise ImportError due to missing dependencies - # Tarball? + execfile('pythonect/_version.py', tmp_globals) - execfile('pythonect/_version.py', tmp_globals) - - version = tmp_globals['__version__'] - - except Exception: - - # Git repository? - - version = __get_git_version() + version = tmp_globals['__version__'] return version -# Classes - -class Version(distutils.core.Command): - - description = "" - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - - # Generate `_version.py` - - _mk_versiondotpy() - - print "*** Pythonect Version %s ***" % (_safe_get_version()) - - # Entry Point if __name__ == "__main__": @@ -183,8 +101,6 @@ def run(self): install_requires=dependencies, - cmdclass={'version': Version}, - test_suite='nose.collector', zip_safe=False From 846d5212da0d272b06d308f9ba830ea706b2f33e Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sun, 28 Jul 2013 18:22:55 +0300 Subject: [PATCH 5/7] Bump version to 0.7.dev0 --- pythonect/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonect/_version.py b/pythonect/_version.py index ef7eb44..8ead4c9 100644 --- a/pythonect/_version.py +++ b/pythonect/_version.py @@ -1 +1 @@ -__version__ = '0.6.0' +__version__ = '0.7.dev0' From d8cfad0d13a51d004ac97e0f312b2e14b11381cc Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sat, 17 Aug 2013 14:00:41 +0300 Subject: [PATCH 6/7] New GitHub README Page --- README.rst | 55 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 97ca737..8ac7e92 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,27 @@ -Pythonect |status| -================== +Pythonect +========= -.. |status| image:: https://secure.travis-ci.org/ikotler/pythonect.png +.. image:: https://badge.fury.io/py/Pythonect.png + :target: http://badge.fury.io/py/Pythonect + :alt: Latest version -`Pythonect `_ is a new, experimental, general- -purpose dataflow programming language based on Python. It provides both a -visual programming language and a text-based scripting language. The text- -based scripting language aims to combine the quick and intuitive feel of shell -scripting, with the power of Python. The visual programming language is based -on the idea of a diagram with “boxes and arrows”. Crazy? Most definitely. And -yet, strangely enough, it works! +.. image:: https://travis-ci.org/ikotler/pythonect.png?branch=master + :target: https://travis-ci.org/ikotler/pythonect + :alt: Travis-CI + +.. image:: https://pypip.in/d/Pythonect/badge.png + :target: https://crate.io/packages/Pythonect/ + :alt: Number of PyPI downloads + +Homepage: `http://www.pythonect.org/ `_ + +`Pythonect` is a new, experimental, general-purpose dataflow programming +language based on Python. It provides both a visual programming language and a +text-based scripting language. The text-based scripting language aims to +combine the quick and intuitive feel of shell scripting, with the power of +Python. The visual programming language is based on the idea of a diagram with +“boxes and arrows”. Crazy? Most definitely. And yet, strangely enough, it +works! Hello, world @@ -23,9 +35,6 @@ Or: .. image:: http://pythonect.org/HelloWorld2.png -See the `Pythonect documentation `_ for a detailed -walkthrough of the language and its features. - Installation ------------ @@ -63,12 +72,24 @@ you will have to do this with *root* permissions (e.g. using ``su`` or .. _pip: http://www.pip-installer.org/ +Examples +-------- + +See more examples at the `Pythonect Tutorial `_. + + +Documentation +------------- + +Full documentation is available at http://docs.pythonect.org/. + + Please Help Out --------------- This project is still under development. Feedback and suggestions are very welcome and I encourage you to use the `Issues list -`_ on Github to provide that +`_ on GitHub to provide that feedback. Feel free to fork this repo and to commit your additions. For a list of all @@ -87,7 +108,7 @@ Pythonect is published under the liberal terms of the BSD 3-Clause License, see the `LICENSE `_ file. Although the BSD License does not require you to share any modifications you make to the source code, you are very much encouraged and invited to -contribute back your modifications to the community, preferably in a Github +contribute back your modifications to the community, preferably in a GitHub fork, of course. @@ -100,8 +121,8 @@ consider Flattr'ing or Gittip'ing me: |FlattrThis|_ |GittipThis|_ -.. |GittipThis| image:: https://www.gittip.com/assets/7.0.8/logo.png +.. |GittipThis| image:: https://www.gittip.com/assets/10.0.6/logo.png .. _GittipThis: https://www.gittip.com/ikotler .. |FlattrThis| image:: http://api.flattr.com/button/button-static-50x60.png -.. _FlattrThis: https://flattr.com/thing/1713050/ikotlerpythonect-on-GitHub \ No newline at end of file +.. _FlattrThis: https://flattr.com/thing/1713050/ikotlerpythonect-on-GitHub From c4ba7a39d8bae7b1cd825142d1b91567130691d6 Mon Sep 17 00:00:00 2001 From: Itzik Kotler Date: Sat, 17 Aug 2013 14:03:53 +0300 Subject: [PATCH 7/7] Add distribute_setup.py --- MANIFEST.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0b5c2e1..33e45ac 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,10 +4,11 @@ include README.rst include MANIFEST.in include setup.cfg include setup.py +include distribute_setup.py recursive-include doc * recursive-include examples * prune doc/_build global-include *.rst -global-exclude *.DS_Store* \ No newline at end of file +global-exclude *.DS_Store*