English 中文(简体)
How might I handle development versions of Python packages without relying on SCM?
原标题:

One issue that comes up during Pinax development is dealing with development versions of external apps. I am trying to come up with a solution that doesn t involve bringing in the version control systems. Reason being I d rather not have to install all the possible version control systems on my system (or force that upon contributors) and deal the problems that might arise during environment creation.

Take this situation (knowing how Pinax works will be beneficial to understanding):

We are beginning development on a new version of Pinax. The previous version has a pip requirements file with explicit versions set. A bug comes in for an external app that we d like to get resolved. To get that bug fix in Pinax the current process is to simply make a minor release of the app assuming we have control of the app. Apps we don t have control we just deal with the release cycle of the app author or force them to make releases ;-) I am not too fond of constantly making minor releases for bug fixes as in some cases I d like to be working on new features for apps as well. Of course branching the older version is what we do and then do backports as we need.

I d love to hear some thoughts on this.

最佳回答

I meant to mention that the solution I had considered before asking was to put up a Pinax PyPI and make development releases on it. We could put up an instance of chishop. We are already using pip s --find-links to point at pypi.pinaxproject.com for packages we ve had to release ourselves.

问题回答

Could you handle this using the "==dev" version specifier? If the distribution s page on PyPI includes a link to a .tgz of the current dev version (such as both github and bitbucket provide automatically) and you append "#egg=project_name-dev" to the link, both easy_install and pip will use that .tgz if ==dev is requested.

This doesn t allow you to pin to anything more specific than "most recent tip/head", but in a lot of cases that might be good enough?

Most open source distributors (the Debians, Ubuntu s, MacPorts, et al) use some sort of patch management mechanism. So something like: import the base source code for each package as released, as a tar ball, or as a SCM snapshot. Then manage any necessary modifications on top of it using a patch manager, like quilt or Mercurial s Queues. Then bundle up each external package with any applied patches in a consistent format. Or have URLs to the base packages and URLs to the individual patches and have them applied during installation. That s essentially what MacPorts does.

EDIT: To take it one step further, you could then version control the set of patches across all of the external packages and make that available as a unit. That s quite easy to do with Mercurial Queues. Then you ve simplified the problem to just publishing one set of patches using one SCM system, with the patches applied locally as above or available for developers to pull and apply to their copies of the base release packages.

EDIT: I am not sure I am reading your question correctly so the following may not answer your question directly.

Something I ve considered, but haven t tested, is using pip s freeze bundle feature. Perhaps using that and distributing the bundle with Pinax would work? My only concern would be how different OS s are handled. For example, I ve never used pip on Windows, so I wouldn t know how a bundle would interact there.

The full idea I hope to try is creating a paver script that controls management of the bundles, making it easy for users to upgrade to newer versions. This would require a bit of scaffolding though.

One other option may be you keeping a mirror of the apps you don t control, in a consistent vcs, and then distributing your mirrored versions. This would take away the need for "everyone" to have many different programs installed.

Other than that, it seems the only real solution is what you guys are doing, there isn t a hassle-free way that I ve been able to find.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签