Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 6197d62

Browse files
committed
#7784/sagenb: Add Makefile; update .hgignore and spkg-related files
1 parent ca7bf26 commit 6197d62

File tree

6 files changed

+126
-107
lines changed

6 files changed

+126
-107
lines changed

.hgignore

Lines changed: 7 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# Boring file regexps:
2-
PKG-INFO
3-
push
4-
pull
5-
.cython_hash$
6-
.cython_deps$
7-
sagenb\.egg-info/
82
\.git$
93
\.hi$
104
\.mtl$
@@ -54,83 +48,21 @@ sagenb\.egg-info/
5448
^dist($|/)
5549
^notes($|/)
5650
(^|/).old($|/)
57-
(^|/).tmp_pyrexembed($|/)
5851
(^|/).doctest($|/)
5952
(^|/)deleted($|/)
6053
^build($|/)
61-
^changelog_darcs.txt($|/)
6254
^mirror($|/)
6355
^new($|/)
6456
^commit($|/)
6557
^export($|/)
66-
^sage/.*\.c$
67-
^sage/ext/arith.c$
68-
^sage/ext/arith_gmp.c$
69-
^sage/ext/coerce.c$
70-
^sage/ext/congroup_pyx.c$
71-
^sage/ext/dense_matrix_pyx.c$
72-
^sage/ext/element.c$
73-
^sage/ext/gens.c$
74-
^sage/ext/group.c$
75-
^sage/ext/heilbronn.c$
76-
^sage/ext/integer.c$
77-
^sage/ext/intmod_pyx.c$
78-
^sage/ext/module.c$
79-
^sage/ext/mpc.c$
80-
^sage/ext/mpfr.c$
81-
^sage/ext/p1list.c$
82-
^sage/ext/polynomial_pyx.c$
83-
^sage/ext/rational.c$
84-
^sage/ext/ring.c$
85-
^sage/ext/sage_object.c$
86-
^sage/ext/search.c$
87-
^sage/ext/sparse_matrix_pyx.c$
88-
^sage/ext/sparse_poly.c$
89-
^sage/libs/ec/ec.c$
90-
^sage/libs/hanke/hanke.c$
91-
^sage/libs/mwrank/mwrank.c$
92-
^sage/libs/ntl/ntl.c$
93-
^sage/libs/pari/gen.c$
94-
^sage/libs/pari/test.c$
95-
^sage/libs/.*/interrupt\.(h|pxi)$
96-
^sage/.doctest/err
97-
^sage/libs/cf/cf.pyx
98-
^sage/libs/cf/cf_embed.cpp
99-
^sage/libs/linbox/finite_field_givaro.cpp
100-
^sage/rings/finite_field_givaro.cpp
101-
version.py
102-
^c_lib/.deps/.*
103-
^c_lib/.libs/.*
104-
^c_lib/.*\.lo$
105-
^c_lib/.*\.os$
106-
^c_lib/Makefile$
107-
^c_lib/autom4te.cache/.*$
108-
^c_lib/config.log$
109-
^c_lib/config.status$
110-
^c_lib/libtool$
111-
^c_lib/libcsage.la$
112-
^sage/ext/interpreters/
113-
^sage/libs/ntl/misc.h$
114-
^sage/libs/ntl/ntl.h$
115-
^sage/rings/integer.h$
116-
^sage/rings/padics/padic_generic_element.h$
117-
^sage/rings/rational.h$
118-
^c_lib/.sconsign.dblite$
119-
^c_lib/libcsage.so$
120-
sage/rings/complex_double.h
121-
sage/rings/complex_double_api.h
122-
sage/misc/allocator.h
123-
sage/symbolic/pynac.h
124-
doc/output/*
125-
doc/en/reference/utils/*
126-
doc/en/reference/sage/*
127-
dotsage
12858
MANIFEST
129-
sagenb/data/jmol
130-
~
59+
PKG-INFO
60+
pull
61+
push
62+
release_notes.txt
13163
sage_notebook*
132-
.sagenb
133-
.*~$
134-
sagenb/data/java/jmol
64+
\.sagenb
13565
^sass/src/.sass-cache
66+
sagenb/data/jmol
13667
^sagenb.egg-info
68+
setup.cfg

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
recursive-include sagenb *
22
recursive-include sass *
33
prune sass/src/.sass-cache
4-
include *.txt MANIFEST.in .hgignore .hgtags sdist spkg-dist SPKG.txt go
4+
include *.txt Makefile MANIFEST.in .hgignore .hgtags sdist spkg-dist SPKG.txt go
55
recursive-include .hg *
66
global-exclude *.pyc *.pyo *.orig *.rej *~ \#* *\#

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# -*- makefile -*-
2+
# Makefile for the Sage Notebook project (http://nb.sagemath.org/).
3+
# GNU make help: http://www.gnu.org/software/make/manual
4+
5+
SAGE = sage
6+
HG = $(SAGE) -hg
7+
PYTHON = $(SAGE) -python
8+
SETUP = $(PYTHON) setup.py
9+
10+
install:
11+
$(SETUP) install
12+
13+
develop:
14+
$(SETUP) develop
15+
16+
update:
17+
$(HG) pull http://boxen.math.washington.edu:8100
18+
$(HG) update
19+
20+
doc: doc-jsmath
21+
doc-pngmath:
22+
$(SAGE) -docbuild reference html $(OPTS)
23+
doc-jsmath:
24+
$(SAGE) -docbuild reference html -j $(OPTS)
25+
26+
test:
27+
$(SAGE) -t -sagenb $(OPTS)
28+
ptest:
29+
$(SAGE) -tp \
30+
`$(PYTHON) -c "import multiprocessing as m; print m.cpu_count()"` \
31+
-sagenb $(OPTS)
32+
33+
spkg:
34+
./spkg-dist
35+
36+
.PHONY: clean distclean

SPKG.txt

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,51 @@
55
The Sage Notebook is a web-based graphical user interface for
66
mathematical software.
77

8-
== Website ==
9-
108
== License ==
119

1210
GPLv2+
1311

1412
== SPKG Maintainers ==
1513

1614
* William Stein
15+
* Tim Dumol
16+
* Mitesh Patel
1717

1818
== Upstream Contact ==
1919

2020
* William Stein
21+
* Homepage: http://nb.sagemath.org/
2122

2223
== Dependencies ==
23-
* Python 2.6 (?) or later -- only tested with 2.6
2424

25-
== Special Update/Build Instructions ==
25+
* Python >= 2.6
26+
* jinja2 >= 2.1.1
27+
* Twisted >= 8.2
28+
* zope.testbrowser >= 3.7.0a1 (included)
29+
* Sphinx >= 0.6.3 (pretty docstrings)
30+
31+
== Special Update / Build Instructions ==
32+
33+
* To release a new spkg, check that
34+
35+
* All changes are committed.
36+
* .hgignore and MANIFEST.in are current.
37+
* The patch queue is clear.
38+
* The notebook runs.
39+
* The doctests pass: sage -t -sagenb
40+
* The Selenium tests pass (optional, for now).
41+
42+
Then,
43+
44+
* Update the version in setup.py and commit this change.
45+
* Run spkg-dist.
46+
* Install and test the new spkg: sage -f dist/sagenb-*.spkg
47+
48+
Contact a maintainer about pushing updates to the public Mercurial
49+
repository.
2650

27-
* None
51+
* Stylesheets (CSS): see sass/readme.txt.
2852

2953
== Changelog ==
3054

55+
* For an accurate log of changes, run "hg log" in src/sagenb.

sdist

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
hg ci && sage -python setup.py sdist
1+
#!/bin/bash
2+
set -e
23

3-
./push
4+
sage -hg ci
5+
6+
sage -python setup.py sdist
7+
8+
echo "**********************************************************"
9+
echo "* If this is an official SageNB release, don't forget to *"
10+
echo "* push the changes to the public Mercurial repository. *"
11+
echo "**********************************************************"
12+
#./push

spkg-dist

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
11
#!/usr/bin/env python
2-
import os, shutil, sys, tarfile
2+
# Create a new Sage Notebook spkg.
3+
4+
import os
5+
import sys
6+
import stat
7+
import shutil
8+
import tarfile
9+
import subprocess
310
from tempfile import mkdtemp
411

512
from pkg_resources import Requirement
613
from setuptools.package_index import PackageIndex
7-
# Create an spkg of the Separated Sage notebook for inclusion in Sage.
814

9-
# Get the version from setup.py
15+
# Get the version from setup.py.
1016
version_line = [f for f in open('setup.py').readlines() if 'version' in f][0]
1117
i = version_line.find("'")
1218
j = version_line.rfind("'")
13-
version = version_line[i+1:j]
19+
version = version_line[i + 1:j]
1420

15-
# Create the sdist
21+
# Create the source distribution.
22+
proc = subprocess.Popen([os.path.join(os.path.curdir, 'sdist')], shell=True)
23+
if proc.wait():
24+
print "Uncommitted changes in repository. Stopping."
25+
sys.exit(1)
1626

17-
os.system(os.path.join(os.path.curdir, 'sdist'))
18-
19-
# Create the spkg
20-
21-
path = os.path.join('dist','sagenb-%s'%version)
27+
# Create the spkg.
28+
base = 'sagenb-%s' % version
29+
path = os.path.join('dist', base)
2230
if os.path.exists(path):
2331
shutil.rmtree(path)
24-
2532
os.makedirs(path)
2633

27-
file = 'sagenb-%s.tar.gz'%version
28-
print "Extracting %s"%file
34+
file = 'sagenb-%s.tar.gz' % version
35+
print "Extracting %s" % file
2936
t = tarfile.open(os.path.join('dist', file))
30-
3137
t.extractall(path)
3238

3339
os.chdir(path)
3440
os.mkdir('src')
35-
shutil.move('sagenb-%s'%version, 'src/sagenb')
41+
shutil.move(base, os.path.join('src', 'sagenb'))
3642

37-
spkg_install_fd = open('spkg-install','w')
38-
spkg_install_fd.write("cd src; ")
43+
spkg_install = os.path.abspath(os.path.join(os.path.curdir, 'spkg-install'))
44+
spkg_install_fd = open(spkg_install, 'w')
45+
spkg_install_fd.write("cd src\n")
3946

4047
shutil.copy(os.path.join(os.path.pardir, os.path.pardir, 'SPKG.txt'),
4148
os.path.curdir)
@@ -44,24 +51,34 @@ print "Fetching the required packages"
4451
pkg_index = PackageIndex()
4552

4653
tmp_dir = mkdtemp()
47-
required_packages = ('pytz>=2009r', 'zope.i18nmessageid>=3.5', 'zope.event>=3.4.1',
48-
'ClientForm>=0.2.10', 'mechanize>=0.1.11', 'zope.interface>=3.3.0',
49-
'zope.schema>=3.5.4', 'zope.testbrowser>=3.7.0a1')
54+
required_packages = ('pytz>=2009r',
55+
'zope.i18nmessageid>=3.5',
56+
'zope.event>=3.4.1',
57+
'ClientForm>=0.2.10',
58+
'mechanize>=0.1.11',
59+
'zope.interface>=3.3.0',
60+
'zope.schema>=3.5.4',
61+
'zope.testbrowser>=3.7.0a1')
62+
5063
pkg_locations = []
5164

5265
for pkg in required_packages:
5366
print "Fetching %s" % pkg
54-
dist = pkg_index.fetch_distribution(Requirement.parse(pkg), tmp_dir, True, True)
67+
dist = pkg_index.fetch_distribution(Requirement.parse(pkg), tmp_dir,
68+
True, True)
5569
pkg_locations.append(os.path.abspath(dist.location))
5670

5771
for location in pkg_locations:
5872
shutil.copy(location, 'src')
59-
spkg_install_fd.write('easy_install %s; ' % os.path.basename(location))
73+
spkg_install_fd.write('easy_install %s\n' % os.path.basename(location))
6074

6175
os.chdir(os.path.pardir)
6276

63-
spkg_install_fd.write('cd sagenb; python setup.py install')
77+
spkg_install_fd.write('cd sagenb\n')
78+
spkg_install_fd.write('python setup.py install\n')
6479
spkg_install_fd.close()
80+
os.chmod(spkg_install, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP |
81+
stat.S_IROTH | stat.S_IXOTH)
6582
shutil.rmtree(tmp_dir)
66-
os.system('sage -pkg sagenb-%s'%version)
6783

84+
subprocess.call(['sage -pkg ' + base], shell=True)

0 commit comments

Comments
 (0)