Skip to content

Commit

Permalink
Add note on CPython 2.7 compatibility (#262)
Browse files Browse the repository at this point in the history
Be clear that Jython is not a way to avoid migrating to Python 3. (C extensions or other stdlib incompatibilities make it more work.) In full on the GitHub project home and briefly in the installation README.
  • Loading branch information
jeff5 committed Sep 2, 2023
1 parent 7fc142c commit e55e057
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ the implementation of Python in Java.
Only version 2.7 of Python can be supported at present
(but watch this space for a 3.x version).

Along with good (not perfect!) language
and runtime compatibility with CPython 2.7,
Jython 2.7 provides substantial support of the Python ecosystem.
This includes built-in support of *pip/setuptools*
(you can use `bin/pip` if the targets do not include `C` extensions)
and a native launcher for Windows (`bin/jython.exe`)
## Compatibility

Jython provides good compatibility with Python 2.7 *the language*.
Also, a high proportion of the standard library is included,
taken from late versions of CPython (around 2.7.13).
Some standard library modules have a Jython-specific implementation
that has not kept pace with its CPython counterpart.

Jython 2.7 support for the Python ecosystem
includes built-in support of *pip/setuptools*.
You can use `bin/pip` if the targets do not include `C` extensions.
There is a native launcher for Windows (`bin/jython.exe`)
that works essentially like the `python` command.

Jim Baker presented a talk at PyCon 2015 about Jython 2.7,
including demos of new features: https://www.youtube.com/watch?v=hLm3garVQFo

## Support

Python 2.7 (the language) is no longer supported by the PSF.
Running on Jython should not be considered an alternative to porting your
application to Python 3, due to the limitations cited here
and the small amount of effort available to support 2.7.x.
Jython 2.7 is offered for continuity because a 3.x is not yet available.

See [ACKNOWLEDGMENTS](ACKNOWLEDGMENTS) for details about Jython's copyright,
license, contributors, and mailing lists.
Consult [NEWS](NEWS) for detailed release notes, including bugs fixed,
Expand All @@ -36,6 +50,8 @@ The project uses Git for version-control,
and the master repository is at https://github.com/jython/jython,
You should clone this repository to create a buildable copy of the latest state
of the Jython source.
Start a new branch for any bug-fix or experimentation you plan.

The previously authoritative repository at https://hg.python.org/jython is not now in use,
remaining frozen at v2.7.2.

Expand All @@ -52,13 +68,14 @@ that you may run from the check-out root with:
```
dist/bin/jython
```
Other `ant` targets exist, notably `clean`, and `jar`.
Other `ant` targets exist, notably `clean`, `javatest` and `jar`.

You can test your build of Jython (by running the regression tests),
with the command:
```
dist/bin/jython -m test.regrtest -e -m regrtest_memo.txt
```
or by invoking the Ant target `regrtest`.

### Build an installer using `ant`

Expand All @@ -79,8 +96,7 @@ For the console version. (A `--help` option gives you the full story.)

### Build a JAR using Gradle

Experimentally, we have a Gradle build that results in a family of JARs,
and a POM.
We have a Gradle build that results in a family of JARs and a POM.
This is intended to provide the Jython core in a form that Gradle and Maven
users can consume as a dependency.
Invoke this with:
Expand All @@ -93,5 +109,3 @@ Whereas the JARs delivered by the installer are somewhat "fat",
embedding certain dependencies in shaded (renamed) form,
the JAR from the Gradle build is "spare"
and cites its dependencies externally through a POM.
The project would like to know if this is being done suitably
for downstream use.
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ This is @readme.release@ release of version @jython.version.short@ of Jython.
Along with language and runtime compatibility with CPython 2.7, Jython 2.7
provides substantial support of the Python ecosystem. This includes built-in
support of pip/setuptools (you can use with bin/pip) and a native launcher
for Windows (bin/jython.exe).
for Windows (bin/jython.exe). Python 2.7 is out of support. Running on Jython
should not be considered an alternative to porting to Python 3.

Jim Baker presented a talk at PyCon 2015 about Jython 2.7, including demos
of new features: https://www.youtube.com/watch?v=hLm3garVQFo
Expand Down

0 comments on commit e55e057

Please sign in to comment.