Note
These instrctions are a modified version of the CPython devguide
These instructions cover how to get a working copy of the source code and a compiled version of the Jython interpreter (Jython is the version of Python available from http://www.jython.org/). It also gives an overview of the directory structure of the Jython source code.
OpenHatch also has a great setup guide for Python for people who are completely new to contributing to open source.
Jython is developed using Mercurial. The Mercurial command line program is named hg; this is also used to refer to Mercurial itself. Mercurial is easily available for common Unix systems by way of the standard package manager; under Windows, you might want to use the TortoiseHg graphical client.
One should always work from a working copy of the Jython source code. While it may be tempting to work from the copy of Jython you already have installed on your machine, it is very likely that you will be working from out-of-date code as the Jython core developers are constantly updating and fixing things in their VCS. It also means you will have better tool support through the VCS as it will provide a diff tool, etc.
To get a working copy of the in-development branch of Jython (core developers use a different URL as outlined in How to Become a Core Developer), run:
hg clone http://hg.python.org/jython
If you want a working copy of an already-released version of Jython, i.e., a version in maintenance mode, you can update your
working copy. For instance, to update your working copy to Jython 2.5, do:
hg update 2.5
You will need to re-compile Jython when you do such an update.
Do note that Jython will notice that it is being run from a working copy. This means that if you edit Jython’s source code in your working copy, changes to Python code will be picked up by the interpreter for immediate use and testing. (If you change Java code, you will need to recompile the affected files as described below.)
Patches for the documentation can be made from the same repository; see Documenting Jython.
Compiling Jython is fairly simple, from the top level of a source checkout do:
ant
The core Jython interpreter depends on a number of jars. TODO: jars TODO: jython dev build
Once Jython is done building you will then have a working build that can be run in-place; ./dist/bin/jython There is normally no need to install your built copy of Jython! The interpreter will realize where it is being run from and thus use the files found in the working copy.
Python is used widely enough that practically all code editors have some form of support for writing Python code. Various coding tools also include Python support.
Jython specific support is less common but supported in several IDEs. Many of the core developers do pretty well with Emacs or Vim :)
TODO: Eclipse
TODO: Netbeans
For editors and tools which the core developers have felt some special comment is needed for coding in Python, see Additional Resources.
There are several top-level directories in the Jython source tree. Knowing what each one is meant to hold will help you find where a certain piece of functionality is implemented. Do realize, though, there are always exceptions to every rule.
Outdated Jython website docs.
TODO: Jython should put our fork of the CPython directory (the official documentation) in an official hg repo in the python.org infrastructure. The official documentation. This is what http://jython.org/docs uses. To build the docs, see TODO.
Code related to the parser. The definition of the AST nodes is also kept
TODO: It may be a good idea to rename this directory “Parser” to match CPython.
Outdated framework for testing Jython.
Todo: tests that remain here should be ported to Lib/tests/