<commit_before>
Packaging Scipy
===============

Introduction
------------

People who have tried to create a distribution of a Scipy package have
been faced with complex dependency issues between scipy and f2py2e
modules. Namely, both Scipy and F2py tar-balls provide scipy_distutils
module that may have different time stamps, for instance, not to
mention that packaging tools (e.g. debian apt) don't like such cases
at all. Scipy_distutils is part of the Scipy package while F2py ships
scipy_distutils for the convenience of F2py users.  So, the issue of
distributing Scipy and F2py have been brought up in Scipy and F2py
mailing lists many times and the purpose of this document is to
provide instructions for the packagers how to overcome this issue.

Any suggestions, especially from the packagers, to improve these
instructions are most welcome. Please, send your comments or patches
to <EMAIL>.

Packaging Scipy and friends
---------------------------

Instead of using tar-balls from web, currently it is highly
recommended getting scipy and other software from their CVS
repository. Usually CVS versions are more stable than tar-balls
(sometimes not but any issues will be quickly fixed), also core
developers do not test tar-balls very frequently and occasionally some
important files may be missing.

1) Get scipy,f2py and their dependencies from CVS:

  export CVSROOT=:pserver:anonymous@scipy.<EMAIL>:/home/cvsroot
  cvs -z7 co scipy_core
  cvs -z7 co -d scipy world/scipy
  cd scipy && cvs -z7 co Lib_chaco; cd -


  export CVSROOT=:pserver:anonymous@c<EMAIL>.<EMAIL>.ee:/home/cvs
  cvs -z7 co f2py2e

2) Disable scipy_core package in scipy/setup.py file by commenting out
the following line:

  separate_packages += core_packages

If you find building chaco troublesome (e.g. it is known to fail due
to gcc-2.95.4 compiler bugs) then you can disable chaco by commenting
out the following line in  setup.py:

  separate_packages += chaco_packages

3) Disable scipy_distutils checkout in f2py2e/setup.py file by replacing
the following line

  if 'sdist' in sys.argv and not os.path.exists('other/scipy_distutils'):

with

  if 0:

4) Create source tar-balls

  cd scipy_core
  python setup.py sdist
  cp dist/Scipy_core-*.tar.gz ..
  cd ..

  cd f2py2e
  python setup.py sdist
  cp dist/F2PY-*.tar.gz ..
  cd ..

  cd scipy
  # note that this will call swig for agg module (in chaco build),
  # also several tests are run for xplt module
  PYTHONPATH=..:../scipy_core python setup.py sdist
  cp dist/SciPy-*.tar.gz ..
  cd ..

The resulting gzipped tar-files do not contain software overlaps
anymore and should be suitable for packaging.

5) Install scipy_core, f2py2e, and scipy strictly in the given order.
  Unpack all tar-ball sources and run:

  cd Scipy_core-*
  python setup.py install
  cd ..

  cd F2PY-*
  python setup.py install
  cd ..

  cd SciPy-*
  python setup.py install
  cd ..

That's it!<commit_msg>Simplified f2py packaging and added RPMs section<commit_after>.. --*-- rest --*--
.. NB! Keep this document a valid restructured document.

Packaging Scipy
===============

:Author: <NAME> <<EMAIL>>
:Last changed: $Date$
:Revision: $Revision$
:Discussions to: <EMAIL>

Introduction
------------

People who have tried to create a distribution of a Scipy package have
been faced with complex dependency issues between ``scipy`` and
``f2py2e`` modules. Namely, both Scipy and F2py tar-balls provide
``scipy_distutils`` module that may have different time stamps, for
instance, not to mention that packaging tools (e.g. debian apt) don't
like such cases at all. Scipy_distutils is part of the Scipy package
while F2py ships ``scipy_distutils`` for the convenience of F2py
users.  So, the issue of distributing Scipy and F2py have been brought
up in Scipy and F2py mailing lists many times and the purpose of this
document is to provide instructions for the packagers how to overcome
this issue.

Any suggestions, especially from the packagers, to improve these
instructions are most welcome. Please, send your comments or patches
to <EMAIL>.

Packaging Scipy and friends
---------------------------

Instead of using tar-balls from web, currently it is highly
recommended getting scipy and other software from their CVS
repository. Usually CVS versions are more stable than tar-balls
(sometimes not but any issues will be quickly fixed), also core
developers do not test tar-balls very frequently and occasionally some
important files may be missing.

1. Get Scipy, F2py and their dependencies from CVS::

     export CVSROOT=:pserver:<EMAIL>:/home/cvsroot
     cvs -z7 co scipy_core
     cvs -z7 co -d scipy world/scipy
     cd scipy && cvs -z7 co Lib_chaco; cd -

     export CVSROOT=:pserver:<EMAIL>:/home/cvs
     cvs -z7 co f2py2e

2. Disable ``scipy_core`` package in ``scipy/setup.py`` file by commenting
   out the following line::

     separate_packages += core_packages

   If you find building Chaco troublesome (e.g. it is known to fail
   due to gcc-2.95.4 compiler bugs) then you can disable it by
   commenting out the following line in ``setup.py``::

     separate_packages += chaco_packages

3. Create source tar-balls::

     cd scipy_core
     python setup.py sdist
     cp dist/Scipy_core-*.tar.gz ..
     cd ..

     cd f2py2e
     python setup.py sdist
     cp dist/F2PY-*.tar.gz ..
     cd ..

     cd scipy
     # note that this will call swig for agg module (in chaco build),
     # also several tests are run for xplt module
     PYTHONPATH=..:../scipy_core python setup.py sdist
     cp dist/SciPy-*.tar.gz ..
     cd ..

   The resulting gzipped tar-files do not contain software overlaps
   anymore and should be suitable for packaging.

4. Install ``scipy_core``, ``f2py2e``, and ``scipy`` strictly in the
   given order. Unpack all tar-ball sources and run::

     cd Scipy_core-*
     python setup.py install
     cd ..

     cd F2PY-*
     python setup.py install
     cd ..

     cd SciPy-*
     python setup.py install
     cd ..

That's it!

RPMs for Scipy and friends
--------------------------

Follow the items 1-2 above and then continue as follows:

3. Create RPMs::

     cd scipy_core  
     python setup.py bdist_rpm
     cp dist/Scipy_core-*.rpm ..
     cd ..

     cd f2py2e
     # run buildhtml.py script provided by docutils to generate
     # HTML documentation of f2py.
     python setup.py bdist_rpm
     cp dist/F2PY-*.rpm ..
     cd ..

     #XXX: Test bdist_rpm for Scipy

4. Install RPMs in the usual way but keep the order as in item 4.
{'fraction_non_alphanumeric': 0.08659003831417625, 'fraction_numerical': 0.010727969348659003, 'mean_word_length': 3.1044025157232706, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5579481', 'n_tokens_mistral': 2106, 'n_tokens_neox': 2016, 'n_words': 866}