archive-com.com » COM » T » TELECOMMUNITY.COM

Total: 388

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • PEAK API Reference: ez_setup
    definition ez setup svn svn eby sarna com svnroot ez setup You can set this by executing this command in your project directory svn propedit svn externals And then adding the line shown above to the file that comes up for editing Then whenever you update your project ez setup will be updated as well Modules and Packages ez setup README txt html This directory exists so that Subversion based

    Original URL path: http://peak.telecommunity.com/doc/ez_setup/index.html (2016-04-24)
    Open archived version from archive


  • Module: setup
    file Imported modules import ez setup import os from setuptools import setup Extension Feature find packages import sys Table of Contents This document was automatically generated on Mon Apr 18

    Original URL path: http://peak.telecommunity.com/doc/home/telec3/PEAK/docs/html/reference/setup.html (2016-04-24)
    Open archived version from archive

  • PEAK API Reference: peak
    and co operative multitasking support exceptions PEAK Exceptions metamodels Metamodelling CASE Tools model A framework for creating persistent application domain objects naming Object Naming subsystem analagous to Java s JNDI javax naming net Network protocol implementations and other network related features persistence Provide access to Persistent C extension types query PEAK Query Framework running Runtime environment tools for logging locking process control etc security PEAK s security software really just

    Original URL path: http://peak.telecommunity.com/doc/src/peak/index.html (2016-04-24)
    Open archived version from archive

  • FrontPage - The PEAK Developers' Center
    previous core modules the runtime modules provide most of the machinery needed for building PEAK applications The storage module provides numerous storage management features including high level relational database connectivity a general transaction framework with ACID assurance and two phase commit and a DataManager framework for high level object persistence to multiple storage media The model module provides a framework for implementing the DomainModel pattern which is based on high level business objects isolated from storage concerns The events module provides an event driven programming framework that supports ultralight microthreads implemented via generators It can stand alone or can be used atop Twisted for a more intuitive approach to asynchronous programming Further modules to explore include the util metamodels and security modules The web net and query modules are under development Additional notes in GettingStartedWithPeak Tutorials The IntroToPeak tutorial is currently the best way to get started with PEAK It demonstrates the use of many of PEAK s features by building a small application step by step Other tutorials include PeakDatabaseApplications ComposingHierarchies TwistedPeak example Using ZopePageTemplates with peak web PeakFromBasics a new tutorial currently barely started which will develop an application from scratch PeakWebHowTo introduction to peak web functionality Concepts

    Original URL path: http://peak.telecommunity.com/DevCenter/FrontPage?action=print (2016-04-24)
    Open archived version from archive

  • TitleIndex - The PEAK Developers' Center
    AddingPsycopgSupport AsyncWSGISketch B BytecodeAssembler C CategoryCategory CategoryHomepage ChandlerSchemaAPI ChandlerSharingModel CombiningResults ComposingHierarchies CookBook CreatingDomainModels Crosscuts D DatabaseReferences DecoratorTools DistributePeakApplications DomainModelDesignPattern DomainModelReferences E EasyInstall EccoChemistry EccoDDE EggFormats EventStats EventStats HitCounts EventStats UserAgents F FindPage FrontPage G GettingStartedWithPeak Glossary GraphViz GraphvizTutorial H HelloWorld HelpContents HelpForBeginners HelpForDevelopers HelpIndex HelpMiscellaneous HelpMiscellaneous FrequentlyAskedQuestions HelpOnActions HelpOnActions AttachFile HelpOnAdministration HelpOnConfiguration HelpOnConfiguration EmailSupport HelpOnConfiguration SecurityPolicy HelpOnEditing HelpOnEditing SubPages HelpOnFormatting HelpOnHeadlines HelpOnLinking HelpOnLists HelpOnMacros HelpOnNavigation HelpOnPageCreation HelpOnPageDeletion HelpOnProcessingInstructions HelpOnProcessors HelpOnRules HelpOnSkins HelpOnSmileys HelpOnSpellCheck HelpOnTables HelpOnUpdating HelpOnUserPreferences HelpOnXmlPages HelpTemplate HilfeZuAktionen DateiAnhänge HomepageTemplate I Importing InterWiki IntroToPeak IntroToPeak LessonFive IntroToPeak LessonFour IntroToPeak LessonOne IntroToPeak LessonThree IntroToPeak LessonTwo IntroToPeak ToDo InversionOfControl IrcHighlights IrcHighlightsFiveTips L LocalSpellingWords M MailingListHighlights MiscNotes MoinMoin MoinMoin InstallDocs MonkeyTyping N NamingSystem O OptionsHowTo OrphanedPages P PEAK Rules PEAK Rules AST Builder PEAK Rules Code Generation PEAK Rules Criteria PEAK Rules Design PEAK Rules Indexing PEAK Rules Predicates PEAK Rules Syntax Matching PackageIndexAPI PackageNotes PageSize PatternsOfEnterpriseApplicationArchitecture PeakDatabaseApplications PeakFromBasics PeakFromBasics LessonOne PeakWebHowTo PkgResources ProtocolSubsets PyConGenericFunctions Python25 Python4Suite PythonEggs PythonPlugins R RandomPage RecentChanges RestSandbox RulesDesign RulesReadme S SecurityRules ShortIntroPeakSecurity SiteNavigation SqlDm StructuralFeature StructuredText SymbolType SystemInfo T TestDir AFile html TestDir anotherFile html TestPage1 html TestPage2 html TitleIndex Trellis TrellisActivity TrellisCollections TrellisPorting TrellisSTM TwistedDeferredForPeakEvents TwistedPeak U UnitTrace UserPreferences V VisitorRevisited W WantedPages WikiHomePage WikiName

    Original URL path: http://peak.telecommunity.com/DevCenter/TitleIndex (2016-04-24)
    Open archived version from archive

  • WordIndex - The PEAK Developers' Center
    Code Generation Generic PyConGenericFunctions Getting GettingStartedWithPeak Glossary Glossary Graph GraphViz Graphviz GraphvizTutorial H Headlines HelpOnHeadlines Hello HelloWorld Help HelpContents HelpForBeginners HelpForDevelopers HelpIndex HelpMiscellaneous HelpMiscellaneous FrequentlyAskedQuestions HelpOnActions HelpOnActions AttachFile HelpOnAdministration HelpOnConfiguration HelpOnConfiguration EmailSupport HelpOnConfiguration SecurityPolicy HelpOnEditing HelpOnEditing SubPages HelpOnFormatting HelpOnHeadlines HelpOnLinking HelpOnLists HelpOnMacros HelpOnNavigation HelpOnPageCreation HelpOnPageDeletion HelpOnProcessingInstructions HelpOnProcessors HelpOnRules HelpOnSkins HelpOnSmileys HelpOnSpellCheck HelpOnTables HelpOnUpdating HelpOnUserPreferences HelpOnXmlPages HelpTemplate Hierarchies ComposingHierarchies Highlights IrcHighlights IrcHighlightsFiveTips MailingListHighlights Hilfe HilfeZuAktionen DateiAnhänge Hit EventStats HitCounts Home WikiHomePage Homepage CategoryHomepage HomepageTemplate How OptionsHowTo PeakWebHowTo I Importing Importing Index HelpIndex PackageIndexAPI TitleIndex WordIndex Indexing PEAK Rules Indexing Info SystemInfo Install EasyInstall MoinMoin InstallDocs Instructions HelpOnProcessingInstructions Inter InterWiki Interfaces WritingInterfaces Intro IntroToPeak IntroToPeak LessonFive IntroToPeak LessonFour IntroToPeak LessonOne IntroToPeak LessonThree IntroToPeak LessonTwo IntroToPeak ToDo ShortIntroPeakSecurity Inversion InversionOfControl Irc IrcHighlights IrcHighlightsFiveTips L Lesson IntroToPeak LessonFive IntroToPeak LessonFour IntroToPeak LessonOne IntroToPeak LessonThree IntroToPeak LessonTwo PeakFromBasics LessonOne Linking HelpOnLinking List MailingListHighlights Lists HelpOnLists Local LocalSpellingWords M Macros HelpOnMacros Mailing MailingListHighlights Matching PEAK Rules Syntax Matching Misc MiscNotes Miscellaneous HelpMiscellaneous HelpMiscellaneous FrequentlyAskedQuestions Model ChandlerSharingModel DomainModelDesignPattern DomainModelReferences Models CreatingDomainModels Moin MoinMoin MoinMoin InstallDocs Monkey MonkeyTyping N Name WikiName Naming NamingSystem Navigation HelpOnNavigation SiteNavigation Notes MiscNotes PackageNotes O Of InversionOfControl PatternsOfEnterpriseApplicationArchitecture On HelpOnActions HelpOnActions AttachFile HelpOnAdministration HelpOnConfiguration HelpOnConfiguration EmailSupport HelpOnConfiguration SecurityPolicy HelpOnEditing HelpOnEditing SubPages HelpOnFormatting HelpOnHeadlines HelpOnLinking HelpOnLists HelpOnMacros HelpOnNavigation HelpOnPageCreation HelpOnPageDeletion HelpOnProcessingInstructions HelpOnProcessors HelpOnRules HelpOnSkins HelpOnSmileys HelpOnSpellCheck HelpOnTables HelpOnUpdating HelpOnUserPreferences HelpOnXmlPages One IntroToPeak LessonOne PeakFromBasics LessonOne Options OptionsHowTo Orphaned OrphanedPages P Package PackageIndexAPI PackageNotes Page FindPage FrontPage HelpOnPageCreation HelpOnPageDeletion PageSize RandomPage WikiHomePage ZopePageTemplates Page1 TestPage1 html Page2 TestPage2 html Pages AbandonedPages HelpOnEditing SubPages HelpOnXmlPages OrphanedPages WantedPages Pattern DomainModelDesignPattern Patterns PatternsOfEnterpriseApplicationArchitecture Peak DistributePeakApplications GettingStartedWithPeak IntroToPeak IntroToPeak LessonFive IntroToPeak LessonFour IntroToPeak LessonOne IntroToPeak LessonThree IntroToPeak LessonTwo IntroToPeak ToDo PeakDatabaseApplications PeakFromBasics PeakFromBasics LessonOne PeakWebHowTo ShortIntroPeakSecurity TwistedDeferredForPeakEvents TwistedPeak Pkg PkgResources Plugins PythonPlugins Policy HelpOnConfiguration SecurityPolicy Porting TrellisPorting Predicates PEAK Rules Predicates Preferences HelpOnUserPreferences UserPreferences Processing HelpOnProcessingInstructions Processors HelpOnProcessors Protocol

    Original URL path: http://peak.telecommunity.com/DevCenter/WordIndex (2016-04-24)
    Open archived version from archive

  • setuptools - The PEAK Developers' Center
    Locations You should inform your users that if they are installing your project to somewhere other than the main site packages directory they should first install setuptools using the instructions for Custom Installation Locations before installing your project Your Project s Dependencies If your project depends on other projects that may need to be downloaded from PyPI or elsewhere you should list them in your installation instructions or tell users how to find out what they are While most users will not need this information any users who don t have unrestricted internet access may have to find download and install the other projects manually Note however that they must still install those projects using easy install or your project will not know they are installed and your setup script will try to download them again If you want to be especially friendly to users with limited network access you may wish to build eggs for your project and its dependencies making them all available for download from your site or at least create a page with links to all of the needed eggs In this way users with limited network access can manually download all the eggs to a single directory then use the f option of easy install to specify the directory to find eggs in Users who have full network access can just use f with the URL of your download page and easy install will find all the needed eggs using your links directly This is also useful when your target audience isn t able to compile packages e g most Windows users and your package or some of its dependencies include C code Subversion or CVS Users and Co Developers Users and co developers who are tracking your in development code using CVS Subversion or some other revision control system should probably read this manual s sections regarding such development Alternately you may wish to create a quick reference guide containing the tips from this manual that apply to your particular situation For example if you recommend that people use setup py develop when tracking your in development code you should let them know that this needs to be run after every update or commit Similarly if you remove modules or data files from your project you should remind them to run setup py clean all and delete any obsolete pyc or pyo This tip applies to the distutils in general not just setuptools but not everybody knows about them be kind to your users by spelling out your project s best practices rather than leaving them guessing Creating System Packages Some users want to manage all Python packages using a single package manager and sometimes that package manager isn t easy install Setuptools currently supports bdist rpm bdist wininst and bdist dumb formats for system packaging If a user has a locally installed bdist packaging tool that internally uses the distutils install command it should be able to work with setuptools Some examples of bdist formats that this should work with include the bdist nsi and bdist msi formats for Windows However packaging tools that build binary distributions by running setup py install on the command line or as a subprocess will require modification to work with setuptools They should use the single version externally managed option to the install command combined with the standard root or record options See the install command documentation below for more details The bdist deb command is an example of a command that currently requires this kind of patching to work with setuptools If you or your users have a problem building a usable system package for your project please report the problem via the mailing list so that either the bdist tool in question or setuptools can be modified to resolve the issue Managing Multiple Projects If you re managing several projects that need to use ez setup and you are using Subversion as your revision control system you can use the svn externals property to share a single copy of ez setup between projects so that it will always be up to date whenever you check out or update an individual project without having to manually update each project to use a new version However because Subversion only supports using directories as externals you have to turn ez setup py into ez setup init py in order to do this then create externals definitions that map the ez setup directory into each project Also if any of your projects use find packages on their setup directory you will need to exclude the resulting ez setup package to keep it from being included in your distributions e g setup packages find packages exclude ez setup Of course the ez setup package will still be included in your packages source distributions as it needs to be For your convenience you may use the following external definition which will track the latest version of setuptools ez setup svn svn eby sarna com svnroot ez setup You can set this by executing this command in your project directory svn propedit svn externals And then adding the line shown above to the file that comes up for editing Setting the zip safe flag For maximum performance Python packages are best installed as zip files Not all packages however are capable of running in compressed form because they may expect to be able to access either source code or data files as normal operating system files So setuptools can install your project as a zipfile or a directory and its default choice is determined by the project s zip safe flag You can pass a True or False value for the zip safe argument to the setup function or you can omit it If you omit it the bdist egg command will analyze your project s contents to see if it can detect any conditions that would prevent it from working in a zipfile It will output notices to the console about any such conditions that it finds Currently this analysis is extremely conservative it will consider the project unsafe if it contains any C extensions or datafiles whatsoever This does not mean that the project can t or won t work as a zipfile It just means that the bdist egg authors aren t yet comfortable asserting that the project will work If the project contains no C or data files and does no file or path introspection or source code manipulation then there is an extremely solid chance the project will work when installed as a zipfile And if the project uses pkg resources for all its data file access then C extensions and other data files shouldn t be a problem at all See the Accessing Data Files at Runtime section above for more information However if bdist egg can t be sure that your package will work but you ve checked over all the warnings it issued and you are either satisfied it will work or if you want to try it for yourself then you should set zip safe to True in your setup call If it turns out that it doesn t work you can always change it to False which will force setuptools to install your project as a directory rather than as a zipfile Of course the end user can still override either decision if they are using EasyInstall to install your package And if you want to override for testing purposes you can just run setup py easy install zip ok or setup py easy install always unzip in your project directory to install the package as a zipfile or directory respectively In the future as we gain more experience with different packages and become more satisfied with the robustness of the pkg resources runtime the zip safety analysis may become less conservative However we strongly recommend that you determine for yourself whether your project functions correctly when installed as a zipfile correct any problems if you can and then make an explicit declaration of True or False for the zip safe flag so that it will not be necessary for bdist egg or EasyInstall to try to guess whether your project can work as a zipfile Namespace Packages Sometimes a large package is more useful if distributed as a collection of smaller eggs However Python does not normally allow the contents of a package to be retrieved from more than one location Namespace packages are a solution for this problem When you declare a package to be a namespace package it means that the package has no meaningful contents in its init py and that it is merely a container for modules and subpackages The pkg resources runtime will then automatically ensure that the contents of namespace packages that are spread over multiple eggs or directories are combined into a single virtual package The namespace packages argument to setup lets you declare your project s namespace packages so that they will be included in your project s metadata The argument should list the namespace packages that the egg participates in For example the ZopeInterface project might do this setup namespace packages zope because it contains a zope interface package that lives in the zope namespace package Similarly a project for a standalone zope publisher would also declare the zope namespace package When these projects are installed and used Python will see them both as part of a virtual zope package even though they will be installed in different locations Namespace packages don t have to be top level packages For example Zope 3 s zope app package is a namespace package and in the future PEAK s peak util package will be too Note by the way that your project s source tree must include the namespace packages init py files and the init py of any parent packages in a normal Python package layout These init py files must contain the line import pkg resources declare namespace name This code ensures that the namespace package machinery is operating and that the current package is registered as a namespace package You must NOT include any other code and data in a namespace package s init py Even though it may appear to work during development or when projects are installed as egg files it will not work when the projects are installed using system packaging tools in such cases the init py files will not be installed let alone executed You must include the declare namespace line in the init py of every project that has contents for the namespace package in question in order to ensure that the namespace will be declared regardless of which project s copy of init py is loaded first If the first loaded init py doesn t declare it it will never be declared because no other copies will ever be loaded TRANSITIONAL NOTE Setuptools 0 6a automatically calls declare namespace for you at runtime but the 0 7a versions will not This is because the automatic declaration feature has some negative side effects such as needing to import all namespace packages during the initialization of the pkg resources runtime and also the need for pkg resources to be explicitly imported before any namespace packages work at all Beginning with the 0 7a releases you ll be responsible for including your own declaration lines and the automatic declaration feature will be dropped to get rid of the negative side effects During the remainder of the 0 6 development cycle therefore setuptools will warn you about missing declare namespace calls in your init py files and you should correct these as soon as possible before setuptools 0 7a1 is released Namespace packages without declaration lines will not work correctly once a user has upgraded to setuptools 0 7a1 so it s important that you make this change now in order to avoid having your code break in the field Our apologies for the inconvenience and thank you for your patience Tagging and Daily Build or Snapshot Releases When a set of related projects are under development it may be important to track finer grained version increments than you would normally use for e g stable releases While stable releases might be measured in dotted numbers with alpha beta etc status codes development versions of a project often need to be tracked by revision or build number or even build date This is especially true when projects in development need to refer to one another and therefore may literally need an up to the minute version of something To support these scenarios setuptools allows you to tag your source and egg distributions by adding one or more of the following to the project s official version identifier A manually specified pre release tag such as build or dev or a manually specified post release tag such as a build or revision number tag build STRING bSTRING A last modified revision number string generated automatically from Subversion s metadata assuming your project is being built from a Subversion working copy tag svn revision r An 8 character representation of the build date tag date d as a postrelease tag You can add these tags by adding egg info and the desired options to the command line ahead of the sdist or bdist commands that you want to generate a daily build or snapshot for See the section below on the egg info command for more details Also before you release your project be sure to see the section above on Specifying Your Project s Version for more information about how pre and post release tags affect how setuptools and EasyInstall interpret version numbers This is important in order to make sure that dependency processing tools will know which versions of your project are newer than others Finally if you are creating builds frequently and either building them in a downloadable location or are copying them to a distribution server you should probably also check out the rotate command which lets you automatically delete all but the N most recently modified distributions matching a glob pattern So you can use a command line like setup py egg info rbDEV bdist egg rotate m egg k3 to build an egg whose version info includes DEV rNNNN where NNNN is the most recent Subversion revision that affected the source tree and then delete any egg files from the distribution directory except for the three that were built most recently If you have to manage automated builds for multiple packages each with different tagging and rotation policies you may also want to check out the alias command which would let each package define an alias like daily that would perform the necessary tag build and rotate commands Then a simpler script or cron job could just run setup py daily in each project directory And you could also define sitewide or per user default versions of the daily alias so that projects that didn t define their own would use the appropriate defaults Generating Source Distributions setuptools enhances the distutils default algorithm for source file selection so that all files managed by CVS or Subversion in your project tree are included in any source distribution you build This is a big improvement over having to manually write a MANIFEST in file and try to keep it in sync with your project So if you are using CVS or Subversion and your source distributions only need to include files that you re tracking in revision control don t create a a MANIFEST in file for your project And if you already have one you might consider deleting it the next time you would otherwise have to change it NOTE other revision control systems besides CVS and Subversion can be supported using plugins see the section below on Adding Support for Other Revision Control Systems for information on how to write such plugins If you need to include automatically generated files or files that are kept in an unsupported revision control system you ll need to create a MANIFEST in file to specify any files that the default file location algorithm doesn t catch See the distutils documentation for more information on the format of the MANIFEST in file But be sure to ignore any part of the distutils documentation that deals with MANIFEST or how it s generated from MANIFEST in setuptools shields you from these issues and doesn t work the same way in any case Unlike the distutils setuptools regenerates the source distribution manifest file every time you build a source distribution and it builds it inside the project s egg info directory out of the way of your main project directory You therefore need not worry about whether it is up to date or not Indeed because setuptools approach to determining the contents of a source distribution is so much simpler its sdist command omits nearly all of the options that the distutils more complex sdist process requires For all practical purposes you ll probably use only the formats option if you use any option at all By the way if you re using some other revision control system you might consider creating and publishing a revision control plugin for setuptools Making your package available for EasyInstall If you use the register command setup py register to register your package with PyPI that s most of the battle right there See the docs for the register command for more details If you also use the upload command to upload actual distributions of your package that s even better because EasyInstall will be able to find and download them directly from your project s PyPI page However there may be reasons why you don t want to upload distributions to PyPI and just want your existing distributions or perhaps a Subversion checkout to be used instead So here s what you need to do before running the register command There are three setup arguments that affect EasyInstall url and download url These become links on your project s PyPI page EasyInstall will examine them to see if they link to a package primary links or whether they are HTML pages If they re HTML pages EasyInstall scans all HREF s on the page for primary links long description EasyInstall will check any URLs contained in this argument to see if they are primary links A URL is considered a primary link if it is a link to a tar gz tgz zip egg egg zip tar bz2 or exe file or if it has an egg project or egg project version fragment identifier attached to it EasyInstall attempts to determine a project name and optional version number from the text of a primary link without downloading it When it has found all the primary links EasyInstall will select the best match based on requested version platform compatibility and other criteria So if your url or download url point either directly to a downloadable source distribution or to HTML page s that have direct links to such then EasyInstall will be able to locate downloads automatically If you want to make Subversion checkouts available then you should create links with either egg project or egg project version added to the URL You should replace project and version with the values they would have in an egg filename Be sure to actually generate an egg and then use the initial part of the filename rather than trying to guess what the escaped form of the project name and version number will be Note that Subversion checkout links are of lower precedence than other kinds of distributions so EasyInstall will not select a Subversion checkout for downloading unless it has a version included in the egg suffix and it s a higher version than EasyInstall has seen in any other links for your project As a result it s a common practice to use mark checkout URLs with a version of dev i e egg projectname dev so that users can do something like this easy install editable projectname dev in order to check out the in development version of projectname Managing Continuous Releases Using Subversion If you expect your users to track in development versions of your project via Subversion there are a few additional steps you should take to ensure that things work smoothly with EasyInstall First you should add the following to your project s setup cfg file egg info tag build dev tag svn revision 1 This will tell setuptools to generate package version numbers like 1 0a1 dev r1263 which will be considered to be an older release than 1 0a1 Thus when you actually release 1 0a1 the entire egg infrastructure including setuptools pkg resources and EasyInstall will know that 1 0a1 supersedes any interim snapshots from Subversion and handle upgrades accordingly Note the project version number you specify in setup py should always be the next version of your software not the last released version Alternately you can leave out the tag build dev and always use the last release as a version number so that your post 1 0 builds are labelled 1 0 r1263 indicating a post 1 0 patchlevel Most projects so far however seem to prefer to think of their project as being a future version still under development rather than a past version being patched It is of course possible for a single project to have both situations using post release numbering on release branches and pre release numbering on the trunk But you don t have to make things this complex if you don t want to Commonly projects releasing code from Subversion will include a PyPI link to their checkout URL as described in the previous section with an egg projectname dev suffix This allows users to request EasyInstall to download projectname dev in order to get the latest in development code Note that if your project depends on such in progress code you may wish to specify your install requires or other requirements to include dev e g install requires OtherProject 0 2a1 dev r143 dev The above example says I really want at least this particular development revision number but feel free to follow and use an egg OtherProject dev link if you find one This avoids the need to have actual source or binary distribution snapshots of in development code available just to be able to depend on the latest and greatest a project has to offer A final note for Subversion development if you are using SVN revision tags as described in this section it s a good idea to run setup py develop after each Subversion checkin or update because your project s version number will be changing and your script wrappers need to be updated accordingly Also if the project s requirements have changed the develop command will take care of fetching the updated dependencies building changed extensions etc Be sure to also remind any of your users who check out your project from Subversion that they need to run setup py develop after every update in order to keep their checkout completely in sync Making Official Non Snapshot Releases When you make an official release creating source or binary distributions you will need to override the tag settings from setup cfg so that you don t end up registering versions like foobar 0 7a1 dev r34832 This is easy to do if you are developing on the trunk and using tags or branches for your releases just make the change to setup cfg after branching or tagging the release so the trunk will still produce development snapshots Alternately if you are not branching for releases you can override the default version options on the command line using something like python setup py egg info RDb sdist bdist egg register upload The first part of this command egg info RDb will override the configured tag information before creating source and binary eggs registering the project with PyPI and uploading the files Thus these commands will use the plain version from your setup py without adding the Subversion revision number or build designation string Of course if you will be doing this a lot you may wish to create a personal alias for this operation e g python setup py alias u release egg info RDb You can then use it like this python setup py release sdist bdist egg register upload Or of course you can create more elaborate aliases that do all of the above See the sections below on the egg info and alias commands for more ideas Distributing Extensions compiled with Pyrex setuptools includes transparent support for building Pyrex extensions as long as you define your extensions using setuptools Extension not distutils Extension You must also not import anything from Pyrex in your setup script If you follow these rules you can safely list pyx files as the source of your Extension objects in the setup script setuptools will detect at build time whether Pyrex is installed or not If it is then setuptools will use it If not then setuptools will silently change the Extension objects to refer to the c counterparts of the pyx files so that the normal distutils C compilation process will occur Of course for this to work your source distributions must include the C code generated by Pyrex as well as your original pyx files This means that you will probably want to include current c files in your revision control system rebuilding them whenever you check changes in for the pyx source files This will ensure that people tracking your project in CVS or Subversion will be able to build it even if they don t have Pyrex installed and that your source releases will be similarly usable with or without Pyrex Command Reference alias Define shortcuts for commonly used commands Sometimes you need to use the same commands over and over but you can t necessarily set them as defaults For example if you produce both development snapshot releases and stable releases of a project you may want to put the distributions in different places or use different egg info tagging options etc In these cases it doesn t make sense to set the options in a distutils configuration file because the values of the options changed based on what you re trying to do Setuptools therefore allows you to define aliases shortcut names for an arbitrary string of commands and options using setup py alias aliasname expansion where aliasname is the name of the new alias and the remainder of the command line supplies its expansion For example this command defines a sitewide alias called daily that sets various egg info tagging options setup py alias global config daily egg info tag svn revision tag build development Once the alias is defined it can then be used with other setup commands e g setup py daily bdist egg generate a daily build egg file setup py daily sdist generate a daily build source distro setup py daily sdist bdist egg generate both The above commands are interpreted as if the word daily were replaced with egg info tag svn revision tag build development Note that setuptools will expand each alias at most once in a given command line This serves two purposes First if you accidentally create an alias loop it will have no effect you ll instead get an error message about an unknown command Second it allows you to define an alias for a command that uses that command For example this project local alias setup py alias bdist egg bdist egg rotate k1 m egg redefines the bdist egg command so that it always runs the rotate command afterwards to delete all but the newest egg file It doesn t loop indefinitely on bdist egg because the alias is only expanded once when used You can remove a defined alias with the remove or r option e g setup py alias global config remove daily would delete the daily alias we defined above Aliases can be defined on a project specific per user or sitewide basis The default is to define or remove a project specific alias but you can use any of the configuration file options listed under the saveopts command below to determine which distutils configuration file an aliases will be added to or removed from Note that if you omit the expansion argument to the alias command you ll get output showing that alias current definition and what configuration file it s defined in If you omit the alias name as well you ll get a listing of all current aliases along with their configuration file locations bdist egg Create a Python Egg for the project This command generates a Python Egg egg file for the project Python Eggs are the preferred binary distribution format for EasyInstall because they are cross platform for pure packages directly importable and contain project metadata including scripts and information about the project s dependencies They can be simply downloaded and added to sys path directly or they can be placed in a directory on sys path and then automatically discovered by the egg runtime system This command runs the egg info command if it hasn t already run to update the project s metadata egg info directory If you have added any extra metadata files to the egg info directory those files will be included in the new egg file s metadata directory for use by the egg runtime system or by any applications or frameworks that use that metadata You won t usually need to specify any special options for this command just use bdist egg and you re done But there are a few options that may be occasionally useful dist dir DIR d DIR Set the directory where the egg file will be placed If you don t supply this then the dist dir setting of the bdist command will be used which is usually a directory named dist in the project directory plat name PLATFORM p PLATFORM Set the platform name string that will be embedded in the egg s filename assuming the egg contains C extensions This can be used to override the distutils default platform name with something more meaningful Keep in mind however that the egg runtime system expects to see eggs with distutils platform names so it may ignore or reject eggs with non standard platform names Similarly the EasyInstall program may ignore them when searching web pages for download links However if you are cross compiling or doing some other unusual things you might find a use for this option exclude source files Don t include any modules py files in the egg just compiled Python C and data files Note that this doesn t affect any py files in the EGG INFO directory or its subdirectories since for example there may be scripts with a py extension which must still be retained We don t recommend that you use this option except for packages that are being bundled for proprietary end user applications or for embedded scenarios where space is at an absolute premium On the other hand if your package is going to be installed and used in compressed form you might as well exclude the source because Python s traceback module doesn t currently understand how to display zipped source code anyway or how to deal with files that are in a different place from where their code was compiled There are also some options you will probably never need but which are there because they were copied from similar bdist commands used as an example for creating this one They may be useful for testing and debugging however which is why we kept them keep temp k Keep the contents of the bdist dir tree around after creating the egg file bdist dir DIR b DIR Set the temporary directory for creating the distribution The entire contents of this directory are zipped to create the egg file after running various installation commands to copy the package s modules data and extensions here skip build Skip doing any build commands just go straight to the install and compress phases develop Deploy the project source in Development Mode This command allows you to deploy your project s source for use in one or more staging areas where it will be available for importing This deployment is done in such a way that changes to the project source are immediately available in the staging area s without needing to run a build or install step after each change The develop command works by creating an egg link file named for the project in the given staging area If the staging area is Python s site packages directory it also updates an easy install pth file so that the project is on sys path by default for all programs run using that Python installation The develop command also installs wrapper scripts in the staging area or a separate directory as specified that will ensure the project s dependencies are available on sys path before running the project s source scripts And it ensures that any missing project dependencies are available in the staging area by downloading and installing them if necessary Last but not least the develop command invokes the build ext i command to ensure any C extensions in the project have been built and are up to date and the egg info command to ensure the project s metadata is updated so that the runtime and wrappers know what the project s dependencies are If you make any changes to the project s setup script or C extensions you should rerun the develop command against all relevant staging areas to keep the project s scripts metadata and extensions up to date Most other kinds of changes to your project should not require any build operations or rerunning develop but keep in mind that even minor changes to the setup script e g changing an entry point definition require you to re run the develop or test commands to keep the distribution updated Here are some of the options that the develop command accepts Note that they affect the project s dependencies as well as the project itself so if you have dependencies that need to be installed and you use exclude scripts for example the dependencies scripts will not be installed either For this reason you may want to use EasyInstall to install the project s dependencies before using the develop command if you need finer control over the installation options for dependencies uninstall u Un deploy the current project You may use the install dir or d option to designate the staging area The created egg link file will be removed if present and it is still pointing to the project directory The project directory will be removed from easy install pth if the staging area is Python s site packages directory Note that this option currently does not uninstall script wrappers You must uninstall them yourself or overwrite them by using EasyInstall to activate a different version of the package You can also avoid installing script wrappers in the first place if you use the exclude scripts aka x option when you run develop to deploy the project multi version m Multi version mode Specifying this option prevents develop from adding an easy install pth entry for the project s being deployed and if an entry for any version of a project already exists the entry will be removed upon successful deployment In multi version mode no specific version of the package is available for importing unless you use pkg resources require to put it on sys path or you are running a wrapper script generated by setuptools or EasyInstall In which case the wrapper script calls require

    Original URL path: http://peak.telecommunity.com/DevCenter/setuptools?action=highlight&value=setuptools (2016-04-24)
    Open archived version from archive

  • EasyInstall - The PEAK Developers' Center
    install it in development mode using setup py develop if the package uses setuptools that is or by running easy install projectdir where projectdir is the subdirectory EasyInstall created for the downloaded package In order to use editable e for short you must also supply a build directory b for short The project will be placed in a subdirectory of the build directory The subdirectory will have the same name as the project itself but in all lowercase If a file or directory of that name already exists EasyInstall will print an error message and exit Also when using editable you cannot use URLs or filenames as arguments You must specify project names and optional version requirements so that EasyInstall knows what directory name s to create If you need to force EasyInstall to use a particular URL or filename you should specify it as a find links item f for short and then also specify the project name e g easy install eb projects fhttp prdownloads sourceforge net ctypes ctypes 0 9 6 tar gz download ctypes 0 9 6 Dealing with Installation Conflicts NOTE As of 0 6a11 this section is obsolete it is retained here only so that people using older versions of EasyInstall can consult it As of version 0 6a11 installation conflicts are handled automatically without deleting the old or system installed packages and without ignoring the issue Instead eggs are automatically shifted to the front of sys path using special code added to the easy install pth file So if you are using version 0 6a11 or better of setuptools you do not need to worry about conflicts and the following issues do not apply to you EasyInstall installs distributions in a managed way such that each distribution can be independently activated or deactivated on sys path However packages that were not installed by EasyInstall are unmanaged in that they usually live all in one directory and cannot be independently activated or deactivated As a result if you are using EasyInstall to upgrade an existing package or to install a package with the same name as an existing package EasyInstall will warn you of the conflict This is an improvement over setup py install becuase the distutils just install new packages on top of old ones possibly combining two unrelated packages or leaving behind modules that have been deleted in the newer version of the package By default EasyInstall will stop the installation if it detects a conflict between an existing unmanaged package and a module or package in any of the distributions you re installing It will display a list of all of the existing files and directories that would need to be deleted for the new package to be able to function correctly You can then either delete these conflicting files and directories yourself and re run EasyInstall or you can just use the delete conflicting or ignore conflicts at my risk options as described under Command Line Options below Of course once you ve replaced all of your existing unmanaged packages with versions managed by EasyInstall you won t have any more conflicts to worry about Compressed Installation EasyInstall tries to install packages in zipped form if it can Zipping packages can improve Python s overall import performance if you re not using the multi version option because Python processes zipfile entries on sys path much faster than it does directories As of version 0 5a9 EasyInstall analyzes packages to determine whether they can be safely installed as a zipfile and then acts on its analysis Previous versions would not install a package as a zipfile unless you used the zip ok option The current analysis approach is fairly conservative it currenly looks for Any use of the file or path variables which should be replaced with pkg resources API calls Possible use of inspect functions that expect to manipulate source files e g inspect getsource Top level modules that might be scripts used with python m Python 2 4 If any of the above are found in the package being installed EasyInstall will assume that the package cannot be safely run from a zipfile and unzip it to a directory instead You can override this analysis with the zip ok flag which will tell EasyInstall to install the package as a zipfile anyway Or you can use the always unzip flag in which case EasyInstall will always unzip even if its analysis says the package is safe to run as a zipfile Normally however it is simplest to let EasyInstall handle the determination of whether to zip or unzip and only specify overrides when needed to work around a problem If you find you need to override EasyInstall s guesses you may want to contact the package author and the EasyInstall maintainers so that they can make appropriate changes in future versions Note If a package uses setuptools in its setup script the package author has the option to declare the package safe or unsafe for zipped usage via the zip safe argument to setup If the package author makes such a declaration EasyInstall believes the package s author and does not perform its own analysis However your command line option if any will still override the package author s choice Reference Manual Configuration Files New in 0 4a2 You may specify default options for EasyInstall using the standard distutils configuration files under the command heading easy install EasyInstall will look first for a setup cfg file in the current directory then a pydistutils cfg or HOME pydistutils cfg on Unix like OSes and Windows respectively and finally a distutils cfg file in the distutils package directory Here s a simple example easy install set the default location to install packages install dir home me lib python Notice that indentation can be used to continue an option value this is especially useful for the find links option which tells easy install to use download links on these pages before consulting PyPI find links http sqlobject org http peak telecommunity com dist In addition to accepting configuration for its own options under easy install EasyInstall also respects defaults specified for other distutils commands For example if you don t set an install dir for easy install but have set an install lib for the install command this will become EasyInstall s default installation directory Thus if you are already using distutils configuration files to set default install locations build options etc EasyInstall will respect your existing settings until and unless you override them explicitly in an easy install section For more information see also the current Python documentation on the use and location of distutils configuration files Command Line Options zip ok z Install all packages as zip files even if they are marked as unsafe for running as a zipfile This can be useful when EasyInstall s analysis of a non setuptools package is too conservative but keep in mind that the package may not work correctly Changed in 0 5a9 previously this option was required in order for zipped installation to happen at all always unzip Z Don t install any packages as zip files even if the packages are marked as safe for running as a zipfile This can be useful if a package does something unsafe but not in a way that EasyInstall can easily detect EasyInstall s default analysis is currently very conservative however so you should only use this option if you ve had problems with a particular package and after reporting the problem to the package s maintainer and to the EasyInstall maintainers Note the z Z options only affect the installation of newly built or downloaded packages that are not already installed in the target directory if you want to convert an existing installed version from zipped to unzipped or vice versa you ll need to delete the existing version first and re run EasyInstall multi version m Multi version mode Specifying this option prevents easy install from adding an easy install pth entry for the package being installed and if an entry for any version the package already exists it will be removed upon successful installation In multi version mode no specific version of the package is available for importing unless you use pkg resources require to put it on sys path This can be as simple as from pkg resources import require require SomePackage OtherPackage MyPackage which will put the latest installed version of the specified packages on sys path for you For more advanced uses like selecting specific versions and enabling optional dependencies see the pkg resources API doc Changed in 0 6a10 this option is no longer silently enabled when installing to a non PYTHONPATH non site directory You must always explicitly use this option if you want it to be active upgrade U New in 0 5a4 By default EasyInstall only searches online if a project version requirement can t be met by distributions already installed on sys path or the installation directory However if you supply the upgrade or U flag EasyInstall will always check the package index and find links URLs before selecting a version to install In this way you can force EasyInstall to use the latest available version of any package it installs subject to any version requirements that might exclude such later versions install dir DIR d DIR Set the installation directory It is up to you to ensure that this directory is on sys path at runtime and to use pkg resources require to enable the installed package s that you need New in 0 4a2 If this option is not directly specified on the command line or in a distutils configuration file the distutils default installation location is used Normally this would be the site packages directory but if you are using distutils configuration files setting things like prefix or install lib then those settings are taken into account when computing the default installation directory as is the prefix option script dir DIR s DIR Set the script installation directory If you don t supply this option via the command line or a configuration file but you have supplied an install dir via command line or config file then this option defaults to the same directory so that the scripts will be able to find their associated package installation Otherwise this setting defaults to the location where the distutils would normally install scripts taking any distutils configuration file settings into account exclude scripts x Don t install scripts This is useful if you need to install multiple versions of a package but do not want to reset the version that will be run by scripts that are already installed always copy a New in 0 5a4 Copy all needed distributions to the installation directory even if they are already present in a directory on sys path In older versions of EasyInstall this was the default behavior but now you must explicitly request it By default EasyInstall will no longer copy such distributions from other sys path directories to the installation directory unless you explicitly gave the distribution s filename on the command line Note that as of 0 6a10 using this option excludes system and development eggs from consideration because they can t be reliably copied This may cause EasyInstall to choose an older version of a package than what you expected or it may cause downloading and installation of a fresh copy of something that s already installed You will see warning messages for any eggs that EasyInstall skips before it falls back to an older version or attempts to download a fresh copy find links URLS OR FILENAMES f URLS OR FILENAMES Scan the specified download pages or directories for direct links to eggs or other distributions Any existing file or directory names or direct download URLs are immediately added to EasyInstall s search cache and any indirect URLs ones that don t point to eggs or other recognized archive formats are added to a list of additional places to search for download links As soon as EasyInstall has to go online to find a package either because it doesn t exist locally or because upgrade or U was used the specified URLs will be downloaded and scanned for additional direct links Eggs and archives found by way of find links are only downloaded if they are needed to meet a requirement specified on the command line links to unneeded packages are ignored If all requested packages can be found using links on the specified download pages the Python Package Index will not be consulted unless you also specified the upgrade or U option Note if you want to refer to a local HTML file containing links you must use a file URL as filenames that do not refer to a directory egg or archive are ignored You may specify multiple URLs or file directory names with this option separated by whitespace Note that on the command line you will probably have to surround the URL list with quotes so that it is recognized as a single option value You can also specify URLs in a configuration file see Configuration Files above Changed in 0 6a10 previously all URLs and directories passed to this option were scanned as early as possible but from 0 6a10 on only directories and direct archive links are scanned immediately URLs are not retrieved unless a package search was already going to go online due to a package not being available locally or due to the use of the update or U option delete conflicting D Removed in 0 6a11 As of 0 6a11 this option is no longer necessary please do not use it If you are replacing a package that was previously installed without using EasyInstall the old version may end up on sys path before the version being installed with EasyInstall EasyInstall will normally abort the installation of a package if it detects such a conflict and ask you to manually remove the conflicting files or directories If you specify this option however EasyInstall will attempt to delete the files or directories itself and then proceed with the installation ignore conflicts at my risk Removed in 0 6a11 As of 0 6a11 this option is no longer necessary please do not use it Ignore conflicting packages and proceed with installation anyway even though it means the package probably won t work properly If the conflicting package is in a directory you can t write to this may be your only option but you will need to take more invasive measures to get the installed package to work like manually adding it to PYTHONPATH or to sys path at runtime index url URL i URL New in 0 4a1 default changed in 0 6c7 Specifies the base URL of the Python Package Index The default is http pypi python org simple if not specified When a package is requested that is not locally available or linked from a find links download page the package index will be searched for download pages for the needed package and those download pages will be searched for links to download an egg or source distribution editable e New in 0 6a1 Only find and download source distributions for the specified projects unpacking them to subdirectories of the specified build directory EasyInstall will not actually build or install the requested projects or their dependencies it will just find and extract them for you See Editing and Viewing Source Packages above for more details build directory DIR b DIR UPDATED in 0 6a1 Set the directory used to build source packages If a package is built from a source distribution or checkout it will be extracted to a subdirectory of the specified directory The subdirectory will have the same name as the extracted distribution s project but in all lowercase If a file or directory of that name already exists in the given directory a warning will be printed to the console and the build will take place in a temporary directory instead This option is most useful in combination with the editable option which forces EasyInstall to only find and extract but not build and install source distributions See Editing and Viewing Source Packages above for more information verbose v quiet q New in 0 4a4 Control the level of detail of EasyInstall s progress messages The default detail level is info which prints information only about relatively time consuming operations like running a setup script unpacking an archive or retrieving a URL Using q or quiet drops the detail level to warn which will only display installation reports warnings and errors Using v or verbose increases the detail level to include individual file level operations link analysis messages and distutils messages from any setup scripts that get run If you include the v option more than once the second and subsequent uses are passed down to any setup scripts increasing the verbosity of their reporting as well dry run n New in 0 4a4 Don t actually install the package or scripts This option is passed down to any setup scripts run so packages should not actually build either This does not skip downloading nor does it skip extracting source distributions to a temporary build directory optimize LEVEL O LEVEL New in 0 4a4 If you are installing from a source distribution and are not using the zip ok option this option controls the optimization level for compiling installed py files to pyo files It does not affect the compilation of modules contained in egg files only those in egg directories The optimization level can be set to 0 1 or 2 the default is 0 unless it s set under install or install lib in one of your distutils configuration files record FILENAME New in 0 5a4 Write a record of all installed files to FILENAME This is basically the same as the same option for the standard distutils install command and is included for compatibility with tools that expect to pass this option to setup py install site dirs DIRLIST S DIRLIST New in 0 6a1 Specify one or more custom site directories separated by commas Site directories are directories where pth files are processed such as the main Python site packages directory As of 0 6a10 EasyInstall automatically detects whether a given directory processes pth files or can be made to do so so you should not normally need to use this option It is is now only necessary if you want to override EasyInstall s judgment and force an installation directory to be treated as if it supported pth files If you want to make a non PYTHONPATH directory support pth files please see the Administrator Installation section below no deps N New in 0 6a6 Don t install any dependencies This is intended as a convenience for tools that wrap eggs in a platform specific packaging system We don t recommend that you use it for anything else allow hosts PATTERNS H PATTERNS New in 0 6a6 Restrict downloading and spidering to hosts matching the specified glob patterns E g H python org restricts web access so that only packages listed and downloadable from machines in the python org domain The glob patterns must match the entire user host port section of the target URL s For example python org will NOT accept a URL like http python org foo or http www python org 8080 Multiple patterns can be specified by separting them with commas The default pattern is which matches anything In general this option is mainly useful for blocking EasyInstall s web access altogether e g Hlocalhost or to restrict it to an intranet or other trusted site EasyInstall will do the best it can to satisfy dependencies given your host restrictions but of course can fail if it can t find suitable packages EasyInstall displays all blocked URLs so that you can adjust your allow hosts setting if it is more strict than you intended Some sites may wish to define a restrictive default setting for this option in their configuration files and then manually override the setting on the command line as needed prefix DIR New in 0 6a10 Use the specified directory as a base for computing the default installation and script directories On Windows the resulting default directories will be prefix Lib site packages and prefix Scripts while on other platforms the defaults will be prefix lib python2 X site packages with the appropriate version substituted for libraries and prefix bin for scripts Note that the prefix option only sets the default installation and script directories and does not override the ones set on the command line or in a configuration file local snapshots ok l New in 0 6c6 Normally EasyInstall prefers to only install released versions of projects not in development ones because such projects may not have a currently valid version number So it usually only installs them when their setup py directory is explicitly passed on the command line However if this option is used then any in development projects that were installed using the setup py develop command will be used to build eggs effectively upgrading the in development project to a snapshot release Normally this option is used only in conjunction with the always copy option to create a distributable snapshot of every egg needed to run an application Note that if you use this option you must make sure that there is a valid version number such as an SVN revision number tag for any in development projects that may be used as otherwise EasyInstall may not be able to tell what version of the project is newer when future installations or upgrades are attempted Custom Installation Locations EasyInstall manages what packages are active using Python pth files which are normally only usable in Python s main site packages directory On some platforms such as Mac OS X there are additional site packages directories that you can use besides the main one but usually there is only one directory on the system where you can install packages without extra steps There are many reasons however why you might want to install packages somewhere other than the site packages directory For example you might not have write access to that directory You may be working with unstable versions of packages that you don t want to install system wide And so on The following sections describe various approaches to custom installation feel free to choose which one best suits your system and needs Administrator Installation This approach is for when you have write access to site packages or another directory where pth files are processed but don t want to install packages there This can also be used by a system administrator to enable each user having their own private directories that EasyInstall will use to install packages Mac OS X User Installation This approach produces a result similar to an administrator installation that gives each user their own private package directory but on Mac OS X the hard part has already been done for you This is probably the best approach for Mac OS X users Creating a Virtual Python This approach is for when you don t have root or access to write to the site packages directory and would like to be able to set up one or more virtual python executables for your projects This approach gives you the benefits of multiple Python installations but without having to actually install Python more than once and use up lots of disk space Only the Python executable is copied the libraries will be symlinked from the systemwide Python If you don t already have any PYTHONPATH customization or special distutils configuration and you can t use either of the preceding approaches this is probably the best one for you Traditional PYTHONPATH based Installation If you already have a custom PYTHONPATH and or a custom distutils configuration and don t want to change any of your existing setup you may be interested in this approach If you re using a custom pth file to point to your custom installation location however you should use Administrator Installation to enable pth processing in the custom location instead as that is easier and more flexible than this approach Administrator Installation If you have root access to your machine you can easily configure it to allow each user to have their own directory where Python packages can be installed and managed by EasyInstall First create an altinstall pth file in Python s site packages directory containing the following line substituting the correct Python version import os site site addsitedir os path expanduser lib python2 3 This will automatically add each user s lib python2 X directory to sys path if it exists and it will process any pth files in that directory which is what makes it usable with EasyInstall The next step is to create or modify distutils cfg in the distutils directory of your Python library The correct directory will be something like usr lib python2 X distutils on most Posix systems and something like C Python2X Lib distutils on Windows machines Add the following lines to the file substituting the correct Python version if necessary install install lib lib python2 3 This next line is optional but often quite useful it directs EasyInstall and the distutils to install scripts in the user s bin directory For Mac OS X framework Python builds you should use usr local bin instead because neither bin nor the default script installation location are on the system PATH install scripts bin This will configure the distutils and EasyInstall to install packages to the user s home directory by default Of course you aren t limited to using a lib python2 X directory with this approach You can substitute a specific systemwide directory if you like You can also edit pydistutils cfg or pydistutils cfg on Windows instead of changing the master distutils cfg file The true keys of this approach are simply that any custom installation directory must be added to sys path using a site addsitedir call from a working pth file or sitecustomize py The active distutils configuration file s or easy install command line should include the custom directory in the site dirs option so that EasyInstall knows that pth files will work in that location This is because Python does not keep track of what directories are or aren t enabled for pth processing in any way that EasyInstall can find out As long as both of these things have been done your custom installation location is good to go Mac OS X User Installation If you are on a Mac OS X machine you should just use the Library Python 2 x site packages directory as your custom installation location because it is already configured to process pth files and EasyInstall already knows this Before installing EasyInstall setuptools just create a pydistutils cfg file with the following contents or add this to the existing contents install install lib Library Python py version short site packages install scripts bin This will tell the distutils and EasyInstall to always install packages in your personal site packages directory and scripts to bin Note do not replace py version short with an actual Python version in the configuration file The distutils will substitute the correct value at runtime so that the above configuration file should work correctly no matter what Python version you use now or in the future Once you have done this you can follow the normal installation instructions and use easy install without any other special options or steps Note however that bin is not in the default PATH so you may have to refer to scripts by their full location You may want to modify your shell startup script likely bashrc or profile or your MacOSX environment plist to include bin in your PATH Creating a Virtual Python If you are on a Linux BSD Cygwin or other similar Unix like operating system but don t have root access you can create your own virtual Python installation which uses its own library directories and some symlinks to the site wide Python In the simplest case your virtual Python installation will live under the lib python2 x include python2 x and bin directories Just download virtual python py and run it using the site wide Python If you want to customize the location you can use the prefix option to specify an installation base directory in place of Use help to get the complete list of options When you re done you ll have a bin python executable that s linked to the local Python installation and inherits all its current libraries but which allows you to add as many new libraries as you want Simply use this new Python in place of your system defined one and you can modify it as you like without breaking anything that relies on the system Python You ll also still need to follow the standard installation instructions to install setuptools and EasyInstall using your new bin python executable in place of the system Python Note that if you were previously setting a PYTHONPATH and or had other special configuration options in your pydistutils cfg you may need to remove these settings before running virtual python py This is because your new Python executable will not need any custom configuration for the distutils or EasyInstall everything will go to the correct lib and bin directories automatically You should however also make sure that the bin subdirectory of your installation prefix e g bin is on your PATH because that is where EasyInstall and the distutils will install new Python scripts Traditional PYTHONPATH based Installation This installation method is not as robust or as flexible as creating a virtual python installation as it uses various tricks to fool Python into processing pth files where it normally wouldn t We suggest you at least consider using one of the other approaches as they will generally result in a cleaner more usable Python configuration However if for some reason you can t or won t use one of the other approaches here s how to do it Assuming that you want to install packages in a directory called py lib and scripts in bin here s what you need to do First edit pydistutils cfg to include these settings if you don t already have them install install lib py lib install scripts bin Be sure to do this before you try to run the ez setup py installation script Then follow the standard installation instructions but make sure that py lib is listed in your PYTHONPATH environment variable Your library installation directory must be in listed in PYTHONPATH not only when you install packages with EasyInstall but also when you use any packages that are installed using EasyInstall You will probably want to edit your profile or other configuration file s to ensure that it is set if you haven t already got this set up on your machine Package Index API Custom package indexes and PyPI must follow the following rules for EasyInstall to be able to look up and download packages Except where stated otherwise pages are HTML or XHTML and links refer to href attributes Individual project version pages URLs must be of the form base projectname version where base is the package index s base URL Omitting the version part of a project page s URL but keeping the trailing should result in a page that is either The single active version of that project as though the version had been explicitly included OR A page with links to all of the active version pages for that project Individual project version pages should contain direct links to downloadable distributions where possible It is explicitly permitted for a project s long description to include URLs and these should be formatted as HTML links by the package index as EasyInstall does no special processing to identify what parts of a page are index specific and which are part of the project s supplied description Where available MD5 information should be added to download URLs by appending a fragment identifier of the form md5 where is the 32 character hex MD5 digest EasyInstall will verify that the downloaded file s MD5 digest matches the given value Individual project version pages should identify any homepage or download URLs using rel homepage and rel download attributes on the HTML elements linking to those URLs Use of these attributes will cause EasyInstall to always follow the provided links unless it can be determined by inspection that they are downloadable distributions If the links are not to downloadable distributions they are retrieved and if they are HTML they are scanned for download links They are not scanned for additional homepage or download links as these are only processed for pages that are part of a package index site The root URL of the index if retrieved with a trailing must result in a page containing links to all projects active version pages Note This requirement is a workaround for the absence of case insensitive safe name matching of project names in URL paths If project names are matched in this fashion e g via the PyPI server mod rewrite or a similar mechanism then it is not necessary to include this all packages listing page If a package index is accessed via a file URL then EasyInstall will automatically use index html files if present when trying to read a directory with a trailing on the URL Backward Compatibility Package indexes that wish to support setuptools versions prior to 0 6b4 should also follow these rules Homepage and download links must be preceded with th Home Page or th Download URL in addition to or instead of the rel attributes on the actual links These marker strings do not need to be visible or uncommented however For example the following is a valid homepage link that will work with any version of setuptools li strong Home Page strong th Home Page a rel homepage href http sqlobject org http sqlobject org a li Even though the marker string is in an HTML comment older versions of EasyInstall will still see it and know that the link that follows is the project s home page URL The pages described by paragraph 3 b of the preceding section must contain the string Index of Packages title somewhere in their text This can be inside of an HTML comment if desired and it can be anywhere in the page Note this string MUST NOT appear on normal project pages as described in paragraphs 2 and 3 a In addition for compatibility with PyPI versions that do not use md5 fragment IDs EasyInstall uses the following regular expression to match PyPI s displayed MD5 info broken onto two lines for readability a href a n s a href action show md5 amp digest 0 9a f 32 md5 a Release Notes Change History 0 6c11 Fix installed script exe files not working with 64 bit Python on Windows wasn t actually released in 0 6c10 due to a lost checkin 0 6c10 Fix easy install exe giving UAC errors on Windows Vista Support for the most recent Sourceforge download link insanity Stop crashing on certain types of HTTP error Stop re trying URLs that already failed retrieval once Fixes for various dependency management problems such as looping builds re downloading packages already present on sys path but not in a registered site directory and semi randomly preferring local f packages over local installed packages 0 6c9 Fixed win32 exe support for pth files so unnecessary directory nesting is flattened out in the resulting egg There was a case sensitivity problem that

    Original URL path: http://peak.telecommunity.com/DevCenter/EasyInstall?action=highlight&value=setuptools (2016-04-24)
    Open archived version from archive



  •