Skip to content

Commit

Permalink
Some tidying up, and support python 2.3 by avoiding use of the "set" …
Browse files Browse the repository at this point in the history
…object;

thanks to Thomas Waldmann for pointing that out.


git-svn-id: svn+userv://snowball.tartarus.org/snowball/trunk/pystemmer@383 633ccae0-01f4-0310-8c99-d3591da6f01f
  • Loading branch information
rboulton committed Jun 19, 2006
1 parent dd1fb54 commit 94ae55c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 8 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Mon Jun 19 07:51:38 BST 2006 Richard Boulton <[email protected]>

* setup.py: fix setup.py to work with python 2.3: don't use "set",
which doesn't exist before python 2.4.
* Stemmer.pyx: Add module-level "version()" function, to determine
version of Stemmer. General tidying up, too.
* Bump version number to 1.0.1

Sun Jun 11 22:22:00 BST 2006 Richard Boulton <[email protected]>

* Release initial package of PyStemmer, version 1.0

18 changes: 18 additions & 0 deletions HACKING
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Release checklist
=================

* Update ChangeLog to describe what's changed.

* Increase the version number.

* Check that version string in setup.py matches that in Stemmer.pyx

* Run ./makedist.sh to build and test package.

* Copy generated package to website, in wrappers subdirectory.

* Update the following pages to point to the latest package:
* download.php
* wrappers/guide.html

* Update the package entry on PyPI, using "python setup.py register"
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE
include LICENSE ChangeLog HACKING
recursive-include libstemmer_c *
recursive-include sampledata *
recursive-include docs *
Expand Down
4 changes: 3 additions & 1 deletion makedist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

epydoc --html -o docs/html --check Stemmer.so
python setup.py install --install-lib=`pwd`
epydoc --html -o docs/html Stemmer.so

rm -fr dist
python setup.py sdist
(cd dist &&
Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@

# Directory which libstemmer sources are unpacked in.
library_dir = 'libstemmer_c'

# Directories in libstemmer which contain libstemmer sources (ie, not
# examples, etc).
library_core_dirs = set(('src_c', 'runtime', 'libstemmer', 'include'))
library_core_dirs = ('src_c', 'runtime', 'libstemmer', 'include')

# Read the manifest of files in libstemmer.
src_files = [os.path.join(library_dir, line.strip())
for line in open(os.path.join(library_dir, 'MANIFEST'))
if len(line.strip()) > 2
and line.strip()[-2:] == '.c'
and os.path.split(line.strip())[0] in library_core_dirs]

# Set the include path to include libstemmer.
include_dirs = ('src', os.path.join(library_dir, 'include'))

Expand Down Expand Up @@ -57,14 +59,15 @@
""".strip()

version_str = '1.0.1'
setup(name = 'PyStemmer',
version = '1.0',
version = version_str,
author = 'Richard Boulton',
author_email = '[email protected]',
maintainer = 'Richard Boulton',
maintainer_email = '[email protected]',
url = 'http://snowball.tartarus.org/',
download_url = 'http://snowball.tartarus.org/wrappers/PyStemmer-1.0.tar.gz',
download_url = 'http://snowball.tartarus.org/wrappers/PyStemmer-%s.tar.gz' % version_str,
description = 'Snowball stemming algorithms, for information retrieval',
long_description = long_description,
platforms = ["any"],
Expand Down Expand Up @@ -108,3 +111,4 @@
include_dirs = include_dirs)],
cmdclass = cmdclass
)

12 changes: 9 additions & 3 deletions src/Stemmer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ __docformat__ = "restructuredtext en"
# "epydoc" tool. Invoke it by compiling this module and then running:
# "epydoc Stemmer.so".

import encodings

cdef extern from "Python.h":
object PyString_FromStringAndSize (char * s, int len)

Expand Down Expand Up @@ -65,9 +63,17 @@ def algorithms():
while algs[i] != NULL:
py_algs.append(algs[i])
i = i + 1

return py_algs

def version():
"""Get the version string of the stemming module.
This version number is for the Stemmer module as a whole (not for an
individual stemming algorithm).
"""
return '1.0.1'

cdef class Stemmer:
"""An instance of a stemming algorithm.
Expand Down

0 comments on commit 94ae55c

Please sign in to comment.