GitXplorerGitXplorer
i

package-py

public
8 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
8e12a8e3e949eee7ba85c0b555ce2a138ef0a0fc

Change url back to github default.

iingydotnet committed 14 years ago
Unverified
d4033c50e593505d5562f8d9965086829f03f856

0.1.1

iingydotnet committed 14 years ago
Unverified
2491e9a9006dac9748b26d0ed629a37aae25ac11

don't require _

iingydotnet committed 14 years ago
Unverified
de443b4dab4ffccd2e3cf3aa6456e955e78db89f

Only run test modules (begin test_)

iingydotnet committed 14 years ago
Unverified
6cbb59c4131b9cc9bf01a6cdfe62f47d178e2bf4

add a 'purge' synonym for clean

iingydotnet committed 14 years ago
Unverified
99c3d7bdcc4eafe9f2162dc2bd582a42923565d7

doc change

iingydotnet committed 15 years ago

README

The README file for this repository.

package package package

This is the package package package package for Python. It can be found in the Python Package Index, here: http://pypi.python.org/pypi/package/.

package is a toolset to help Python package people package their packages. If you do not personally package Python packages, you can ignore this package package.

Installation

DON'T INSTALL THIS PACKAGE (package)!!!

package isn't meant to be installed like normal Python packages. It is meant to be copied and distributed as a part of other Python packages.

The best thing to do is to to git clone it from GitHub, and put it beside the other packages that you package for Python::

git clone git://github.com/ingydotnet/package-py.git

The second best thing to do is get the latest package-#.#.#.tar.gz from http://pypi.python.org/pypi/package/, untar it and rename the directory to package-py.

Then follow the instructions given below.

WTF?

Confused? So was I...

I like to write a lot of modules and distribute them as packages, but when I started doing this in Python, I ran into a wall of setup/installer bugs, bad workarounds and community disagreement about what the best way to go was. I decided to fix this in a way that makes all programmers be able to install my Python packages (and their prerequisite packages), regardless of their current Python knowledge or working environment.

The solution is simple. Just add helper tools in a subdirectory that gets included in every Python package you release.

It's a simple trade of a little extra storage space for functionality, package-author-sanity and world peace. :)

Design Goals

These are some of the things I was concerned with when I started this project:

  • Make my Python packages installable by anyone.
  • Allow my Python packages to depend on other packages.
  • Put as little extra burden on the user as possible.
  • Never leave the user uninformed and screaming.
  • Make setup.py files be autogenerated from simple yaml files.
  • Don't let this project paint its users into yet another dependency corner.
  • Provide a simple Makefile for automating related tasks.
  • Provide support for running unittests with make test.
  • Keep the bloat of using package to a minimum.

Usage

To use this Python package packaging technique, follow these simple steps:

  1. > cd your/src/dir/

    In other words, just go to the directory where you want to put this package package's repository. Putting it next to your other Python package source code repositories is what I am suggesting here...

  2. > git clone git://github.com/ingydotnet/package-py.git

    Unless, of course, you already have package-py. Then maybe you should git pull it to get the latest code.

  3. > mkdir newproject

  4. > cd newproject

  5. > make -f ../package-py/Makefile.mk setup

    This will set up the all files you need for a new project. These files are in a generic, template form until you complete the next two steps.

  6. Edit package/info.yaml with all the information about your package.

    Commonly, you will only need two lines in this file:

    name: newproject include: ../package-py/my-info.yaml

    You can keep all your common values in a common file to be included. The project name, of course, is always different from package to package.

  7. > make info

    This command will update your package files with the information you specified in package/info.yaml. You should run it whenever you update your info.yaml file.

  8. > make help

    At this point everything should be set up for you to use just like any other setup.py.

    From here on out, you are encouraged (but not required) to use the Makefile. Run make help to see all the options available to you.

  9. > make test

    package provides a complete working test environment environment for your package. It even provides one test. This test is a FAILING test! It tests to see if your new Python module will import cleanly. But it won't. It will, in fact, raise an exception telling you that your module has not yet been implemented.

  10. Fix your module, write more tests, finish your module.

  11. > make upload

    Ship your new package to PyPI!

Development Status

This package package package package has been around for year now. Let's call it Beta.

I am using this software for all my projects on PyPI. I do most of my development on Ubuntu Linux using Python 2.6.6.

I would love to talk to you about your experience in using this software. Feel free to hunt me down on the net...

Author

This blasphemous atrocity was brought to you by Ingy dot Net. Yes, the same guy who ruined Perl. There was nothing there left there for him to pillage, so he has moved on to your neighborhood. Be afraid.

Copyright

package is Copyright (c) 2010, 2011, Ingy dot Net

package is licensed under the New BSD License. See the LICENSE file.