[Python-modules-commits] [whichcraft] 01/04: import whichcraft_0.1.1.orig.tar.gz

Vincent Bernat bernat at moszumanska.debian.org
Fri Oct 9 21:07:25 UTC 2015


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

bernat pushed a commit to branch master
in repository whichcraft.

commit fd4b97220e7f077ba4c86503e790f86e4e73575c
Author: Vincent Bernat <bernat at debian.org>
Date:   Fri Oct 9 22:57:56 2015 +0200

    import whichcraft_0.1.1.orig.tar.gz
---
 AUTHORS.rst                              |  13 ++++
 CONTRIBUTING.rst                         | 111 +++++++++++++++++++++++++++++++
 HISTORY.rst                              |  13 ++++
 LICENSE                                  |  12 ++++
 MANIFEST.in                              |   8 +++
 PKG-INFO                                 |  81 ++++++++++++++++++++++
 README.rst                               |  46 +++++++++++++
 setup.cfg                                |  11 +++
 setup.py                                 |  68 +++++++++++++++++++
 whichcraft.egg-info/PKG-INFO             |  81 ++++++++++++++++++++++
 whichcraft.egg-info/SOURCES.txt          |  14 ++++
 whichcraft.egg-info/dependency_links.txt |   1 +
 whichcraft.egg-info/not-zip-safe         |   1 +
 whichcraft.egg-info/top_level.txt        |   1 +
 whichcraft.py                            |  79 ++++++++++++++++++++++
 15 files changed, 540 insertions(+)

diff --git a/AUTHORS.rst b/AUTHORS.rst
new file mode 100644
index 0000000..562f390
--- /dev/null
+++ b/AUTHORS.rst
@@ -0,0 +1,13 @@
+=======
+Credits
+=======
+
+Development Lead
+----------------
+
+* Daniel Roy Greenfeld <pydanny at gmail.com>
+
+Contributors
+------------
+
+None yet. Why not be the first?
\ No newline at end of file
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 0000000..024b002
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,111 @@
+============
+Contributing
+============
+
+Contributions are welcome, and they are greatly appreciated! Every
+little bit helps, and credit will always be given.
+
+You can contribute in many ways:
+
+Types of Contributions
+----------------------
+
+Report Bugs
+~~~~~~~~~~~
+
+Report bugs at https://github.com/pydanny/whichcraft/issues.
+
+If you are reporting a bug, please include:
+
+* Your operating system name and version.
+* Any details about your local setup that might be helpful in troubleshooting.
+* Detailed steps to reproduce the bug.
+
+Fix Bugs
+~~~~~~~~
+
+Look through the GitHub issues for bugs. Anything tagged with "bug"
+is open to whoever wants to implement it.
+
+Implement Features
+~~~~~~~~~~~~~~~~~~
+
+Look through the GitHub issues for features. Anything tagged with "feature"
+is open to whoever wants to implement it.
+
+Write Documentation
+~~~~~~~~~~~~~~~~~~~
+
+whichcraft could always use more documentation, whether as part of the
+official whichcraft docs, in docstrings, or even on the web in blog posts,
+articles, and such.
+
+Submit Feedback
+~~~~~~~~~~~~~~~
+
+The best way to send feedback is to file an issue at https://github.com/pydanny/whichcraft/issues.
+
+If you are proposing a feature:
+
+* Explain in detail how it would work.
+* Keep the scope as narrow as possible, to make it easier to implement.
+* Remember that this is a volunteer-driven project, and that contributions
+  are welcome :)
+
+Get Started!
+------------
+
+Ready to contribute? Here's how to set up `whichcraft` for local development.
+
+1. Fork the `whichcraft` repo on GitHub.
+2. Clone your fork locally::
+
+    $ git clone git at github.com:your_name_here/whichcraft.git
+
+3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
+
+    $ mkvirtualenv whichcraft
+    $ cd whichcraft/
+    $ python setup.py develop
+
+4. Create a branch for local development::
+
+    $ git checkout -b name-of-your-bugfix-or-feature
+
+   Now you can make your changes locally.
+
+5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
+
+    $ flake8 whichcraft.py test_whichcraft.py
+    $ py.test
+    $ tox
+
+   To get flake8 and tox, just pip install them into your virtualenv.
+
+6. Commit your changes and push your branch to GitHub::
+
+    $ git add .
+    $ git commit -m "Your detailed description of your changes."
+    $ git push origin name-of-your-bugfix-or-feature
+
+7. Submit a pull request through the GitHub website.
+
+Pull Request Guidelines
+-----------------------
+
+Before you submit a pull request, check that it meets these guidelines:
+
+1. The pull request should include tests.
+2. If the pull request adds functionality, the docs should be updated. Put
+   your new functionality into a function with a docstring, and add the
+   feature to the list in README.rst.
+3. The pull request should work for Python 2.6, 2.7, 3.3, and 3.4, and for PyPy. Check
+   https://travis-ci.org/pydanny/whichcraft/pull_requests
+   and make sure that the tests pass for all supported Python versions.
+
+Tips
+----
+
+To run a subset of tests::
+
+    TODO
\ No newline at end of file
diff --git a/HISTORY.rst b/HISTORY.rst
new file mode 100644
index 0000000..0399378
--- /dev/null
+++ b/HISTORY.rst
@@ -0,0 +1,13 @@
+History
+=========
+
+
+0.1.1 (2015-09-09)
+---------------------
+
+* Added lyrics
+
+0.1.0 (2015-09-09)
+---------------------
+
+* First release on PyPI.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5daad23
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,12 @@
+Copyright (c) 2015, Daniel Roy Greenfeld
+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 whichcraft 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 HOLDER 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 PROF [...]
\ No newline at end of file
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..4ac7293
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+include AUTHORS.rst
+include CONTRIBUTING.rst
+include HISTORY.rst
+include LICENSE
+include README.rst
+
+recursive-exclude * __pycache__
+recursive-exclude * *.py[co]
\ No newline at end of file
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..4ca03b8
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,81 @@
+Metadata-Version: 1.1
+Name: whichcraft
+Version: 0.1.1
+Summary: This package provides cross-platform cross-python shutil.which functionality.
+Home-page: https://github.com/pydanny/whichcraft
+Author: Daniel Roy Greenfeld
+Author-email: pydanny at gmail.com
+License: BSD
+Description: ===============================
+        whichcraft
+        ===============================
+        
+        .. image:: https://badge.fury.io/py/whichcraft.png
+            :target: http://badge.fury.io/py/whichcraft
+        
+        .. image:: https://travis-ci.org/pydanny/whichcraft.png?branch=master
+                :target: https://travis-ci.org/pydanny/whichcraft
+        
+        ::
+        
+            That code in my care
+            That sly command-line stare
+            That strips my operating system bare
+            It's whichcraft
+        
+        This package provides cross-platform cross-python ``shutil.which`` functionality.
+        
+        Usage
+        =====
+        
+        On Linux, Mac, Windows for Python 2.6, 2.7, or any of the 3s:
+        
+        .. code-block:: python
+        
+            >>> from whichcraft import which
+            >>> which('date')
+            '/bin/date'
+            >>> which('calendar')
+            '/bin/calendar'
+            >>> which('cookiecutter')
+            '/Users/pydanny/.envs/fun/bin/cookiecutter'
+            >>> which('a-made-up-name') is None
+            True
+        
+        
+        Notes
+        =====
+        
+        This is a shim of the ``shutil.which`` function that's designed to work across
+        multiple versions of Python and inside of windows. The code for Python 2.x is
+        based on Python 3 code that I extracted from source. I originally did this for
+        Cookiecutter_ but pulled it out in order to reduce line count for that project.
+        
+        .. _Cookiecutter: https://github.com/audreyr/cookiecutter
+        
+        
+        History
+        =========
+        
+        
+        0.1.1 (2015-09-09)
+        ---------------------
+        
+        * Added lyrics
+        
+        0.1.0 (2015-09-09)
+        ---------------------
+        
+        * First release on PyPI.
+        
+Keywords: whichcraft
+Platform: UNKNOWN
+Classifier: Development Status :: 2 - Pre-Alpha
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Natural Language :: English
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..acfd204
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,46 @@
+===============================
+whichcraft
+===============================
+
+.. image:: https://badge.fury.io/py/whichcraft.png
+    :target: http://badge.fury.io/py/whichcraft
+
+.. image:: https://travis-ci.org/pydanny/whichcraft.png?branch=master
+        :target: https://travis-ci.org/pydanny/whichcraft
+
+::
+
+    That code in my care
+    That sly command-line stare
+    That strips my operating system bare
+    It's whichcraft
+
+This package provides cross-platform cross-python ``shutil.which`` functionality.
+
+Usage
+=====
+
+On Linux, Mac, Windows for Python 2.6, 2.7, or any of the 3s:
+
+.. code-block:: python
+
+    >>> from whichcraft import which
+    >>> which('date')
+    '/bin/date'
+    >>> which('calendar')
+    '/bin/calendar'
+    >>> which('cookiecutter')
+    '/Users/pydanny/.envs/fun/bin/cookiecutter'
+    >>> which('a-made-up-name') is None
+    True
+
+
+Notes
+=====
+
+This is a shim of the ``shutil.which`` function that's designed to work across
+multiple versions of Python and inside of windows. The code for Python 2.x is
+based on Python 3 code that I extracted from source. I originally did this for
+Cookiecutter_ but pulled it out in order to reduce line count for that project.
+
+.. _Cookiecutter: https://github.com/audreyr/cookiecutter
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..414c525
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,11 @@
+[wheel]
+universal = 1
+
+[bdist_wheel]
+universal = 1
+
+[egg_info]
+tag_build = 
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..cbe7f7f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+
+try:
+    from setuptools import setup
+except ImportError:
+    from distutils.core import setup
+
+version = "0.1.1"
+
+if sys.argv[-1] == 'publish':
+    try:
+        import wheel
+    except ImportError:
+        raise ImportError("Fix: pip install wheel")
+    os.system('python setup.py sdist bdist_wheel upload')
+    print("You probably want to also tag the version now:")
+    print("  git tag -a %s -m 'version %s'" % (version, version))
+    print("  git push --tags")
+    sys.exit()
+
+if sys.argv[-1] == 'tag':
+    print("Tagging the version on github:")
+    os.system("git tag -a %s -m 'version %s'" % (version, version))
+    os.system("git push --tags")
+    sys.exit()
+
+readme = open('README.rst').read()
+history = open('HISTORY.rst').read().replace('.. :changelog:', '')
+
+def get_requirements(filename):
+    f = open(filename).read()
+    reqs = [
+            # loop through list of requirements
+            x.strip() for x in f.splitlines()
+                # filter out comments and empty lines
+                if not x.strip().startswith('#')
+            ]
+    return reqs
+
+setup(
+    name='whichcraft',
+    version=version,
+    description="""This package provides cross-platform cross-python shutil.which functionality.""",
+    long_description=readme + '\n\n' + history,
+    author='Daniel Roy Greenfeld',
+    author_email='pydanny at gmail.com',
+    url='https://github.com/pydanny/whichcraft',
+    include_package_data=True,
+    py_modules=['whichcraft'],
+    license="BSD",
+    zip_safe=False,
+    keywords='whichcraft',
+    classifiers=[
+        'Development Status :: 2 - Pre-Alpha',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: BSD License',
+        'Natural Language :: English',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
+    ],
+)
diff --git a/whichcraft.egg-info/PKG-INFO b/whichcraft.egg-info/PKG-INFO
new file mode 100644
index 0000000..4ca03b8
--- /dev/null
+++ b/whichcraft.egg-info/PKG-INFO
@@ -0,0 +1,81 @@
+Metadata-Version: 1.1
+Name: whichcraft
+Version: 0.1.1
+Summary: This package provides cross-platform cross-python shutil.which functionality.
+Home-page: https://github.com/pydanny/whichcraft
+Author: Daniel Roy Greenfeld
+Author-email: pydanny at gmail.com
+License: BSD
+Description: ===============================
+        whichcraft
+        ===============================
+        
+        .. image:: https://badge.fury.io/py/whichcraft.png
+            :target: http://badge.fury.io/py/whichcraft
+        
+        .. image:: https://travis-ci.org/pydanny/whichcraft.png?branch=master
+                :target: https://travis-ci.org/pydanny/whichcraft
+        
+        ::
+        
+            That code in my care
+            That sly command-line stare
+            That strips my operating system bare
+            It's whichcraft
+        
+        This package provides cross-platform cross-python ``shutil.which`` functionality.
+        
+        Usage
+        =====
+        
+        On Linux, Mac, Windows for Python 2.6, 2.7, or any of the 3s:
+        
+        .. code-block:: python
+        
+            >>> from whichcraft import which
+            >>> which('date')
+            '/bin/date'
+            >>> which('calendar')
+            '/bin/calendar'
+            >>> which('cookiecutter')
+            '/Users/pydanny/.envs/fun/bin/cookiecutter'
+            >>> which('a-made-up-name') is None
+            True
+        
+        
+        Notes
+        =====
+        
+        This is a shim of the ``shutil.which`` function that's designed to work across
+        multiple versions of Python and inside of windows. The code for Python 2.x is
+        based on Python 3 code that I extracted from source. I originally did this for
+        Cookiecutter_ but pulled it out in order to reduce line count for that project.
+        
+        .. _Cookiecutter: https://github.com/audreyr/cookiecutter
+        
+        
+        History
+        =========
+        
+        
+        0.1.1 (2015-09-09)
+        ---------------------
+        
+        * Added lyrics
+        
+        0.1.0 (2015-09-09)
+        ---------------------
+        
+        * First release on PyPI.
+        
+Keywords: whichcraft
+Platform: UNKNOWN
+Classifier: Development Status :: 2 - Pre-Alpha
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Natural Language :: English
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
diff --git a/whichcraft.egg-info/SOURCES.txt b/whichcraft.egg-info/SOURCES.txt
new file mode 100644
index 0000000..9a3359d
--- /dev/null
+++ b/whichcraft.egg-info/SOURCES.txt
@@ -0,0 +1,14 @@
+AUTHORS.rst
+CONTRIBUTING.rst
+HISTORY.rst
+LICENSE
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+whichcraft.py
+whichcraft.egg-info/PKG-INFO
+whichcraft.egg-info/SOURCES.txt
+whichcraft.egg-info/dependency_links.txt
+whichcraft.egg-info/not-zip-safe
+whichcraft.egg-info/top_level.txt
\ No newline at end of file
diff --git a/whichcraft.egg-info/dependency_links.txt b/whichcraft.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/whichcraft.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/whichcraft.egg-info/not-zip-safe b/whichcraft.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/whichcraft.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/whichcraft.egg-info/top_level.txt b/whichcraft.egg-info/top_level.txt
new file mode 100644
index 0000000..ed6248d
--- /dev/null
+++ b/whichcraft.egg-info/top_level.txt
@@ -0,0 +1 @@
+whichcraft
diff --git a/whichcraft.py b/whichcraft.py
new file mode 100644
index 0000000..0eded9c
--- /dev/null
+++ b/whichcraft.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+
+__author__ = 'Daniel Roy Greenfeld'
+__email__ = 'pydanny at gmail.com'
+__version__ = '0.1.1'
+
+
+import os
+import sys
+
+PY3 = sys.version_info[0] == 3
+
+
+if PY3:  # Forced testing
+
+    from shutil import which
+
+else:  # Forced testing
+
+    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
+        """Given a command, mode, and a PATH string, return the path which
+        conforms to the given mode on the PATH, or None if there is no such
+        file.
+        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
+        of os.environ.get("PATH"), or can be overridden with a custom search
+        path.
+        Note: This function was backported from the Python 3 source code.
+        """
+        # Check that a given file can be accessed with the correct mode.
+        # Additionally check that `file` is not a directory, as on Windows
+        # directories pass the os.access check.
+        def _access_check(fn, mode):
+            return (os.path.exists(fn) and os.access(fn, mode) and
+                    not os.path.isdir(fn))
+
+        # If we're given a path with a directory part, look it up directly
+        # rather than referring to PATH directories. This includes checking
+        # relative to the current directory, e.g. ./script
+        if os.path.dirname(cmd):
+            if _access_check(cmd, mode):
+                return cmd
+            return None
+
+        if path is None:
+            path = os.environ.get("PATH", os.defpath)
+        if not path:
+            return None
+        path = path.split(os.pathsep)
+
+        if sys.platform == "win32":
+            # The current directory takes precedence on Windows.
+            if os.curdir not in path:
+                path.insert(0, os.curdir)
+
+            # PATHEXT is necessary to check on Windows.
+            pathext = os.environ.get("PATHEXT", "").split(os.pathsep)
+            # See if the given file matches any of the expected path
+            # extensions. This will allow us to short circuit when given
+            # "python.exe". If it does match, only test that one, otherwise we
+            # have to try others.
+            if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
+                files = [cmd]
+            else:
+                files = [cmd + ext for ext in pathext]
+        else:
+            # On other platforms you don't have things like PATHEXT to tell you
+            # what file suffixes are executable, so just pass on cmd as-is.
+            files = [cmd]
+
+        seen = set()
+        for dir in path:
+            normdir = os.path.normcase(dir)
+            if normdir not in seen:
+                seen.add(normdir)
+                for thefile in files:
+                    name = os.path.join(dir, thefile)
+                    if _access_check(name, mode):
+                        return name
+        return None

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/whichcraft.git



More information about the Python-modules-commits mailing list