Reply to comment

Python Packaging, Development, Git, and an Epiphany about Contemporary Development

So, I have this library, and it's always a pain to release it onto my internal computers (or any computers). Unlike the web apps it's not running from a virtualenv. It's right on the system. Maybe it shouldn't be :/

Anyway, that was my motivation for learning Python packaging. It's not hard, but you have to follow every step in the tutorials, and really repeat them a few times. After a couple tries, I had my "eggs" working locally. I also found out that I'm supposed to use pip to make "wheels" instead. I was behind the times.

No big deal. Eggs and wheels are both regular archives with metadata and files, and the installer tools just extract parts of the archives into the libraries. Additionally, the docs tell you about "develop" or "--editable" mode. This is an installation from the source files to the Python libraries, and avoiding packaging entirely. The command are:

python setup.py develop
 or
pip install -e .

The special thing about "develop" or "-e" mode is that the library is symlinked into the libraries (in the site-packages directory) so you can edit the code and commit changes to the repo.

At that moment, I recalled a comment, probably on StackExchange, where a programmer said she or he clones libraries from Github, and then installs them via npm as editable. This way, (s)he can fix bugs, push them, and then send a pull request.

I had the epiphany:
- break your project into modules, and put each module into a git repo.
- clone the repo, then install each module into the local environment (assuming you are using virtualenv).
- use the git server to distribute the changes to all the projects (git pull).
- if necessary, use forks and pull requests to create an authority to regulate changes to the code.

I hope this document didn't embarrassingly expose how much of a noob I am to this style of software dev. It's just a very exciting thing to have learned, even though it was right there in front of me, in Github.

Eggs and easy_install:
https://python-packaging.readthe...

Pip and wheels:
http://python-packaging-user-gui...

Reply

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options

3 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.