Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make pybtex an optional spkg #11851

Closed
sagetrac-ranosch mannequin opened this issue Sep 26, 2011 · 24 comments
Closed

make pybtex an optional spkg #11851

sagetrac-ranosch mannequin opened this issue Sep 26, 2011 · 24 comments

Comments

@sagetrac-ranosch
Copy link
Mannequin

sagetrac-ranosch mannequin commented Sep 26, 2011

See http://pybtex.sourceforge.net/ for a description.

Should be a standard spkg later, so that the citation system can use it.


Apply attachment: trac_11851-hgignore.patch to the scripts repo.

New optional spkg: http://ubuntuone.com/6iNB5C4qYc6UZWEwaAcOx1

CC: @sagetrac-PolyBoRi @burcin

Component: packages: optional

Keywords: BibTeX citations

Author: Niels Ranosch, Burcin Erocal

Reviewer: John Palmieri

Merged: sage-5.2.beta0

Issue created by migration from https://trac.sagemath.org/ticket/11851

@sagetrac-ranosch sagetrac-ranosch mannequin added this to the sage-5.1 milestone Sep 26, 2011
@jhpalmieri
Copy link
Member

comment:1

When I install the spkg on a Mac OS X box, I see this

Processing PyYAML-3.10.zip
Running PyYAML-3.10/setup.py -q bdist_egg --dist-dir /var/folders/JV/JVYCpshdHd4FFoThuUgD8k+++TI/-Tmp-/easy_install-e_csNv/PyYAML-3.10/egg-dist-tmp-KAUGDh
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:2:18: error: yaml.h: No such file or directory
build/temp.macosx-10.6-i386-2.6/check_libyaml.c: In function ‘main’:
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: ‘yaml_parser_t’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: (Each undeclared identifier is reported only once
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: for each function it appears in.)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: expected ‘;’ before ‘parser’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:6: error: ‘yaml_emitter_t’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:6: error: expected ‘;’ before ‘emitter’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:8: warning: implicit declaration of function ‘yaml_parser_initialize’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:8: error: ‘parser’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:9: warning: implicit declaration of function ‘yaml_parser_delete’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:11: warning: implicit declaration of function ‘yaml_emitter_initialize’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:11: error: ‘emitter’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:12: warning: implicit declaration of function ‘yaml_emitter_delete’

libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
 specify the option --include-dirs or uncomment and
 modify the parameter include_dirs in setup.cfg)
zip_safe flag not set; analyzing archive contents...
Adding PyYAML 3.10 to easy-install.pth file

Are these errors important? The installation proceeds, apparently successfully, after this.

Second, would it be better to have three separate spkgs, one each for pybtex, PyYAML, and pyparsing?

Third, should the file patches/pybtex-doc_tree.patch.org be deleted? I see a reference to it in SPKG.txt, but why do we need it? It might be better just to give the link to the original patch and then say that it has been rebased. Rebasing is the only change, right?

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 26, 2011

Changed keywords from none to BibTeX citations

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Sep 27, 2011

comment:3

Thanks for looking into this!

Replying to @jhpalmieri:

When I install the spkg on a Mac OS X box, I see this

Processing PyYAML-3.10.zip
Running PyYAML-3.10/setup.py -q bdist_egg --dist-dir /var/folders/JV/JVYCpshdHd4FFoThuUgD8k+++TI/-Tmp-/easy_install-e_csNv/PyYAML-3.10/egg-dist-tmp-KAUGDh
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:2:18: error: yaml.h: No such file or directory
build/temp.macosx-10.6-i386-2.6/check_libyaml.c: In function ‘main’:
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: ‘yaml_parser_t’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: (Each undeclared identifier is reported only once
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: for each function it appears in.)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:5: error: expected ‘;’ before ‘parser’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:6: error: ‘yaml_emitter_t’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:6: error: expected ‘;’ before ‘emitter’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:8: warning: implicit declaration of function ‘yaml_parser_initialize’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:8: error: ‘parser’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:9: warning: implicit declaration of function ‘yaml_parser_delete’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:11: warning: implicit declaration of function ‘yaml_emitter_initialize’
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:11: error: ‘emitter’ undeclared (first use in this function)
build/temp.macosx-10.6-i386-2.6/check_libyaml.c:12: warning: implicit declaration of function ‘yaml_emitter_delete’

libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
 specify the option --include-dirs or uncomment and
 modify the parameter include_dirs in setup.cfg)
zip_safe flag not set; analyzing archive contents...
Adding PyYAML 3.10 to easy-install.pth file

Are these errors important? The installation proceeds, apparently successfully, after this.

PyYAML Supports libYAML for speed reasons only, so you can ignore these messages. But I removed libYAML support from the SPKG (I will update the link soon), so that nobody gets confused.

Second, would it be better to have three separate spkgs, one each for pybtex, PyYAML, and pyparsing?

sagenb also includes its dependencies. It would be too much trouble to maintain three different SPKGs.

Third, should the file patches/pybtex-doc_tree.patch.org be deleted? I see a reference to it in SPKG.txt, but why do we need it? It might be better just to give the link to the original patch and then say that it has been rebased. Rebasing is the only change, right?

We don't know, if the link will change or will be unavailable some day. Burcin thought, it would probably be safer like this.

@sagetrac-ranosch

This comment has been minimized.

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Sep 27, 2011

comment:4

Updated package not to support system-libYAML-bindings. Link is now http://sage.math.washington.edu/home/burcin/spkg/pybtex-0.15-r1.spkg

@jhpalmieri: Would you mind to look at it again, please?

The changes are available on https://bitbucket.org/niels_mfo/pybtex-0.15

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented May 28, 2012

comment:5

Upstream update. See SPKG.txt for more info.

@sagetrac-ranosch

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:6

This installed correctly, even though I disabled internet access while installing it. So that's good.

Regarding SPKG.txt: surely Python is a dependency. You should make this explicit, so that if/when this becomes a standard package, people where it goes in the makefile spkg/standard/deps. Also, I would add a little bit to the description; for example,

diff --git a/SPKG.txt b/SPKG.txt
--- a/SPKG.txt
+++ b/SPKG.txt
@@ -2,7 +2,8 @@
 
 == Description ==
 
-Pybtex is a drop-in replacement for BibTeX written in Python.
+Pybtex is a drop-in replacement for BibTeX written in Python. That is,
+you can run 'pybtex FILE' instead of 'bibtex FILE'.
 
 We use the bazaar trunk because it is less buggy and more feature-rich.
 The latest version is available through this command:

When I ran this on a file, I got this error message:

amsplain.bst: %
amsplain.bst: ^^^
amsplain.bst: ERROR: Syntax error in line 333: BST command expected.

but maybe I don't have things configured correctly...

It might be a good idea to write an spkg-check script, which does nothing if nose is not installed, but runs self-tests if it is. This is not very important right now, but if you have a chance...

Finally, you need an attachment for the scripts repository. See attached.

@jhpalmieri
Copy link
Member

Attachment: trac_11851-hgignore.patch.gz

SAGE_ROOT/local/bin repo

@jhpalmieri

This comment has been minimized.

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Jun 14, 2012

comment:8

Replying to @jhpalmieri:

This installed correctly, even though I disabled internet access while installing it. So that's good.

Regarding SPKG.txt: surely Python is a dependency. You should make this explicit, so that if/when this becomes a standard package, people where it goes in the makefile spkg/standard/deps. Also, I would add a little bit to the description; for example, [...]

Thanks for checking, updated the spkg with your suggestions.

When I ran this on a file, I got this error message:

amsplain.bst: %
amsplain.bst: ^^^
amsplain.bst: ERROR: Syntax error in line 333: BST command expected.

but maybe I don't have things configured correctly...

What exactly did you do? I cannot reproduce the error.

It might be a good idea to write an spkg-check script, which does nothing if nose is not installed, but runs self-tests if it is. This is not very important right now, but if you have a chance...

I don't think that is possible. Maybe when nose becomes an optional package. But at the moment, when nose is installed on the system, sage can run the nosetests command, but python won't find nose:

Traceback (most recent call last):
  File "/usr/bin/nosetests", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/niels/mfo/sage-5.0/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py", line 2672, in <module>
    working_set.require(__requires__)
  File "/home/niels/mfo/sage-5.0/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py", line 655, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/niels/mfo/sage-5.0/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py", line 553, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: nose==1.1.2

That error occurs when running nosetests in sage -sh or spkg-check with nose installed on my system.

Finally, you need an attachment for the scripts repository. See attached.

Thanks, didn't know about that.

@sagetrac-ranosch

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:9

Regarding nose, I was thinking of something like this in spkg-check:

if [ -x "$SAGE_LOCAL/bin/nosetests" ]; then
    # RUN TESTS HERE.
    if [ $? -ne 0 ]; then  # REPLACE WITH SUITABLE CHECK THAT TESTS PASSED.
        echo >&2 "Error running tests."
        exit 1
    fi
else
    echo "Not running tests since nose is not installed."
fi

Or you could replace the first line with a test for the suitable library in $SAGE_ROOT/local/lib/python/site-packages, say by running a little python script.

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Jun 15, 2012

comment:10

Am I missing something, or would this only make sense if nose would actually be a (at least optional) spkg. Sure, you could install nose into sage by hand. But that sounds a little hacky to me. I would much rather prefer to wait for the spkg. (Please correct me, if I'm missing something. Otherwise I feel like making (risking) more problems than solving.)

@jhpalmieri
Copy link
Member

comment:11

I still think that Python should be listed as a dependency. Otherwise, this looks okay.

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Jun 16, 2012

comment:12

Sure. Is that alright?

@jhpalmieri
Copy link
Member

comment:13

I'm happy with your changes, but, sorry, I keep finding more small problems. I think the last one is this: in the ChangeLog section of SPKG.txt, the changes should be in the reverse order, starting with the most recent, ending with the initial version.

@sagetrac-ranosch
Copy link
Mannequin Author

sagetrac-ranosch mannequin commented Jun 18, 2012

comment:14

Oh, that's right, the order needs to be reversed: https://bitbucket.org/niels_mfo/pybtex/src/20120618/SPKG.txt

I'm really happy for any communication whatsoever, as long as we all work on improving stuff. So if there any more problems (big or small), please don't hesitate to write about them :-)

@jhpalmieri
Copy link
Member

comment:15

Yes, that looks good now. Regarding spkg-install, you don't really need to create and delete the directory tmp: I think you can just unzip and build !PyYAML-3.10.zip in place:

diff --git a/spkg-install b/spkg-install
--- a/spkg-install
+++ b/spkg-install
@@ -6,19 +6,19 @@ if [ "x$SAGE_LOCAL" = x ]; then
    exit 1
 fi
 
+CUR=`pwd`
+
 # need to suppress confusing error messages and don't depend on system
 # libraries, so easy_install is not available
-mkdir tmp &&
-    unzip -o PyYAML-3.10.zip -d tmp &&
-    cd tmp/PyYAML-3.10 &&
+unzip -o PyYAML-3.10.zip &&
+    cd PyYAML-3.10 &&
     python setup.py --without-libyaml install --prefix="$SAGE_LOCAL"
 if [ $? -ne 0 ]; then
    echo "Error installing PyYAML."
    exit 1
 fi
 
-cd ../..
-rm -rf tmp
+cd "$CUR"
 
 easy_install pyparsing-1.5.6.zip
 if [ $? -ne 0 ]; then

But this is not very important; it works either way.

So if you upgrade the spkg to use your new version of SPKG.txt, you can switch this to "positive review".

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@sagetrac-ranosch

This comment has been minimized.

@jdemeyer jdemeyer modified the milestones: sage-5.1, sage-5.2 Jun 28, 2012
@haraldschilly
Copy link
Member

comment:18

moved spkg to the servers

@jdemeyer
Copy link

jdemeyer commented Jul 2, 2012

Merged: sage-5.2.beta0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants