About
-----
This is a plugin for setuptools that enables git integration. Once
installed, Setuptools can be told to include in a package distribution
all the files tracked by git. This is an alternative to explicit
inclusion specifications with ``MANIFEST.in``.
A package distribution here refers to a package that you create using
setup.py, for example::
$> python setup.py sdist
$> python setup.py bdist_rpm
$> python setup.py bdist_egg
This package was formerly known as gitlsfiles. The name change is the
result of an effort by the setuptools plugin developers to provide a
uniform naming convention.
Installation
------------
With easy_install::
$> easy_install setuptools_git
Alternative manual installation::
$> tar -zxvf setuptools_git-X.Y.Z.tar.gz
$> cd setuptools_git-X.Y.Z
$> python setup.py install
Where X.Y.Z is a version number.
Usage
-----
To activate this plugin, you must first package your python module
with ``setup.py`` and use setuptools. The former is well documented in
the `distutils manual <http://docs.python.org/dist/dist.html>`_.
To use setuptools instead of distutils, just edit ``setup.py`` and
change:
.. code-block:: python
from distutils.core import setup
to:
.. code-block:: python
from setuptools import setup, find_packages
When Setuptools builds a source package, it always includes all files
tracked by your revision control system, if it knows how to learn what
those files are.
When Setuptools builds a binary package, you can ask it to include all
files tracked by your revision control system, by adding these argument
to your invocation of `setup()`:
.. code-block:: python
setup(...,
packages=find_packages(),
include_package_data=True,
...)
which will detect that a directory is a package if it contains a
``__init__.py`` file. Alternatively, you can do without ``__init__.py``
files and tell Setuptools explicitly which packages to process:
.. code-block:: python
setup(...,
packages=["a_package", "another_one"],
include_package_data=True,
...)
This plugin lets setuptools know what files are tracked by your git
revision control tool. Setuptools ships with support for cvs and
subversion. Other plugins like this one are available for bzr, darcs,
monotone, mercurial, and many others.
It might happen that you track files with your revision control system
that you don't want to include in your packages. In that case, you
can prevent setuptools from packaging those files with a directive in
your ``MANIFEST.in``, for example::
exclude .gitignore
recursive-exclude images *.xcf *.blend
In this example, we prevent setuptools from packaging ``.gitignore`` and
the Gimp and Blender source files found under the ``images`` directory.
Files to exclude from the package can also be listed in the `setup()`
directive. To do the same as the MANIFEST.in above, do:
.. code-block:: python
setup(...,
exclude_package_data={'': ['.gitignore'],
'images': ['*.xcf', '*.blend']},
...)
Here is another example:
.. code-block:: python
setup(...,
exclude_package_data={'': ['.gitignore', 'artwork/*'],
'model': ['config.py']},
...)
Gotchas
-------
Be aware that for this module to work properly, git and the git
meta-data must be available. That means that if someone tries to make
a package distribution out of a non-git distribution of yours, say a
tarball, setuptools will lack the information necessary to know which
files to include. A similar problem will happen if someone clones
your git repository but does not install this plugin.
Resolving those problems is out of the scope of this plugin; you
should add relevant warnings to your documentation if those situations
are a concern to you.
You can make sure that anyone who clones your git repository and uses
your setup.py file has this plugin by adding a `setup_requires`
argument:
.. code-block:: python
setup(...,
setup_requires=[ "setuptools_git >= 0.3", ],
...)
Changes
-------
1.2; 2017-02-17
~~~~~~~~~~~~~~~~
- Add ability to get version from git tags (https://github.com/msabramo/setuptools-git/pull/9)
- Return early if a directory isn't managed by git (https://github.com/msabramo/setuptools-git/pull/10)
- Support universal wheels (https://github.com/msabramo/setuptools-git/pull/11)
- Optimize directory scanning to skip ignored directories (https://github.com/msabramo/setuptools-git/pull/12)
References
----------
* `How to distribute Python modules with Distutils
<http://docs.python.org/dist/dist.html>`_
* `Setuptools complete manual
<http://peak.telecommunity.com/DevCenter/setuptools>`_
Thanks to `Zooko O'Whielacronx`_ for many improvements to the documentation.
.. _Zooko O'Whielacronx: https://bitbucket.org/zooko
Raw data
{
"_id": null,
"home_page": "https://github.com/msabramo/setuptools-git",
"name": "setuptools-git",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "distutils setuptools git",
"author": "Marc Abramowitz",
"author_email": "msabramo@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d9/c5/396c2c06cc89d4ce2d8ccf1d7e6cf31b33d4466a7c65a67a992adb3c6f29/setuptools-git-1.2.tar.gz",
"platform": "UNKNOWN",
"description": "About\n-----\n\nThis is a plugin for setuptools that enables git integration. Once\ninstalled, Setuptools can be told to include in a package distribution\nall the files tracked by git. This is an alternative to explicit\ninclusion specifications with ``MANIFEST.in``.\n\nA package distribution here refers to a package that you create using\nsetup.py, for example::\n\n $> python setup.py sdist\n $> python setup.py bdist_rpm\n $> python setup.py bdist_egg\n\nThis package was formerly known as gitlsfiles. The name change is the\nresult of an effort by the setuptools plugin developers to provide a\nuniform naming convention.\n\n\nInstallation\n------------\n\nWith easy_install::\n\n $> easy_install setuptools_git\n\nAlternative manual installation::\n\n $> tar -zxvf setuptools_git-X.Y.Z.tar.gz\n $> cd setuptools_git-X.Y.Z\n $> python setup.py install\n\nWhere X.Y.Z is a version number.\n\n\n\nUsage\n-----\n\nTo activate this plugin, you must first package your python module\nwith ``setup.py`` and use setuptools. The former is well documented in\nthe `distutils manual <http://docs.python.org/dist/dist.html>`_.\n\nTo use setuptools instead of distutils, just edit ``setup.py`` and\nchange:\n\n.. code-block:: python\n\n from distutils.core import setup\n\nto:\n\n.. code-block:: python\n\n from setuptools import setup, find_packages\n\nWhen Setuptools builds a source package, it always includes all files\ntracked by your revision control system, if it knows how to learn what\nthose files are.\n\nWhen Setuptools builds a binary package, you can ask it to include all\nfiles tracked by your revision control system, by adding these argument\nto your invocation of `setup()`:\n\n.. code-block:: python\n\n setup(...,\n packages=find_packages(),\n include_package_data=True,\n ...)\n\nwhich will detect that a directory is a package if it contains a\n``__init__.py`` file. Alternatively, you can do without ``__init__.py``\nfiles and tell Setuptools explicitly which packages to process:\n\n.. code-block:: python\n\n setup(...,\n packages=[\"a_package\", \"another_one\"],\n include_package_data=True,\n ...)\n\nThis plugin lets setuptools know what files are tracked by your git\nrevision control tool. Setuptools ships with support for cvs and\nsubversion. Other plugins like this one are available for bzr, darcs,\nmonotone, mercurial, and many others.\n\nIt might happen that you track files with your revision control system\nthat you don't want to include in your packages. In that case, you\ncan prevent setuptools from packaging those files with a directive in\nyour ``MANIFEST.in``, for example::\n\n exclude .gitignore\n recursive-exclude images *.xcf *.blend\n\nIn this example, we prevent setuptools from packaging ``.gitignore`` and\nthe Gimp and Blender source files found under the ``images`` directory.\n\nFiles to exclude from the package can also be listed in the `setup()`\ndirective. To do the same as the MANIFEST.in above, do:\n\n.. code-block:: python\n\n setup(...,\n exclude_package_data={'': ['.gitignore'],\n 'images': ['*.xcf', '*.blend']},\n ...)\n\nHere is another example:\n\n.. code-block:: python\n\n setup(...,\n exclude_package_data={'': ['.gitignore', 'artwork/*'],\n 'model': ['config.py']},\n ...)\n\n\nGotchas\n-------\n\nBe aware that for this module to work properly, git and the git\nmeta-data must be available. That means that if someone tries to make\na package distribution out of a non-git distribution of yours, say a\ntarball, setuptools will lack the information necessary to know which\nfiles to include. A similar problem will happen if someone clones\nyour git repository but does not install this plugin.\n\nResolving those problems is out of the scope of this plugin; you\nshould add relevant warnings to your documentation if those situations\nare a concern to you.\n\nYou can make sure that anyone who clones your git repository and uses\nyour setup.py file has this plugin by adding a `setup_requires`\nargument:\n\n.. code-block:: python\n\n setup(...,\n setup_requires=[ \"setuptools_git >= 0.3\", ],\n ...)\n\n\nChanges\n-------\n\n1.2; 2017-02-17\n~~~~~~~~~~~~~~~~\n - Add ability to get version from git tags (https://github.com/msabramo/setuptools-git/pull/9)\n - Return early if a directory isn't managed by git (https://github.com/msabramo/setuptools-git/pull/10)\n - Support universal wheels (https://github.com/msabramo/setuptools-git/pull/11)\n - Optimize directory scanning to skip ignored directories (https://github.com/msabramo/setuptools-git/pull/12)\n\n\nReferences\n----------\n\n* `How to distribute Python modules with Distutils\n <http://docs.python.org/dist/dist.html>`_\n\n* `Setuptools complete manual\n <http://peak.telecommunity.com/DevCenter/setuptools>`_\n\nThanks to `Zooko O'Whielacronx`_ for many improvements to the documentation.\n\n\n.. _Zooko O'Whielacronx: https://bitbucket.org/zooko",
"bugtrack_url": null,
"license": "BSD",
"summary": "Setuptools revision control system plugin for Git",
"version": "1.2",
"split_keywords": [
"distutils",
"setuptools",
"git"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f35d7a0e5100ff1871a43efdd709d11e",
"sha256": "e7764dccce7d97b4b5a330d7b966aac6f9ac026385743fd6cedad553f2494cfa"
},
"downloads": -1,
"filename": "setuptools_git-1.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "f35d7a0e5100ff1871a43efdd709d11e",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 10965,
"upload_time": "2017-02-18T00:31:15",
"upload_time_iso_8601": "2017-02-18T00:31:15.411835Z",
"url": "https://files.pythonhosted.org/packages/05/97/dd99fa9c0d9627a7b3c103a00f1566d8193aca8d473884ed258cca82b06f/setuptools_git-1.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "40b2ef7687a384ea144503c2e5bc67e2",
"sha256": "ff64136da01aabba76ae88b050e7197918d8b2139ccbf6144e14d472b9c40445"
},
"downloads": -1,
"filename": "setuptools-git-1.2.tar.gz",
"has_sig": false,
"md5_digest": "40b2ef7687a384ea144503c2e5bc67e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10546,
"upload_time": "2017-02-18T00:31:00",
"upload_time_iso_8601": "2017-02-18T00:31:00.908329Z",
"url": "https://files.pythonhosted.org/packages/d9/c5/396c2c06cc89d4ce2d8ccf1d7e6cf31b33d4466a7c65a67a992adb3c6f29/setuptools-git-1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2017-02-18 00:31:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "msabramo",
"github_project": "setuptools-git",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "setuptools-git"
}