[hdf-compass] 181/295: Add configuration setup script and other packaging stuff

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun May 8 10:35:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository hdf-compass.

commit d371beee2429300c02c810ab8bbfcee825bb2c2d
Author: giumas <giumas at yahoo.it>
Date:   Fri Oct 23 20:54:15 2015 -0400

    Add configuration setup script and other packaging stuff
---
 .gitignore                             |  17 ++++-
 README.md                              |  77 -------------------
 README.rst                             |  87 ++++++++++++++++++++++
 docs/conf.py                           |   2 +-
 docs/how_to_release.rst                |   6 +-
 hdf_compass/utils/__init__.py          |   2 +-
 setup.cfg                              |  20 +++++
 setup.py                               | 130 +++++++++++++++++++++++++++++++++
 setup.py2app.py                        |   2 +-
 {test => tests}/HDFCompassTestLog.rst  |   0
 {test => tests}/HDFCompassTestPlan.rst |   0
 11 files changed, 259 insertions(+), 84 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6cf70cc..5636639 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,19 @@
-.DS_Store
-*.pyc
+*.py[co]
+__pycache__/
+
+# build files
 /build
 /dist
+/*.egg
+/*.egg-info/
+/*.egg-link
 /docs/_build
+
+# downloaded test samples
 /data/hdf5/Download/*.h5
+
+# PyCharm settings
+.idea
+
+# Mac OS X
+.DS_Store
diff --git a/README.md b/README.md
deleted file mode 100644
index 019a095..0000000
--- a/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-HDF Compass
-===========
-
-[![Documentation Status](https://readthedocs.org/projects/hdf-compass/badge/?version=stable)](http://hdf-compass.readthedocs.org/en/stable/?badge=stable)
-[![Documentation Status](https://readthedocs.org/projects/hdf-compass/badge/?version=latest)](http://hdf-compass.readthedocs.org/en/latest/?badge=latest)
-
-Welcome to the project!  HDF Compass is an experimental viewer program for
-HDF5 and related formats, designed to complement other more complex
-applications like HDFView.  Strong emphasis is placed on clean minimal design,
-and maximum extensibility through a plugin system for new formats.
-
-HDF Compass is written in Python, but ships as a native application on
-Windows, OS X, and Linux, by using PyInstaller and Py2App to package the app.
-
-Binary executables are available for Windows and Mac OS X (Yosemite or later) at
-the Project Page listed below.
-
-Bug reports and pull requests are welcome!  For non-trivial PRs please
-open an issue first, so the core developers can give feedback on your idea.
-
-
-
-Development Environment
------------------------
-
-You will need:
-
-* [Python 2.7](https://www.python.org/downloads/) *(support for Python 3.4+ in progress)*
-* [NumPy](https://github.com/numpy/numpy)
-* [Matplotlib](https://github.com/matplotlib/matplotlib)
-* [wxPython Phoenix](https://github.com/wxWidgets/Phoenix) *(2.9.5.0 or later)*
-* [h5py](https://github.com/h5py/h5py) *[HDF plugin]*
-* [hydroffice.bag](https://bitbucket.org/ccomjhc/hyo_bag) *[BAG plugin]*
-* [Pydap](https://github.com/robertodealmeida/pydap) *[OPeNDAP plugin]*
-
-For packaging the app:
-
-* [PyInstaller](https://github.com/pyinstaller/pyinstaller) (Linux & Windows, experimental for OS X) *(>= 3.0)*
-* [Py2App](https://bitbucket.org/ronaldoussoren/py2app) (OS X)
-
-Running the Program  
---------------------
-
-    $ python HDFCompass.py
-      
-      
-Note: If you are using the Anaconda distribution on the Mac, you will see the
-message: "This program needs access to the screen.  Please run with a Framework
-build of python...".  In this case use the pythonw command:
-
-    $ pythonw HDFCompass.py
-           
-Note: on Mac, HDF Compass doesn't create an initial window, use the system Application
-menu to open a file or remote resource.
-    
-Packaging on OS X
------------------
-
-    $ python setup.py py2app
-    
-Packaging on Windows
---------------------
-
-Single-file:
-
-    $ pyinstaller --clean -y HDFCompass.1file.spec
-
-Single-folder (useful for debugging the `pyinstaller` settings):
-
-    $ pyinstaller --clean -y HDFCompass.1folder.spec
-    
-Other info
-----------
-
-* Github: [http://github.com/HDFGroup/hdf-compass](http://github.com/HDFGroup/hdf-compass)
-* Project page: [https://www.hdfgroup.org/projects/compass/](https://www.hdfgroup.org/projects/compass/)
-* License: BSD-like HDF Group license (See [COPYING](https://raw.githubusercontent.com/HDFGroup/hdf-compass/master/COPYING))
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..2f2a64a
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,87 @@
+HDF Compass
+===========
+
+.. image:: https://badge.fury.io/py/hdf_compass.svg
+    :target: https://badge.fury.io/py/hdf_compass
+    :alt: PyPI Status
+
+.. image:: https://readthedocs.org/projects/hdf-compass/badge/?version=stable
+    :target: http://hdf-compass.readthedocs.org/en/stable/?badge=stable
+    :alt: Stable Documentation Status
+    
+.. image:: https://readthedocs.org/projects/hdf-compass/badge/?version=latest
+    :target: http://hdf-compass.readthedocs.org/en/latest/?badge=latest
+    :alt: Latest Documentation Status
+    
+Welcome to the project!  HDF Compass is an experimental viewer program for
+HDF5 and related formats, designed to complement other more complex
+applications like HDFView.  Strong emphasis is placed on clean minimal design,
+and maximum extensibility through a plugin system for new formats.
+
+HDF Compass is written in Python, but ships as a native application on
+Windows, OS X, and Linux, by using PyInstaller and Py2App to package the app.
+
+Binary executables are available for Windows and Mac OS X (Yosemite or later) at
+the Project Page listed below.
+
+Bug reports and pull requests are welcome!  For non-trivial PRs please
+open an issue first, so the core developers can give feedback on your idea.
+
+
+
+Development Environment
+-----------------------
+
+You will need:
+
+* `Python 2.7 <https://www.python.org/downloads/>`_ *(support for Python 3.4+ in progress)*
+* `NumPy <https://github.com/numpy/numpy>`_
+* `Matplotlib <https://github.com/matplotlib/matplotlib>`_
+* `wxPython Phoenix <https://github.com/wxWidgets/Phoenix>`_ *(2.9.5.0 or later)*
+* `h5py <https://github.com/h5py/h5py>`_ *[HDF plugin]*
+* `hydroffice.bag <https://bitbucket.org/ccomjhc/hyo_bag>`_ *[BAG plugin]*
+* `Pydap <https://github.com/robertodealmeida/pydap>`_ *[OPeNDAP plugin]*
+
+For packaging the app:
+
+* `PyInstaller <https://github.com/pyinstaller/pyinstaller>`_ (Linux & Windows, experimental for OS X) *(>= 3.0)*
+* `Py2App <https://bitbucket.org/ronaldoussoren/py2app>`_ (OS X)
+
+
+Running the Program  
+-------------------
+
+    ``$ python HDFCompass.py``
+      
+      
+Note: If you are using the Anaconda distribution on the Mac, you will see the
+message: "This program needs access to the screen.  Please run with a Framework
+build of python...".  In this case use the pythonw command:
+
+    ``$ pythonw HDFCompass.py``
+           
+Note: on Mac, HDF Compass doesn't create an initial window, use the system Application
+menu to open a file or remote resource.
+    
+Packaging on OS X
+-----------------
+
+    ``$ python setup.py py2app``
+    
+Packaging on Windows
+--------------------
+
+Single-file:
+
+    ``$ pyinstaller --clean -y HDFCompass.1file.spec``
+
+Single-folder (useful for debugging the ``pyinstaller`` settings):
+
+    ``$ pyinstaller --clean -y HDFCompass.1folder.spec``
+    
+Other info
+----------
+
+* Github: `http://github.com/HDFGroup/hdf-compass <http://github.com/HDFGroup/hdf-compass>`_
+* Project page: `https://www.hdfgroup.org/projects/compass/ <https://www.hdfgroup.org/projects/compass/>`_
+* License: BSD-like HDF Group license (See `COPYING <https://raw.githubusercontent.com/HDFGroup/hdf-compass/master/COPYING>`_)
diff --git a/docs/conf.py b/docs/conf.py
index c0f31d1..f127e90 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -57,7 +57,7 @@ author = u'The HDF Group'
 # The short X.Y version.
 version = '0.6'
 # The full version, including alpha/beta/rc tags.
-release = '0.6.0'
+release = '0.6.0.dev1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/how_to_release.rst b/docs/how_to_release.rst
index a2ac6d9..4d9ff76 100644
--- a/docs/how_to_release.rst
+++ b/docs/how_to_release.rst
@@ -4,9 +4,11 @@ How to release `[developer]`
 Versioning
 ----------
 
-You need to manually modify the ``__version__`` variable in the `__init__.py` file present in ``hdf_compass.utils`` package.
+You need to install ``bumpversion``.
 
-The above version value must agree with the variables ``version`` and ``release`` present in the ``conf.py`` under the `docs` folder.
+Once installed, you can run something like: ``bumpversion --allow-dirty --new-version 0.6.0.dev0 patch``.
+
+The above release value must agree with the variable ``version`` present in the ``conf.py`` under the `docs` folder.
 
 
 PyInstaller
diff --git a/hdf_compass/utils/__init__.py b/hdf_compass/utils/__init__.py
index 35fc14d..20802d5 100644
--- a/hdf_compass/utils/__init__.py
+++ b/hdf_compass/utils/__init__.py
@@ -19,4 +19,4 @@ log.addHandler(logging.NullHandler())
 from .utils import is_darwin, is_win, is_linux, url2path, path2url, data_url
 
 
-__version__ = "1.0.5+"
+__version__ = "0.6.0.dev1"
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..9eef58c
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,20 @@
+[bumpversion]
+current_version = 0.6.0.dev1
+files = setup.py hdf_compass/utils/__init__.py docs/conf.py
+parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:\.dev(?P<dev>\d+))?
+serialize = 
+	{major}.{minor}.{patch}.dev{dev}
+	{major}.{minor}.{patch}
+
+[bumpversion:part:dev]
+values = 
+	0
+	1
+	2
+	3
+	4
+optional_value = 4
+
+[bdist_wheel]
+universal = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..38c7083
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,130 @@
+##############################################################################
+# Copyright by The HDF Group.                                                #
+# All rights reserved.                                                       #
+#                                                                            #
+# This file is part of the HDF Compass Viewer. The full HDF Compass          #
+# copyright notice, including terms governing use, modification, and         #
+# terms governing use, modification, and redistribution, is contained in     #
+# the file COPYING, which can be found at the root of the source code        #
+# distribution tree.  If you do not have access to this file, you may        #
+# request a copy from help at hdfgroup.org.                                     #
+##############################################################################
+
+""" A setuptools based setup module.
+
+See:
+https://packaging.python.org/en/latest/distributing.html
+https://github.com/pypa/sampleproject
+
+Run `python setup.py --help-commands` for available options
+"""
+
+from __future__ import absolute_import, division, print_function  # unicode_literals
+
+import os
+import sys
+# To use a consistent encoding
+from codecs import open
+
+# Always prefer setuptools over distutils
+from setuptools import setup, find_packages
+
+# ---------------------------------------------------------------------------
+#                             Some helper stuff
+# ---------------------------------------------------------------------------
+
+if 'bdist_wininst' in sys.argv:
+    if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
+        print("Error: bdist_wininst must be run alone. Exiting.")
+        sys.exit(1)
+
+here = os.path.abspath(os.path.dirname(__file__))
+
+
+def txt_read(*paths):
+    """ Build a file path from *paths* and return the textual contents """
+    with open(os.path.join(here, *paths), encoding='utf-8') as f:
+        return f.read()
+
+# ---------------------------------------------------------------------------
+#                      Populate dictionary with settings
+# ---------------------------------------------------------------------------
+
+# Create a dict with the basic information that is passed to setup after keys are added.
+setup_args = dict()
+
+setup_args['name'] = 'hdf_compass'
+# The adopted versioning scheme follow PEP40
+setup_args['version'] = '0.6.0.dev1'
+setup_args['url'] = 'https://github.com/HDFGroup/hdf-compass/'
+setup_args['license'] = 'BSD-like license'
+setup_args['author'] = 'HDFGroup'
+setup_args['author_email'] = 'help at hdfgroup.org'
+
+#
+# descriptive stuff
+#
+
+description = 'An experimental viewer program for HDF5 and related formats.'
+setup_args['description'] = description
+if 'bdist_wininst' in sys.argv:
+    setup_args['long_description'] = description
+else:
+    setup_args['long_description'] = txt_read('README.rst')
+
+setup_args['classifiers'] = \
+    [  # https://pypi.python.org/pypi?%3Aaction=list_classifiers
+        'Development Status :: 4 - Beta',
+        'Intended Audience :: Science/Research',
+        'Natural Language :: English',
+        'License :: OSI Approved :: BSD License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.7',
+        # 'Programming Language :: Python :: 3',
+        # 'Programming Language :: Python :: 3.4',
+        'Topic :: Scientific/Engineering :: Information Analysis',
+        'Topic :: Office/Business :: Office Suites',
+        'Topic :: Utilities'
+    ]
+setup_args['keywords'] = "data hdf bag ascii grid opendap"
+
+#
+# code stuff
+#
+
+# requirements
+setup_args['setup_requires'] =\
+    [
+        "setuptools",
+        "wheel",
+    ]
+setup_args['install_requires'] =\
+    [
+        "numpy",
+        "matplotlib",
+        "h5py",
+        "wxPython",
+        "hydroffice.bag",
+        "pydap"
+    ]
+# hdf_compass namespace, packages and other files
+setup_args['namespace_packages'] = ['hdf_compass']
+setup_args['packages'] = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "*.test*",
+                                                ])
+setup_args['package_data'] =\
+    {
+        '': ['icons/*.png', 'icons/*.ico', 'icons/*.icns', 'icons/*.txt'],
+    }
+setup_args['data_files'] = []
+setup_args['entry_points'] =\
+    {
+        'gui_scripts': ['HDFCompass = hdf_compass.compass_viewer.viewer:run'],
+    }
+
+# ---------------------------------------------------------------------------
+#                            Do the actual setup now
+# ---------------------------------------------------------------------------
+
+setup(**setup_args)
\ No newline at end of file
diff --git a/setup.py2app.py b/setup.py2app.py
index c2a36f2..ddd4a1c 100644
--- a/setup.py2app.py
+++ b/setup.py2app.py
@@ -11,7 +11,7 @@
 ##############################################################################
 
 """
-Setup script for HDFCompass on Mac OS X.  
+Setup script required by py2app to freeze HDFCompass on Mac OS X.
 
 Usage:
     python setup.py py2app
diff --git a/test/HDFCompassTestLog.rst b/tests/HDFCompassTestLog.rst
similarity index 100%
rename from test/HDFCompassTestLog.rst
rename to tests/HDFCompassTestLog.rst
diff --git a/test/HDFCompassTestPlan.rst b/tests/HDFCompassTestPlan.rst
similarity index 100%
rename from test/HDFCompassTestPlan.rst
rename to tests/HDFCompassTestPlan.rst

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hdf-compass.git



More information about the debian-science-commits mailing list