Building and Distributing Packages with Setuptools — Setuptools documentation. For basic use of setuptools, just import things from setuptools instead of. Here’s a minimal setup script using setuptools: fromsetuptoolsimportsetup,find_packagessetup(name="Hello. World",version="0. As you can see, it doesn’t take much to use setuptools in a project. Run that script in your project folder, alongside the Python packages. Invoke that script to produce eggs, upload to.
Building and Distributing Packages with Setuptools ¶ Setuptools is a collection of enhancements to the Python distutils (for Python 2.6 and up) that allow developers. Taku Fukada’s fantastic viewer app for the Longman Dictionary of Contemporary English (LDOCE) is now available for free. Now even pathological misers who won’t. Introduction. Compiling Python on one type of system to run on another type, known as “cross-compiling”, is a notoriously difficult issue, because the Python.
Py. PI, and automatically include all packages in the directory where the. See the Command Reference section below to see what.
![Setup.Py Ignore Folder Setup.Py Ignore Folder](http://www.devilsan.com/uploads/9/9/4/6/9946022/142300536.png?102)
For example. to produce a source distribution, simply invoke: Of course, before you release your project to Py. PI, you’ll want to add a bit. And maybe your project will have grown by then to include a few. Hello. World",version="0. Project uses re. Structured. Text, so ensure that the docutils get# installed or upgraded on the target machineinstall_requires=['docutils> =0. If any package contains *.
And include any *. Py. PIauthor="Me",author_email="me@example. This is an Example Package",license="PSF",keywords="hello world example examples",url="http: //example. Hello. World/",# project home page, if any# could also include long_description, download_url, classifiers, etc.)In the sections that follow, we’ll explain what most of these setup(). Setuptools can work well with most versioning schemes; there are, however, a. Easy. Install can always tell what version of your package is newer than another.
Knowing these things will also help you correctly specify what. A version consists of an alternating series of release numbers and pre- release.
1.1 What is SpamBayes? SpamBayes is a tool used to segregate unwanted mail (spam) from the mail you want (ham). Before SpamBayes can be your spam filter of choice you. RSeQC: An RNA-seq Quality Control Package¶ RSeQC package provides a number of useful modules that can comprehensively evaluate high throughput sequence data.
A release number is a series of digits punctuated by. Each series of digits is treated. But 2. 1. 0. is the tenth subrelease of release 2, and so is a different and newer release. Leading zeros within a series of digits are also. Following a release number, you can have either a pre- release or post- release. Pre- release tags make a version be considered older than the version.
So, revision 2. 4 is newer than revision 2. Postrelease tags make. So. revisions like 2. A pre- release tag is a series of letters that are alphabetically before.
Some examples of prerelease tags would include alpha, beta. You do not have to place a dot or dash. Thus, 2. 4c. 1 and 2. In addition, there are three special prerelease tags that are treated as if. So, version. 2. 4rc. A post- release tag is either a series of letters that are alphabetically. Post- release tags are.
For example, the version. Subversion revision 1. Or you might use 2. Notice that after each pre or post- release tag, you are free to place another. For example. 0. 6a. Subversion revision 4.
Notice that dev is. But the - r. 41. 47. For the most part, setuptools’ interpretation of version numbers is intuitive. Don’t stick adjoining pre- release tags together without a dot or number.
Version 1. 9adev is the adev prerelease of 1. Use . dev instead, as in. If you want to be certain that your chosen numbering scheme works the way.
True> > > parse_version('2. True> > > parse_version('0. True. Once you’ve decided on a version numbering scheme for your project, you can.
See the following sections for more details: The following keyword arguments to setup() are added or changed by. All of them are optional; you do not have to supply them. If set to True, this tells setuptools to automatically include any. MANIFEST. in file. For more information, see the section below on.
Including Data Files. A dictionary mapping package names to lists of glob patterns that should. You can use this to trim back.
For a complete. description and examples, see the section below on Including Data Files. A dictionary mapping package names to lists of glob patterns. For a. complete description and examples, see the section below on Including. Data Files. You do not need to use this option if you are using. And are therefore not. A boolean (True or False) flag specifying whether the project can be.
If this argument is not. A string or list of strings specifying what other distributions need to. See the section below on Declaring.
Dependencies for details and examples of the format of this argument. A dictionary mapping entry point group names to strings or lists of strings. Entry points are used to support dynamic. See Dynamic. Discovery of Services and Plugins for details and examples of the format. In addition, this keyword is used to support Automatic.
Script Creation. extras_require. A dictionary mapping names of “extras” (optional features of your project). See the section below on Declaring. Dependencies for details and examples of the format of this argument. A string or list of strings specifying what other distributions need to.
Easy. Install) before processing the rest of the setup script or commands. This argument is needed if you are using distutils extensions as part of. EGG- INFO metadata files.(Note: projects listed in setup_requires will NOT be automatically. They are. simply downloaded to the ./. If you want them to be installed, as well as being available.
A list of strings naming URLs to be searched when satisfying dependencies. These links will be used if needed to install packages specified by. They will also be written into.
Easy. Install to use when installing. A list of strings naming the project’s “namespace packages”. A namespace. package is a package that may be split across multiple project. For example, Zope 3’s zope package is a namespace.
The egg runtime system can automatically. See the. section below on Namespace Packages for more information. A string naming a unittest. Test. Case subclass (or a package or module. Test. Suite. If the named suite is a module, and the module. If the named suite is a package, any. Specifying this argument enables use of the test command to run the.
See the section on the. If your project’s tests need one or more additional packages besides those. It should. be a string or list of strings specifying what other distributions need to. When you run the test. Easy. Install). Note that these. If you would like to use a different way of finding tests to run than what.
The named class must be instantiable with no arguments, and. Tests. From. Names() method as defined.
Python unittest module’s Test. Loader class. Setuptools will. The loader you specify may interpret this. The module name and class name must be separated by a .
The default. value of this argument is "setuptools. Scanning. Loader". If. you want to use the default unittest behavior, you can specify. Test. Loader" as your test_loader argument instead. This. will prevent automatic scanning of submodules and subpackages.
The module and class you specify here may be contained in another package. A list of strings naming resources that should be extracted together, if. C extensions included in the project are. This argument is only useful if the project will be installed as. Resources listed here. If you only need to obtain resources one at a time, or you don’t have any C. NOT need this argument and shouldn’t.
For more details on how this argument works, see the section. Automatic Resource Extraction. Convert the source code from Python 2 to Python 3 with 2to.
See Supporting both Python 2 and Python 3 with Setuptools for more details. List of doctest source files that need to be converted with 2to.
See Supporting both Python 2 and Python 3 with Setuptools for more details. A list of modules to search for additional fixers to be used during. See Supporting both Python 2 and Python 3 with Setuptools for more details. For simple projects, it’s usually easy enough to manually add packages to.
However, for very large projects. Twisted, PEAK, Zope, Chandler, etc.), it can be a big burden to keep the. That’s what setuptools. If omitted, the source directory defaults to.
Some projects use a src or lib. And. such projects also need something like package_dir={'': 'src'} in their. Anyway, find_packages() walks the target directory, filtering by inclusion. Python packages (any directory).
On Python 3. 2 and. Finally, exclusion patterns are applied to remove matching packages. Inclusion and exclusion patterns are package names, optionally including. For. example, find_packages(exclude=["*.
Or, find_packages(exclude=["*. In fact, if you really want no tests packages at all, you’ll need.
Really, the exclusion patterns are intended. Regardless of the parameters, the find_packages().
Especially since it frees you from having to. Packaging and installing scripts can be a bit awkward with the distutils. For. one thing, there’s no easy way to have a script’s filename match local. Windows and POSIX platforms. For another, you often have. And even in Python 2. Windows it will even create an.
PATHEXT settings. The way to use this feature is to define “entry points” in your setup script. For. example, to create two console scripts called foo and bar, and a GUI.
When this project is installed on non- Windows platforms (using “setup. Easy. Install), a set of foo. The functions you specify are called. On Windows, a set of foo. The. . exe wrappers find and execute the right version of Python to run the. You may define as many “console script” and “gui script” entry points as you. For more information on.
Declaring Extras. For more information. Dynamic Discovery of. Services and Plugins.
Occasionally, there are situations where it’s desirable to make an . You can do this by including an entry point such.
Any eggs built from the above setup script will include a short executable. The prelude can be run on Unix- like platforms (including Mac and Linux) by. For the executable prelude to run, the appropriate version of.
Python must be available via the PATH environment variable, under its. That is, if the egg is built for Python 2. PATH. This feature is primarily intended to support ez_setup the installation of. Windows platforms, but may also be useful for other. IMPORTANT NOTE: Eggs with an “eggsecutable” header cannot be renamed, or. They must be invoked using their original filename, in.
The header script will check this and exit with an.