Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#7000 closed enhancement (fixed)

Pack macro for setuptools deploy

Reported by: theist Owned by: anonymous
Priority: normal Component: ChangeLogMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I have a trac with several plugins, Some of these are personal and others are from this site. I store all as external references in a subversion. I Install most of the plugins with setuptools system wide, via python setup.py install.

Some plugins like this macro aren't packed as an egg.

I propose pack it as an egg, so this macro can be packed and distributed as an egg or installed and managed via trac plugin administration interface.

Steps:

cd 0.11
mkdir changelogmacro
touch changelogmacro/__init__.py
svn add changelogmacro
svn mv ChangeLogMacro.py changelogmacro/
touch setup.py
svn add setup.py

edit setup.py and write something like

#!/usr/bin/env python
# -*- coding: utf8 -*-

from setuptools import setup

setup(
    name = 'ChangelogMacro',
    version = '0.11',
    packages = ['changelogmacro'],
    author = 'Alec Thomas',
    description = 'Adds a Wiki macro that displays a changelog for a repository path.',
    license = 'Unknow',
    url = 'http://trac-hacks.org/wiki/ChangeLogPlugin',
    entry_points = {
        'trac.plugins':[
            'changelogmacro.ChangeLogMacro = changelogmacro.ChangeLogMacro'   
        ]
    },
)

Attachments (0)

Change History (6)

comment:1 Changed 5 years ago by rjollos

I've looked into this previously and I have yet to find any advantage to packaging as an egg a single file macro that has no dependencies. Do you know of any?

If you put the single file macro in your plugins directory then you will be able to manage it through the web admin inteface, just as if it was packaged as an egg.

Also, you don't even need to put the macro in your plugins directory. You can just created a symlink in your plugins directory that points to the macros source code.

I'd be happy to do this if you could point out any advantage, but as it stands it just looks like unneccessary overhead to me.

comment:2 follow-up: Changed 5 years ago by anonymous

  • Type changed from defect to enhancement

I work managing (among other things) the tracs and svn of a small open source bussines. We have several projects hosted on the same "trac" server and these tracs are managed by other tools. There's also a repo with several external reference to mantain up to date our trac and plugins.

The advantages of having the macro packaged as an egg are:

  • ability to setup system wide, leaving untouched the trac environment directory
  • ability to manage the macro from the admin -> plugins panel

In my personal setup it's better to have all as homogeneous as possible, but it's true that is a personal choice.

If you feel that isn't worth to package it close this ticket, and sorry for the noise :)

Hum and missed the ticket type, its an enhancement not a defect.

comment:3 Changed 4 years ago by rjollos

Good points ... It seems worthwhile to add a setup.py. One other advantage I've found recently to having a setup.py is the ability to specify depedencies. I maintain a single-file macro that only works with Python >= 2.6, and this dependency can be specified in setup.py.

I'll get around to this within the next few weeks, or if you have a file you'd like to submit, please do.

comment:4 in reply to: ↑ 2 Changed 4 years ago by rjollos

  • Owner changed from rjollos to anonymous
  • Status changed from new to assigned

Replying to anonymous:

The advantages of having the macro packaged as an egg are:

  • ability to setup system wide, leaving untouched the trac environment directory
  • ability to manage the macro from the admin -> plugins panel

I checked the behavior again, and it is possible to manage the macro from the plugins panel even if it is installed as a single-file plugin. However, I do like the idea of being able to specify dependencies in the setup.py file, and I can see the advantage of system-wide installation (the alternative would be to symlink from the env's plugins dir to a system-wide location of the single file plugin).

I'll commit the update shortly.

comment:5 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7920]) Added setup.py to allow for setuptools deployment. Fixes #7000.

comment:6 Changed 4 years ago by rjollos

Note that I reorganized the repository this evening so that there is now a 0.11 version and a 0.12 version. See #7061 and #7062.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.